[][src]Trait finalfrontier::Trainer

pub trait Trainer {
    type InputVocab: Vocab;
    type Metadata;
    fn input_indices(&self, idx: usize) -> Vec<u64>;
fn input_vocab(&self) -> &Self::InputVocab;
fn try_into_input_vocab(self) -> Result<Self::InputVocab, Error>;
fn n_input_types(&self) -> usize;
fn n_output_types(&self) -> usize;
fn config(&self) -> &CommonConfig;
fn to_metadata(&self) -> Self::Metadata; }

Trainer Trait.

Associated Types

Loading content...

Required methods

fn input_indices(&self, idx: usize) -> Vec<u64>

Given an input index get all associated indices.

fn input_vocab(&self) -> &Self::InputVocab

Get the trainer's input vocabulary.

fn try_into_input_vocab(self) -> Result<Self::InputVocab, Error>

Destruct the trainer and get the input vocabulary.

fn n_input_types(&self) -> usize

Get the number of possible input types.

In a model with subword units this value is calculated as: 2^n_buckets + input_vocab.len().

fn n_output_types(&self) -> usize

Get the number of possible outputs.

In a structured skipgram model this value is calculated as: output_vocab.len() * context_size * 2

fn config(&self) -> &CommonConfig

Get this Trainer's common hyperparameters.

fn to_metadata(&self) -> Self::Metadata

Get this Trainer's configuration.

Loading content...

Implementors

impl<R> Trainer for DepembedsTrainer<R> where
    R: Rng
[src]

impl<R> Trainer for SkipgramTrainer<R> where
    R: Rng + Clone
[src]

Loading content...