pub struct MetaLearner { /* private fields */ }Expand description
Meta-learning trainer
Implementations§
Source§impl MetaLearner
impl MetaLearner
Sourcepub fn new(config: MetaLearningConfig) -> Result<Self, TrustformersError>
pub fn new(config: MetaLearningConfig) -> Result<Self, TrustformersError>
Create a new meta-learner
Sourcepub fn train_episode(
&mut self,
task_batch: TaskBatch,
) -> Result<EpisodeResult, TrustformersError>
pub fn train_episode( &mut self, task_batch: TaskBatch, ) -> Result<EpisodeResult, TrustformersError>
Train on a single meta-learning episode
Sourcepub fn evaluate(
&mut self,
task_batch: TaskBatch,
) -> Result<EvaluationResult, TrustformersError>
pub fn evaluate( &mut self, task_batch: TaskBatch, ) -> Result<EvaluationResult, TrustformersError>
Evaluate the meta-learner on new tasks
Sourcepub fn get_statistics(&self) -> &MetaStatistics
pub fn get_statistics(&self) -> &MetaStatistics
Get meta-learning statistics
Sourcepub fn get_episode_history(&self) -> &[EpisodeResult]
pub fn get_episode_history(&self) -> &[EpisodeResult]
Get episode history
Sourcepub fn sample_task_batch(&mut self) -> Result<TaskBatch, TrustformersError>
pub fn sample_task_batch(&mut self) -> Result<TaskBatch, TrustformersError>
Sample a new task batch
Auto Trait Implementations§
impl Freeze for MetaLearner
impl !RefUnwindSafe for MetaLearner
impl Send for MetaLearner
impl Sync for MetaLearner
impl Unpin for MetaLearner
impl UnsafeUnpin for MetaLearner
impl !UnwindSafe for MetaLearner
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> 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>
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