idaholab / raven

RAVEN is a flexible and multi-purpose probabilistic risk analysis, validation and uncertainty quantification, parameter optimization, model reduction and data knowledge-discovering framework.
https://raven.inl.gov/
Apache License 2.0
217 stars 133 forks source link

Implements a numpy RNG which takes advantage of the many functions of numpy's RNGs as an alternative to Crow's RNG #2206

Closed j-bryan closed 9 months ago

j-bryan commented 10 months ago

Pull Request Description

What issue does this change request address? (Use "#" before the issue to link it, i.e., #42.)

2204

What are the significant changes in functionality due to this change request?

This is an alternative approach to resolving issue #2204 (see pull request #2205 for the other approach). In this approach, the existing implementation of the numpy stochastic environment which used numpy.random.RandomState is updated to using the numpy.random.Generator class. This Generator class provides additional control over the random numbers generated, such as specifying data types. Being able to specify a 32-bit data type for random numbers avoids an issue of RandomState consuming 2 random states from the underlying 32-bit MT19337 Mersenne Twister bit generator object to produce 64-bit random numbers. The Generator class also allows for use of other bit generators, should this flexibility be needed in the future.

This PR is left as [WIP] because the numpy RNG will cause many many failing tests.


For Change Control Board: Change Request Review

The following review must be completed by an authorized member of the Change Control Board.

j-bryan commented 9 months ago

Closing due to being made redundant by pull request #2205. The approach proposed by this pull request causes more than 400 of the existing integration tests (about 50%) fail by changing the random number generator output. It was deemed impractical to revise that many tests for a change with little meaningful impact in the operation of random number generation and distribution sampling.