pub struct Ensemble<'a> { /* private fields */ }Expand description
Ensemble optimizer.
Combines multiple optimizers using various strategies.
Implementations§
Source§impl<'a> Ensemble<'a>
impl<'a> Ensemble<'a>
Sourcepub fn new(config: EnsembleConfig) -> Self
pub fn new(config: EnsembleConfig) -> Self
Create a new ensemble.
Sourcepub fn add<O>(self, optimizer: O) -> Self
pub fn add<O>(self, optimizer: O) -> Self
Add an optimizer to the ensemble.
The optimizer must implement OptimizeInto for type erasure.
Sourcepub fn config(&self) -> &EnsembleConfig
pub fn config(&self) -> &EnsembleConfig
Get the configuration.
Sourcepub async fn run<'b>(
&'b self,
trainset: &'b ExampleSet<'b>,
) -> Result<EnsembleResult>
pub async fn run<'b>( &'b self, trainset: &'b ExampleSet<'b>, ) -> Result<EnsembleResult>
Run all optimizers and combine results.
Trait Implementations§
Source§impl<'a> Optimizer for Ensemble<'a>
impl<'a> Optimizer for Ensemble<'a>
Source§type Output<'b> = OptimizationResult
where
'a: 'b
type Output<'b> = OptimizationResult where 'a: 'b
Output type - the optimized module or optimization result
Source§type OptimizeFut<'b> = Pin<Box<dyn Future<Output = Result<OptimizationResult, Error>> + Send + 'b>>
where
'a: 'b
type OptimizeFut<'b> = Pin<Box<dyn Future<Output = Result<OptimizationResult, Error>> + Send + 'b>> where 'a: 'b
Future type for optimization
Source§fn optimize<'b>(&'b self, trainset: &'b ExampleSet<'b>) -> Self::OptimizeFut<'b>
fn optimize<'b>(&'b self, trainset: &'b ExampleSet<'b>) -> Self::OptimizeFut<'b>
Optimize using the training set.
Auto Trait Implementations§
impl<'a> Freeze for Ensemble<'a>
impl<'a> !RefUnwindSafe for Ensemble<'a>
impl<'a> Send for Ensemble<'a>
impl<'a> Sync for Ensemble<'a>
impl<'a> Unpin for Ensemble<'a>
impl<'a> UnsafeUnpin for Ensemble<'a>
impl<'a> !UnwindSafe for Ensemble<'a>
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