pub struct PopulationBasedTraining<E, X, Y> { /* private fields */ }Expand description
Population-based Training optimizer
Implementations§
Source§impl<E, X, Y> PopulationBasedTraining<E, X, Y>
impl<E, X, Y> PopulationBasedTraining<E, X, Y>
Sourcepub fn new(config: PBTConfig, parameter_space: PBTParameterSpace) -> Self
pub fn new(config: PBTConfig, parameter_space: PBTParameterSpace) -> Self
Create a new PBT optimizer
Sourcepub fn initialize_population(&mut self)
pub fn initialize_population(&mut self)
Initialize the population with random hyperparameters
Sourcepub fn population(&self) -> &[PBTWorker<E>]
pub fn population(&self) -> &[PBTWorker<E>]
Get the current population
Sourcepub fn best_worker(&self) -> Option<&PBTWorker<E>>
pub fn best_worker(&self) -> Option<&PBTWorker<E>>
Get the best worker in the current population
Sourcepub fn update_worker_score(
&mut self,
worker_id: usize,
score: f64,
) -> Result<()>
pub fn update_worker_score( &mut self, worker_id: usize, score: f64, ) -> Result<()>
Update worker performance
Sourcepub fn exploit_and_explore(&mut self) -> Result<()>
pub fn exploit_and_explore(&mut self) -> Result<()>
Perform exploitation and exploration step
Sourcepub fn check_convergence(&self) -> bool
pub fn check_convergence(&self) -> bool
Check if any worker has converged
Sourcepub fn get_statistics(&self) -> PBTStatistics
pub fn get_statistics(&self) -> PBTStatistics
Get optimization statistics
Auto Trait Implementations§
impl<E, X, Y> Freeze for PopulationBasedTraining<E, X, Y>
impl<E, X, Y> RefUnwindSafe for PopulationBasedTraining<E, X, Y>
impl<E, X, Y> Send for PopulationBasedTraining<E, X, Y>
impl<E, X, Y> Sync for PopulationBasedTraining<E, X, Y>
impl<E, X, Y> Unpin for PopulationBasedTraining<E, X, Y>
impl<E, X, Y> UnsafeUnpin for PopulationBasedTraining<E, X, Y>
impl<E, X, Y> UnwindSafe for PopulationBasedTraining<E, X, Y>
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