MCPcopy
hub / github.com/facebookresearch/nevergrad / create_seed_generator

Function create_seed_generator

nevergrad/benchmark/xpbase.py:112–128  ·  view source on GitHub ↗

Create a stream of seeds, independent from the standard random stream. This is designed to be used in experiment plans generators, fore reproducibility. Parameter --------- seed: int or None the initial seed Yields ------ int or None potential new seeds,

(seed: tp.Optional[int])

Source from the content-addressed store, hash-verified

110
111
112def create_seed_generator(seed: tp.Optional[int]) -> tp.Iterator[tp.Optional[int]]:
113 """Create a stream of seeds, independent from the standard random stream.
114 This is designed to be used in experiment plans generators, fore reproducibility.
115
116 Parameter
117 ---------
118 seed: int or None
119 the initial seed
120
121 Yields
122 ------
123 int or None
124 potential new seeds, or None if the initial seed was None
125 """
126 generator = None if seed is None else np.random.RandomState(seed=seed)
127 while True:
128 yield None if generator is None else generator.randint(2**32, dtype=np.uint32) # type: ignore
129
130
131class Experiment:

Callers 15

ng_full_gymFunction · 0.85
gym_multifid_anmFunction · 0.85
gym_problemFunction · 0.85
keras_tuningFunction · 0.85
mltuningFunction · 0.85
yawidebbobFunction · 0.85
parallel_small_budgetFunction · 0.85
instrum_discreteFunction · 0.85
deceptiveFunction · 0.85
lowbudgetFunction · 0.85
parallelFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…