-
Notifications
You must be signed in to change notification settings - Fork 12
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
rand() #109
Comments
Hmm, does IntervalSets actually implement rand? I seem to get an error: julia> using IntervalSets; rand(1..2)
ERROR: ArgumentError: Sampler for this object is not defined Apart from that, did you have any issues implementing Not sure that this package itself is the place though. There is a |
Thanks! |
It works for me with IntervalSets 0.7.1 julia> using IntervalSets
julia> rand(1..2)
1.0824522848444758
No, it should not be a terrible challenge to implement. It is just a communication/packaging/conceptual issue. If I implement So, the question is where to implement it. Since |
(to be clear, I'm happy to make a PR for the low hanging fruit cases at least but just want to make sure package maintainers are on board before I jump in) |
Well if IntervalSets has it, we are just extending. Why don't you aim for a file like src/applications/rand.jl to get started, thanks for offering. |
First of all, thank you, @daanhb and everyone else for making this package - we have been needing something to represent these types of spaces for a while: JuliaPOMDP/POMDPs.jl#301, JuliaReinforcementLearning/CommonRLSpaces.jl#14 (also, it seems quite a challenge to deal with all of the conceptual issues and different use cases people have - I admire your valor in attempting that 😃 )
One thing that we commonly need in our applications is to get a random element of a set, for example
rand(ProductDomain(1..2, 3..4))
.Do you think that this package should include
rand
?On one hand, this does not make a ton of sense because it is not clear what distribution this should be drawn from (uniform would be a natural choice, but may be hard to implement for some sets), but on the other hand, many other sets without distributions support
rand
, i.e. (rand(Set([1,2]))
,rand(1..2)
).If
rand
does not belong in this package, where should it go?The text was updated successfully, but these errors were encountered: