pub struct MetaLearner<T: Float + Debug + Send + Sync + 'static> { /* private fields */ }Expand description
Meta-learning component for optimizer adaptation.
MetaLearner::step implements one fixed rule: a truncated-BPTT unroll of
the controller over each task, i.e. the second-order / MAML-style inner loop.
It carried a strategy: MetaOptimizationStrategy field that was hard-wired to
MAML at construction and never consulted, which advertised a choice the
implementation does not offer; the alternatives (Reptile, first-order,
custom) are not implemented for this controller.
Implementations§
Source§impl<T: Float + Debug + Send + Sync + 'static + Default + Clone> MetaLearner<T>
impl<T: Float + Debug + Send + Sync + 'static + Default + Clone> MetaLearner<T>
Sourcepub fn adaptation_history(&self) -> &VecDeque<AdaptationEvent<T>>
pub fn adaptation_history(&self) -> &VecDeque<AdaptationEvent<T>>
Adaptation events recorded by Self::step, oldest first.
Sourcepub fn meta_step_count(&self) -> usize
pub fn meta_step_count(&self) -> usize
Number of meta-training steps performed so far.
Sourcepub fn last_meta_loss(&self) -> T
pub fn last_meta_loss(&self) -> T
Most recent meta-loss.
Trait Implementations§
Auto Trait Implementations§
impl<T> Freeze for MetaLearner<T>
impl<T> RefUnwindSafe for MetaLearner<T>where
HashMap<String, ArrayBase<OwnedRepr<T>, Dim<[usize; 1]>>>: RefUnwindSafe,
VecDeque<MetaTask<T>>: RefUnwindSafe,
MetaLearningState<T>: RefUnwindSafe,
TransferLearner<T>: RefUnwindSafe,
impl<T> Send for MetaLearner<T>
impl<T> Sync for MetaLearner<T>
impl<T> Unpin for MetaLearner<T>
impl<T> UnsafeUnpin for MetaLearner<T>where
HashMap<String, ArrayBase<OwnedRepr<T>, Dim<[usize; 1]>>>: UnsafeUnpin,
VecDeque<MetaTask<T>>: UnsafeUnpin,
MetaLearningState<T>: UnsafeUnpin,
TransferLearner<T>: UnsafeUnpin,
impl<T> UnwindSafe for MetaLearner<T>where
HashMap<String, ArrayBase<OwnedRepr<T>, Dim<[usize; 1]>>>: UnwindSafe,
VecDeque<MetaTask<T>>: UnwindSafe,
MetaLearningState<T>: UnwindSafe,
TransferLearner<T>: UnwindSafe,
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
impl<ST, DT> CastableFrom<ST, Initialized, Initialized> for DT
impl<ST, DT> CastableFrom<ST, Uninit, Uninit> for DT
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
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 moreSource§impl<T> Pointable for T
impl<T> Pointable for T
impl<T> Read<Exclusive, BecauseExclusive> for Twhere
T: ?Sized,
Source§impl<SS, SP> SupersetOf<SS> for SPwhere
SS: SubsetOf<SP>,
impl<SS, SP> SupersetOf<SS> for SPwhere
SS: SubsetOf<SP>,
Source§fn to_subset(&self) -> Option<SS>
fn to_subset(&self) -> Option<SS>
The inverse inclusion map: attempts to construct
self from the equivalent element of its
superset. Read moreSource§fn is_in_subset(&self) -> bool
fn is_in_subset(&self) -> bool
Checks if
self is actually part of its subset T (and can be converted to it).Source§fn to_subset_unchecked(&self) -> SS
fn to_subset_unchecked(&self) -> SS
Use with care! Same as
self.to_subset but without any property checks. Always succeeds.Source§fn from_subset(element: &SS) -> SP
fn from_subset(element: &SS) -> SP
The inclusion map: converts
self to the equivalent element of its superset.