phenotypic.tune.strategy.RandomStrategy#

class phenotypic.tune.strategy.RandomStrategy(space: SearchSpace, *, n_trials: int, seed: int = 0)[source]#

Bases: object

Samples n_trials random configurations under a fixed seed.

Respects conditional_on: a child knob is sampled only when its parent presence value was sampled to match. Relies on a parent presence knob appearing before its conditional children in space.knobs (true for inferred and hand-authored spaces — the __enabled__ knob is emitted first); a topological pass is unnecessary at the depth-cap of 1.

Parameters:
  • space (SearchSpace) – The search space to sample over.

  • n_trials (int) – The number of configurations to draw before exhaustion.

  • seed (int) – The RNG seed; fixing it makes the sampled sequence deterministic.

Methods

suggest() tuple[Mapping[str, Any], PruningChannel][source]#
Return type:

tuple[Mapping[str, Any], PruningChannel]

register_result(params: Mapping[str, Any], result: Any, *, pruned: bool = False) None[source]#
Parameters:
Return type:

None

is_exhausted() bool[source]#
Return type:

bool