Skip to main content

Module controller

Module controller 

Expand description

The demo’s run controller: one seeded study, advanced one trial at a time.

The controller owns all mutable optimizer state. A frame calls Controller::tick, which runs at most one ask/evaluate/tell transaction and returns; the page then refreshes its read-only views from the controller’s accessors and latest [atune_core::study::StudySnapshot]. Pausing therefore always lands between transactions, and nothing here needs a window, a clock, or a browser, so host tests drive the exact sequence the browser build replays.

Every sampler and scheduler the facade ships is offered. Without a scheduler a trial is one exact evaluation of the problem; for cart-pole that evaluation is itself a full training run of crate::cartpole. With a scheduler, or with DEHB, a trial reports after every step: a test function from the simulated training curve of crate::training, cart-pole from its real training epochs, with the policy’s state as its checkpoint. The scheduler’s answer is executed through the public ask/tell API. A prune becomes tell_pruned, a pause becomes tell_paused, a fork materializes at tell, and ask hands back paused trials, so one transaction may also be a fork child or a resumed trial.

Structs§

Controller
Drives one seeded study a transaction at a time.
RunConfig
What a run is configured with.
SearchDistribution
CMA-ES’s search distribution in unit-square coordinates ((0, 0) is the box’s bottom-left corner): its next samples are drawn from N(mean, covariance), where covariance is σ²·C.
TrialRecord
One transaction as the demo shows it: a trial run, or a paused trial’s resumed remainder.

Enums§

PauseReason
Why a run is paused.
SamplerChoice
A sampler the demo can run. Each choice is a separate, separately seeded run; the demo never ranks them.
SchedulerChoice
A scheduler (pruner or population scheduler) the demo can run.
Status
Where a run is in its lifecycle.
TrialOrigin
Where one transaction’s trial came from.
TrialOutcome
How one transaction ended.

Constants§

DEFAULT_BUDGET
The browser demo’s default trial budget.
DEFAULT_SEED
The public seed every demo run starts from.
MAX_GRID_SIDE
The most points per axis of Grid’s lattice: the side of the largest square within atune’s grid bound, [MAX_GRID_POINTS] (2²⁰, so 1024).
MIN_BUDGET
The smallest trial budget the page offers: a 2 × 2 Grid lattice.
NSGA2_POPULATION
NSGA-II’s generation size: six generations fit the default budget.
POPULATION_INTERVAL
How many steps apart PBT, PB2 and freeze-thaw decide.
REDUCTION_FACTOR
The reduction factor of the ASHA, Hyperband and DEHB ladders (1, 3, 9).

Functions§

clamp_budget
Raises a requested budget to at least MIN_BUDGET; there is no upper limit (D114).
cost_at
CARBS’s declared cost: 1 at the box’s left edge, rising linearly to 2 at its right edge.