Struct OnlineTunerBuilder
pub struct OnlineTunerBuilder { /* private fields */ }Expand description
A builder for an OnlineTuner.
Implementations§
§impl OnlineTunerBuilder
impl OnlineTunerBuilder
pub fn cluster(self, name: impl Into<String>, values: &[f64]) -> Self
pub fn cluster(self, name: impl Into<String>, values: &[f64]) -> Self
Declares a cluster: a named hyperparameter with its candidate values.
For the Mabc policy the values are the discrete UCB arms; for
crate::online::PbtLite they define the knob’s feasible range (min/max) and its
starting point (the first value).
pub fn policy(self, policy: impl Into<Policy>) -> Self
pub fn policy(self, policy: impl Into<Policy>) -> Self
Sets the in-loop policy (Mabc or crate::online::PbtLite).
pub const fn direction(self, direction: Direction) -> Self
pub const fn direction(self, direction: Direction) -> Self
Sets the optimization direction (default Direction::Maximize).
pub const fn seed(self, seed: u64) -> Self
pub const fn seed(self, seed: u64) -> Self
Sets the base seed used to derive the callback RNG for each round.
Defaults to 0. The same seed and round ordinal always produce the same
[ChaCha8Rng], independently of earlier callback draw counts.
pub const fn flush_every(self, interval: u64) -> Self
pub const fn flush_every(self, interval: u64) -> Self
Records a flush interval, in rounds, surfaced through
OnlineTuner::is_flush_boundary — the cue to snapshot the tuner to a
journal off the hot path. Optional; the hot path is identical either way.
pub fn build(self) -> Result<OnlineTuner>
pub fn build(self) -> Result<OnlineTuner>
Validates and builds the OnlineTuner.
§Errors
Error::InvalidSpace if there are no
clusters, a cluster name is duplicated, a cluster has no values or a
non-finite one, the Mabc window is 0 or above MAX_WINDOW, the
crate::online::PbtLite period is 0, or a perturbation factor is not finite and
positive.
Trait Implementations§
§impl Clone for OnlineTunerBuilder
impl Clone for OnlineTunerBuilder
§fn clone(&self) -> OnlineTunerBuilder
fn clone(&self) -> OnlineTunerBuilder
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read more