Skip to main content

MetaTrainingReport

Struct MetaTrainingReport 

Source
pub struct MetaTrainingReport {
    pub iterations: usize,
    pub initial_meta_loss: f64,
    pub final_meta_loss: f64,
    pub loss_history: Vec<f64>,
    pub initial_validation_loss: Option<f64>,
    pub final_validation_loss: Option<f64>,
    pub validation_history: Vec<f64>,
    pub selection_metric: SelectionMetric,
    pub gradient_norms: Vec<f64>,
    pub weight_count: usize,
}
Expand description

What a meta-training run measured.

Every field is an observation, not a target: final_meta_loss is the value the kept weights actually achieve on the training tasks, and Self::improved is the honest answer to “did this help”, judged by whichever criterion Self::selection_metric names.

Fields§

§iterations: usize

ES iterations completed.

§initial_meta_loss: f64

Training meta-loss of the weights the trainer started from.

§final_meta_loss: f64

Training meta-loss of the weights the trainer kept.

§loss_history: Vec<f64>

Training meta-loss after each iteration, in order.

§initial_validation_loss: Option<f64>

Validation meta-loss of the starting weights, if validation tasks were supplied.

§final_validation_loss: Option<f64>

Validation meta-loss of the weights the trainer kept.

§validation_history: Vec<f64>

Validation meta-loss after each iteration, if validation tasks were supplied.

§selection_metric: SelectionMetric

Which loss chose the kept weights.

§gradient_norms: Vec<f64>

Euclidean norm of the estimated meta-gradient at each iteration.

§weight_count: usize

Number of learned weights being optimized.

Implementations§

Source§

impl MetaTrainingReport

Source

pub fn improved(&self) -> bool

Whether the run left the optimizer better than it found it, judged by the selection metric.

§This is weaker than it sounds under SelectionMetric::TrainingLoss

With no validation tasks there is nothing to compare the training loss against, so improved() == true means only “it fits the training tasks better” — which is exactly what an overfitting run also reports. The NTM controller was measured driving its training meta-loss down ~30% while making a held-out task 40x worse; that run returns true here, and under TrainingLoss Self::relative_improvement and Self::relative_training_improvement are the same number, so the report carries no signal that separates the two cases.

To get a claim about generalisation, train through EsMetaTrainer::train_with_validation: the metric becomes SelectionMetric::ValidationLoss, and the gap between relative_improvement() and relative_training_improvement() becomes the overfitting measurement. Check Self::selection_metric before trusting this method as a generalisation result.

Source

pub fn relative_improvement(&self) -> f64

Fractional reduction in the selection metric (negative if training made it worse).

Source

pub fn relative_training_improvement(&self) -> f64

Fractional reduction in the training meta-loss specifically.

Comparing this against Self::relative_improvement under SelectionMetric::ValidationLoss is how a caller sees overfitting: a large training improvement next to a small validation one means the run specialised to the training family.

Trait Implementations§

Source§

impl Clone for MetaTrainingReport

Source§

fn clone(&self) -> Self

Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · Source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
Source§

impl Debug for MetaTrainingReport

Source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more

Auto Trait Implementations§

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<ST, DT> CastableFrom<ST, Initialized, Initialized> for DT
where ST: ?Sized, DT: ?Sized,

Source§

impl<ST, DT> CastableFrom<ST, Uninit, Uninit> for DT
where ST: ?Sized, DT: ?Sized,

Source§

impl<T> CloneToUninit for T
where T: Clone,

Source§

unsafe fn clone_to_uninit(&self, dest: *mut u8)

🔬This is a nightly-only experimental API. (clone_to_uninit)
Performs copy-assignment from self to dest. Read more
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T> IntoEither for T

Source§

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 more
Source§

fn into_either_with<F>(self, into_left: F) -> Either<Self, Self> ⓘ
where F: FnOnce(&Self) -> bool,

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
Source§

impl<T> Pointable for T

Source§

const ALIGN: usize

The alignment of pointer.
Source§

type Init = T

The type for initializers.
Source§

unsafe fn init(init: <T as Pointable>::Init) -> usize

Initializes a with the given initializer. Read more
Source§

unsafe fn deref<'a>(ptr: usize) -> &'a T

Dereferences the given pointer. Read more
Source§

unsafe fn deref_mut<'a>(ptr: usize) -> &'a mut T

Mutably dereferences the given pointer. Read more
Source§

unsafe fn drop(ptr: usize)

Drops the object pointed to by the given pointer. Read more
Source§

impl<T> Read<Exclusive, BecauseExclusive> for T
where T: ?Sized,

Source§

impl<T> Same for T

Source§

type Output = T

Should always be Self
Source§

impl<SS, SP> SupersetOf<SS> for SP
where SS: SubsetOf<SP>,

Source§

fn to_subset(&self) -> Option<SS>

The inverse inclusion map: attempts to construct self from the equivalent element of its superset. Read more
Source§

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

Use with care! Same as self.to_subset but without any property checks. Always succeeds.
Source§

fn from_subset(element: &SS) -> SP

The inclusion map: converts self to the equivalent element of its superset.
Source§

impl<T> ToOwned for T
where T: Clone,

Source§

type Owned = T

The resulting type after obtaining ownership.
Source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
Source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = !

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, !>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.
Source§

impl<V, T> VZip<V> for T
where V: MultiLane<T>,

Source§

fn vzip(self) -> V