pub struct HyperparameterTuner { /* private fields */ }Expand description
Complete hyperparameter tuning framework
Implementations§
Source§impl HyperparameterTuner
impl HyperparameterTuner
Sourcepub fn new(
optimizer_type: OptimizerType,
search_space: HyperparameterSpace,
task: OptimizationTask,
max_trials: usize,
) -> Self
pub fn new( optimizer_type: OptimizerType, search_space: HyperparameterSpace, task: OptimizationTask, max_trials: usize, ) -> Self
Create new hyperparameter tuner
Sourcepub fn enable_multi_objective(
&mut self,
objectives: Vec<String>,
weights: Vec<f32>,
)
pub fn enable_multi_objective( &mut self, objectives: Vec<String>, weights: Vec<f32>, )
Enable multi-objective optimization
Sourcepub fn suggest_next(&mut self) -> Option<HyperparameterSample>
pub fn suggest_next(&mut self) -> Option<HyperparameterSample>
Get next hyperparameter configuration to try
Sourcepub fn evaluate_config<F>(
&mut self,
config: HyperparameterSample,
objective: &mut F,
) -> Result<PerformanceMetrics>
pub fn evaluate_config<F>( &mut self, config: HyperparameterSample, objective: &mut F, ) -> Result<PerformanceMetrics>
Evaluates one hyperparameter configuration by running the caller’s objective.
The tuner has no model and no data, so it cannot produce a score on its own:
objective must actually train and validate the configuration and return the
measurements it observed. The tuner contributes the wall-clock timing and the
composite score, then feeds the result to the Bayesian search.
§Errors
Propagates any error the objective returns.
Sourcepub fn optimize<F>(&mut self, objective: &mut F) -> Result<HyperparameterSample>
pub fn optimize<F>(&mut self, objective: &mut F) -> Result<HyperparameterSample>
Runs the full search, evaluating every suggested configuration with objective.
§Errors
Propagates objective errors, and reports an error when no trial completed.
Sourcepub fn optimization_summary(&self) -> String
pub fn optimization_summary(&self) -> String
Human-readable summary of the search, for callers that want to print one.
Library code must not write to stdout, so this returns the text instead of printing it.
Sourcepub fn get_history(&self) -> &[(HyperparameterSample, PerformanceMetrics)]
pub fn get_history(&self) -> &[(HyperparameterSample, PerformanceMetrics)]
Get optimization history for analysis
Sourcepub fn get_pareto_front(&self) -> Option<&[HyperparameterSample]>
pub fn get_pareto_front(&self) -> Option<&[HyperparameterSample]>
Get Pareto front for multi-objective optimization
Source§impl HyperparameterTuner
Convenience functions for common optimization tasks
impl HyperparameterTuner
Convenience functions for common optimization tasks
Sourcepub fn optimize_amacp_for_transformers<F>(
max_trials: usize,
objective: &mut F,
) -> Result<AMacPConfig>
pub fn optimize_amacp_for_transformers<F>( max_trials: usize, objective: &mut F, ) -> Result<AMacPConfig>
Optimize aMacP hyperparameters for transformer training
Sourcepub fn optimize_novograd_for_llms<F>(
max_trials: usize,
objective: &mut F,
) -> Result<NovoGradConfig>
pub fn optimize_novograd_for_llms<F>( max_trials: usize, objective: &mut F, ) -> Result<NovoGradConfig>
Optimize NovoGrad hyperparameters for large language models
Trait Implementations§
Auto Trait Implementations§
impl Freeze for HyperparameterTuner
impl RefUnwindSafe for HyperparameterTuner
impl Send for HyperparameterTuner
impl Sync for HyperparameterTuner
impl Unpin for HyperparameterTuner
impl UnsafeUnpin for HyperparameterTuner
impl UnwindSafe for HyperparameterTuner
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
impl<ST, DT> CastableFrom<ST, Initialized, Initialized> for DT
impl<ST, DT> CastableFrom<ST, Uninit, Uninit> for DT
Source§impl<T> Instrument for T
impl<T> Instrument for T
Source§fn instrument(self, span: Span) -> Instrumented<Self> ⓘ
fn instrument(self, span: Span) -> Instrumented<Self> ⓘ
Source§fn in_current_span(self) -> Instrumented<Self> ⓘ
fn in_current_span(self) -> Instrumented<Self> ⓘ
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self> ⓘ
fn into_either(self, into_left: bool) -> Either<Self, Self> ⓘ
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self> ⓘ
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self> ⓘ
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read more