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.

pyopmnearwell.ml.utils.enable_determinism(seed: int | None = None)

Set a seed for python, numpy, and tensorflow and enable deterministic behavior.

Args:
seed: (Optional[int]): Seed for the np.random.Generator. Default is

None.