pub struct MetaOptimizer<A: Float, D: Dimension> { /* private fields */ }
Expand description
Meta-learning optimizer that learns to optimize
Implementations§
Source§impl<A: Float + ScalarOperand + Debug, D: Dimension> MetaOptimizer<A, D>
impl<A: Float + ScalarOperand + Debug, D: Dimension> MetaOptimizer<A, D>
Sourcepub fn new(
base_optimizer: String,
meta_learning_rate: A,
initial_meta_params: Array1<A>,
) -> Self
pub fn new( base_optimizer: String, meta_learning_rate: A, initial_meta_params: Array1<A>, ) -> Self
Create a new meta-optimizer
Sourcepub fn init_predictor_network(
&mut self,
input_size: usize,
hidden_size: usize,
output_size: usize,
)
pub fn init_predictor_network( &mut self, input_size: usize, hidden_size: usize, output_size: usize, )
Initialize the hyperparameter predictor network
Sourcepub fn record_trajectory(&mut self, trajectory: OptimizationTrajectory<A, D>)
pub fn record_trajectory(&mut self, trajectory: OptimizationTrajectory<A, D>)
Record an optimization trajectory
Sourcepub fn predict_hyperparameters(
&self,
problem_features: &Array1<A>,
) -> Result<HashMap<String, A>>
pub fn predict_hyperparameters( &self, problem_features: &Array1<A>, ) -> Result<HashMap<String, A>>
Predict optimal hyperparameters for a given problem
Sourcepub fn update_meta_parameters(&mut self) -> Result<()>
pub fn update_meta_parameters(&mut self) -> Result<()>
Update meta-parameters based on recent performance
Sourcepub fn get_meta_parameters(&self) -> &Array1<A>
pub fn get_meta_parameters(&self) -> &Array1<A>
Get current meta-parameters
Sourcepub fn get_performance_history(&self) -> &[A]
pub fn get_performance_history(&self) -> &[A]
Get performance history
Sourcepub fn trajectory_count(&self) -> usize
pub fn trajectory_count(&self) -> usize
Get number of recorded trajectories
Sourcepub fn train_predictor_network(&mut self, epochs: usize) -> Result<()>
pub fn train_predictor_network(&mut self, epochs: usize) -> Result<()>
Train the predictor network on recorded trajectories
Trait Implementations§
Auto Trait Implementations§
impl<A, D> Freeze for MetaOptimizer<A, D>where
A: Freeze,
impl<A, D> RefUnwindSafe for MetaOptimizer<A, D>where
A: RefUnwindSafe,
D: RefUnwindSafe,
impl<A, D> Send for MetaOptimizer<A, D>where
A: Send,
impl<A, D> Sync for MetaOptimizer<A, D>where
A: Sync,
impl<A, D> Unpin for MetaOptimizer<A, D>
impl<A, D> UnwindSafe for MetaOptimizer<A, D>
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
Mutably borrows from an owned value. Read more
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>
Converts
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>
Converts
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