Skip to main content

Module space

Module space 

Expand description

Search spaces: values, distributions, transforms, schemas.

The layer is four types deep and no deeper:

TypeAnswers
ParamValuewhat one parameter is set to, with its type intact
Distributionwhich values are legal, and how to map them to [0, 1]
Assignmentwhat a whole trial was set to (sorted by name)
SpaceSchemawhich parameters a study declares (in declaration order)

Two invariants run through all of them — the guide states them under the four kinds of parameter:

  • Parameters are identified by stable string names, values are typed. Nothing is keyed on declaration order (the footgun that global-counter designs hit), and a boolean never becomes the integer 1 (the collapse that Optuna’s f64 union suffers).
  • There is exactly one transform layer. Distribution::to_unit and Distribution::from_unit are the only implementations of log scaling, step snapping and categorical indexing in the codebase; a sampler that wants numeric vectors goes through them explicitly.

Declared conditional parameters (enabled_if) do not exist; a conditional is written define-by-run, by suggesting a parameter only on the branch that uses it.

Modules§

dsl
The string DSL: a compact text notation for a Distribution.

Structs§

Assignment
The parameters of one trial: names to typed values.
CatChoices
The labels and typed scalar payloads of a categorical parameter, in a fixed order.
GrowthDecision
One growth decision the replay took, in the order it took them.
GrowthReplay
The growth rule replayed from the seed.
Open
One parameter’s declared growth policy: the seed it starts from, which side(s) may move, and the numbers that govern and bound that movement.
ParamSpec
One declared parameter: a name and its support.
SpacePolicy
A study’s growth policy: which parameters are open, and how.
SpaceSchema
An ordered set of declared parameters.

Enums§

Band
The crowding band at one side of a distribution — see band.
CatChoiceValue
One categorical choice’s durable scalar payload.
Distribution
The support of one parameter.
GrowthReason
Why a growth decision was taken or refused – the growth brakes and the two outcomes of the failure veto.
LimitBound
One side of an Open::limit call – which end of the stored limit a range argument sets. Never named by a caller: spelled with ..=/.. on the standard range types.
ParamValue
One parameter’s value, typed.
Scale
Whether a numeric range is walked linearly or logarithmically.
Side
Which end of a numeric range a measurement is about.
Sides
Which side(s) of a distribution a growth policy permits to move.
Spread
How Open::new_with_around’s seed is derived from a center value – the DSL’s around, one function name covering both scales via which keyword it is given.
ValueKind
The kind of a ParamValue, without its payload.

Constants§

MAX_GRID_POINTS
The largest grid Distribution::grid_values will materialize.

Traits§

Space
A typed configuration that doubles as a search space.

Functions§

band
The crowding band at side of dist.
pressure
The crowding fraction on side: the share of the top set that band counts as “at the bound” there — pressure(side S) = |{ t in top set : t is in band(dist, S) }| / |top set|.
top_set
The completed trials that vote on where a study’s optimum is — the growth rule’s candidate and top-set construction.
widen
The ask-path interposition: the ask-time space with every policy-open parameter’s live (replayed) range in place of its seed.
widen_with
widen over an already-advanced replay — the cache path: the study handle keeps one GrowthReplay beside its view and advances it per decision point, so the rule replays over new trials only.