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.
- Search
Distribution - CMA-ES’s search distribution in unit-square coordinates (
(0, 0)is the box’s bottom-left corner): its next samples are drawn fromN(mean, covariance), wherecovarianceisσ²·C. - Trial
Record - One transaction as the demo shows it: a trial run, or a paused trial’s resumed remainder.
Enums§
- Pause
Reason - Why a run is paused.
- Sampler
Choice - A sampler the demo can run. Each choice is a separate, separately seeded run; the demo never ranks them.
- Scheduler
Choice - A scheduler (pruner or population scheduler) the demo can run.
- Status
- Where a run is in its lifecycle.
- Trial
Origin - Where one transaction’s trial came from.
- Trial
Outcome - 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.