[][src]Struct finalfrontier::TrainModel

pub struct TrainModel<T> { /* fields omitted */ }

Training model.

Instances of this type represent training models. Training models have an input matrix, an output matrix, and a trainer. The input matrix represents observed inputs, whereas the output matrix represents predicted outputs. The output matrix is typically discarded after training. The trainer holds lexical information, such as word -> index mappings and word discard probabilities. Additionally the trainer provides the logic to transform some input to an iterator of training examples.

TrainModel stores the matrices as HogwildArrays to share parameters between clones of the same model. The trainer is also shared between clones due to memory considerations.

Methods

impl<T> TrainModel<T> where
    T: Trainer
[src]

pub fn config(&self) -> &CommonConfig[src]

Get the model configuration.

impl<V, T> TrainModel<T> where
    T: Trainer<InputVocab = V>,
    V: Vocab
[src]

pub fn input_vocab(&self) -> &V[src]

Get this model's input vocabulary.

impl<T> TrainModel<T>[src]

pub fn trainer(&mut self) -> &mut T[src]

Get this model's trainer mutably.

Trait Implementations

impl<W, T, V, M> WriteModelBinary<W> for TrainModel<T> where
    W: Seek + Write,
    T: Trainer<InputVocab = V, Metadata = M>,
    V: Vocab + Into<VocabWrap>,
    M: Serialize
[src]

impl<T> From<T> for TrainModel<T> where
    T: Trainer
[src]

fn from(trainer: T) -> TrainModel<T>[src]

Construct a model from a Trainer.

This randomly initializes the input and output matrices using a uniform distribution in the range [-1/dims, 1/dims).

The number of rows of the input matrix is the vocabulary size plus the number of buckets for subword units. The number of rows of the output matrix is the number of possible outputs for the model.

impl<T: Clone> Clone for TrainModel<T>[src]

Auto Trait Implementations

impl<T> Send for TrainModel<T> where
    T: Send

impl<T> Sync for TrainModel<T> where
    T: Sync

impl<T> Unpin for TrainModel<T> where
    T: Unpin

impl<T> !UnwindSafe for TrainModel<T>

impl<T> !RefUnwindSafe for TrainModel<T>

Blanket Implementations

impl<T, U> Into<U> for T where
    U: From<T>, 
[src]

impl<T> From<T> for T[src]

impl<T> ToOwned for T where
    T: Clone
[src]

type Owned = T

The resulting type after obtaining ownership.

impl<T, U> TryFrom<U> for T where
    U: Into<T>, 
[src]

type Error = Infallible

The type returned in the event of a conversion error.

impl<T, U> TryInto<U> for T where
    U: TryFrom<T>, 
[src]

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

The type returned in the event of a conversion error.

impl<T> Borrow<T> for T where
    T: ?Sized
[src]

impl<T> BorrowMut<T> for T where
    T: ?Sized
[src]

impl<T> Any for T where
    T: 'static + ?Sized
[src]