-
Notifications
You must be signed in to change notification settings - Fork 11
Don't hardcode array type in MultiContinuousSpace. #28
Conversation
Huh, where did that CI failure come from? Tests all passed on my system before I pushed - strange. Will fix this, provided people want the change in this PR. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I like this idea.
)) || throw(ArgumentError("each element of $low must be less than $high")) | ||
new{size(low),ndims(low)}(low, high) | ||
end | ||
struct MultiContinuousSpace{S, N, Fl<:AbstractFloat, AFl<:AbstractArray{Fl,N}} <: AbstractDiscreteSpace |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Does anything speak against MultiContinuousSpace{S, N, A <: AbstractArray{<:Number, N}}
?
|
||
Base.eltype(::MultiContinuousSpace{S,N}) where {S,N} = Array{Float64,N} | ||
Base.in(xs, s::MultiContinuousSpace{S,N}) where {S,N} = | ||
Base.eltype(::MultiContinuousSpace{S,N,Fl}) where {S,Fl,N} = Array{Fl,N} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I guess this should then become Base.eltype(::MultiContinuousSpace{S,N,AF1}) where {S,N,A} = A
.
Base.eltype(::MultiContinuousSpace{S,N}) where {S,N} = Array{Float64,N} | ||
Base.in(xs, s::MultiContinuousSpace{S,N}) where {S,N} = | ||
Base.eltype(::MultiContinuousSpace{S,N,Fl}) where {S,Fl,N} = Array{Fl,N} | ||
Base.in(xs, s::MultiContinuousSpace) = |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This doesn't work without Base.in(xs, s::MultiContinuousSpace{S}) where S =
The idea sounds great. I'll integrate this feature in the JuliaReinforcementLearning/ReinforcementLearningCore.jl#1 Due to the heavy Wuhan_coronavirus_outbreak , I have plenty of time to work on this project in the next several weeks. Hope we can move forward and make a release soon. |
Sorry for the delay with this - ICML deadline has been squeezing my time. I can get to this PR as soon as that deadline passes, if still needed by then! |
It seems this has since been rewritten and moved into ReinforcementLearningCore. |
Right now this is hardcoded to Array{Float64}, which prevents users using, for example, CuArray{Float32} instead given an appropriate environment.