You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
This repository was archived by the owner on Jul 16, 2021. It is now read-only.
We frequently use randomness throughout rusty-machine and in all cases default to the rand::thread_rng (except in the new Shuffler added by #135). It is very valuable for users to be able to set a seed to ensure that their models behave the same way on different runs.
It would be nice if we could capture this with minimal effect on the current API. It is probably a requirement that the models (and other components) own their own random number generators. We would likely need to add a new generic type parameter on the models:
pubstructMLModel<T1,T2, ...,Tn,R>whereR:Rng{// All the previous fieldsrng:Rng,}
The alternative is to use a Box for this field and provide a trait which allows the user to modify the generator for the model:
This approach will keep the API a little cleaner. We can also control access to shared code requiring randomness by using the Randomizable trait. For example we could wrap some of the rand_utils functions to work on an object which implements Randomizable. I'd still like the rand_utils functions to be accessed in their current state though.
Thoughts on this are very welcome. I suspect we will need to implement something to get a good idea of the benefits/drawbacks of any approach.
We frequently use randomness throughout rusty-machine and in all cases default to the
rand::thread_rng(except in the newShuffleradded by #135). It is very valuable for users to be able to set a seed to ensure that their models behave the same way on different runs.It would be nice if we could capture this with minimal effect on the current API. It is probably a requirement that the models (and other components) own their own random number generators. We would likely need to add a new generic type parameter on the models:
The alternative is to use a Box for this field and provide a trait which allows the user to modify the generator for the model:
This approach will keep the API a little cleaner. We can also control access to shared code requiring randomness by using the
Randomizabletrait. For example we could wrap some of therand_utilsfunctions to work on an object which implementsRandomizable. I'd still like therand_utilsfunctions to be accessed in their current state though.Thoughts on this are very welcome. I suspect we will need to implement something to get a good idea of the benefits/drawbacks of any approach.