[−][src]Trait finalfrontier::Trainer
Trainer Trait.
Associated Types
type InputVocab: Vocab
type Metadata
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.
Implementors
impl<R> Trainer for DepembedsTrainer<R> where
R: Rng,
[src]
R: Rng,
type InputVocab = SubwordVocab
type Metadata = DepembedsMetadata<SubwordVocabConfig, SimpleVocabConfig>
fn input_indices(&self, idx: usize) -> Vec<u64>
[src]
fn input_vocab(&self) -> &SubwordVocab
[src]
fn try_into_input_vocab(self) -> Result<Self::InputVocab, Error>
[src]
fn n_input_types(&self) -> usize
[src]
fn n_output_types(&self) -> usize
[src]
fn config(&self) -> &CommonConfig
[src]
fn to_metadata(&self) -> Self::Metadata
[src]
impl<R> Trainer for SkipgramTrainer<R> where
R: Rng + Clone,
[src]
R: Rng + Clone,