Skip to content
heliaEDGE
Reference
HELIA

rng

Random seeds and ID schedules.

Machine-readable model

  • set_random_seedfunctionSet Python, NumPy and selected Keras backend seeds; return the seed.
  • uniform_id_generatorfunctionYield each ID once per cycle; shuffle mutates the supplied sequence.
  • random_id_generatorfunctionSample with replacement, using optional nonnegative relative weights.
function

Set Python, NumPy and selected Keras backend seeds; return the seed.

helia_edge/utils/rng.py:9

set_random_seed(seed: int | None = None) -> int

Set Python, NumPy and selected Keras backend seeds; return the seed.

function

Yield each ID once per cycle; shuffle mutates the supplied sequence.

helia_edge/utils/rng.py:20

uniform_id_generator(ids: MutableSequence[T], repeat: bool = True, shuffle: bool = True) -> Generator[T, None, None]

Yield each ID once per cycle; shuffle mutates the supplied sequence.

function

Sample with replacement, using optional nonnegative relative weights.

helia_edge/utils/rng.py:34

random_id_generator(ids: Sequence[T], weights: Sequence[float] | None = None) -> Generator[T, None, None]

Sample with replacement, using optional nonnegative relative weights.