Teacher

Trait Teacher 

Source
pub trait Teacher<M: Model> {
    type Training;

    // Required methods
    fn new_training(&self, model: &M) -> Self::Training;
    fn teach_event<Y, C>(
        &self,
        training: &mut Self::Training,
        model: &mut M,
        cost: &C,
        features: &M::Features,
        truth: Y,
    )
       where C: Cost<Y, M::Target>,
             Y: Copy;
}
Expand description

Algorithms used to adapt Model coefficients

Required Associated Types§

Source

type Training

Contains state which changes during the training, but is not part of the expertise

Examples are the velocity of the coefficients (in stochastic gradient descent) or the number of events already learned. This may also be empty

Required Methods§

Source

fn new_training(&self, model: &M) -> Self::Training

Creates an instance holding all mutable state of the algorithm

Source

fn teach_event<Y, C>( &self, training: &mut Self::Training, model: &mut M, cost: &C, features: &M::Features, truth: Y, )
where C: Cost<Y, M::Target>, Y: Copy,

Changes models coefficients so they minimize the cost function (hopefully)

Dyn Compatibility§

This trait is not dyn compatible.

In older versions of Rust, dyn compatibility was called "object safety", so this trait is not object safe.

Implementors§