[][src]Trait vikos::Teacher

pub trait Teacher<M: Model> {
    type Training;
    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
; }

Algorithms used to adapt Model coefficients

Associated Types

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

Loading content...

Required methods

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

Creates an instance holding all mutable state of the algorithm

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)

Loading content...

Implementors

impl<M> Teacher<M> for Adagard where
    M: Model,
    M::Target: Vector
[src]

type Training = Vec<f64>

impl<M> Teacher<M> for GradientDescent where
    M: Model,
    M::Target: Vector
[src]

type Training = ()

impl<M> Teacher<M> for GradientDescentAl where
    M: Model,
    M::Target: Vector
[src]

type Training = usize

impl<M> Teacher<M> for Momentum where
    M: Model,
    M::Target: Vector
[src]

type Training = (usize, Vec<f64>)

impl<M> Teacher<M> for Nesterov where
    M: Model,
    M::Target: Vector
[src]

type Training = (usize, Vec<f64>)

Loading content...