|
Mila
Deep Neural Network Library
|
Singleton class providing centralized random number generation. More...
Public Member Functions | |
| std::mt19937 | getGenerator () const |
| Gets a random number generator initialized with the global seed. | |
| unsigned int | getSeed () const |
| Gets the currently set random seed. | |
| void | setSeed (unsigned int seed) |
| Sets the global random seed. | |
Static Public Member Functions | |
| static RandomGenerator & | getInstance () |
| Gets the singleton instance of the RandomGenerator. | |
Singleton class providing centralized random number generation.
This class manages random number generation for the entire codebase, allowing control over reproducibility through seed management.
|
inline |
Gets a random number generator initialized with the global seed.
This returns a copy of the generator, so subsequent calls to setSeed won't affect already obtained generators.
|
inlinestatic |
Gets the singleton instance of the RandomGenerator.
|
inline |
Gets the currently set random seed.
|
inline |
Sets the global random seed.
| seed | The seed value (use 0 for non-deterministic behavior from std::random_device) |