-
Notifications
You must be signed in to change notification settings - Fork 120
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
use Armadillo RNG support #6
Comments
Armadillo has an internal class called The Perhaps it would be sufficient to simply use the public randi(), randu(), randn() and randg() functions ? In armadillo version 8.400+ all of the above functions were extended to output single scalars. If armadillo 8.400 is "too recent", it's still possible to use the above functions to generate scalars. Simply use As a sidenote, armadillo 8.400 is available in Ubuntu 18.04. |
In case of: std::shuffle(visitationOrder.begin(), visitationOrder.end(), mlpack::math::randGen); it should be reasonable to use:
any thoughts? |
For the other cases I agree, it would be simple to use: |
Agreed on both counts---I wonder why we didn't just use |
I guess the benefit is that |
arma:shuffle() should detect aliasing and do an inplace shuffle: |
Thanks for the clarification, should have checked first. 05a8743 implements the modifications. |
I think this one is fully handled now---I see no use of any random object or anything other than Armadillo's existing public random functions. |
There are a couple instances where mlpack's
Random()
orRandInt()
functions are used:I think this shows up a lot in the tests too. Instead, we can use Armadillo's RNG here; so
mlpack::math::randGen
can (probably) be replaced byarma::arma_rng_cxx11_instance
or something similar, and we can use that to generate random numbers.However there is also the Armadillo configuration parameter
ARMA_USE_EXTERN_CXX11_RNG
; but, looking through it quickly, I don't see anything different for us to do whether or not someone using ensmallen has written#define ARMA_USE_EXTERN_CXX11_RNG
.The text was updated successfully, but these errors were encountered: