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

Function parallel

nevergrad/benchmark/experiments.py:1252–1269  ·  view source on GitHub ↗

Parallel optimization on 3 classical objective functions: sphere, rastrigin, cigar. The number of workers is 20 % of the budget. Testing both no useless variables and 5/6 of useless variables.

(seed: tp.Optional[int] = None)

Source from the content-addressed store, hash-verified

1250
1251@registry.register
1252def parallel(seed: tp.Optional[int] = None) -> tp.Iterator[Experiment]:
1253 """Parallel optimization on 3 classical objective functions: sphere, rastrigin, cigar.
1254 The number of workers is 20 % of the budget.
1255 Testing both no useless variables and 5/6 of useless variables."""
1256 seedg = create_seed_generator(seed)
1257 names = ["sphere", "rastrigin", "cigar"]
1258 optims: tp.List[str] = get_optimizers("parallel_basics", seed=next(seedg)) # type: ignore
1259 functions = [
1260 ArtificialFunction(name, block_dimension=bd, useless_variables=bd * uv_factor)
1261 for name in names
1262 for bd in [25]
1263 for uv_factor in [0, 5]
1264 ]
1265 optims = refactor_optims(optims)
1266 for func in functions:
1267 for optim in optims:
1268 for budget in [30, 100, 3000]:
1269 yield Experiment(func, optim, budget=budget, num_workers=int(budget / 5), seed=next(seedg))
1270
1271
1272@registry.register

Callers

nothing calls this directly

Calls 5

ArtificialFunctionClass · 0.90
create_seed_generatorFunction · 0.85
get_optimizersFunction · 0.85
refactor_optimsFunction · 0.85
ExperimentClass · 0.85

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…