pyopmnearwell.ml.utils module#

Utilility functions for the ensemble and ML capabilities.

Note: ml.ensemble makes use of np.random.default_rng, which ignores the global seed of numpy. Make sure to set them locally for full determinism.

enable_determinism(seed=None)[source]#

Set global random seeds and enable deterministic TensorFlow operations.

keras.utils.set_random_seed configures the Python, NumPy, and TensorFlow seeds. Local numpy.random.Generator instances are independent and must be seeded when they are created.

Parameters:

seed (int | None, optional) -- Seed applied to the supported global random-number generators.