[−][src]Struct finalfrontier::TrainModel
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 HogwildArray
s 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]
T: Trainer,
pub fn config(&self) -> &CommonConfig
[src]
Get the model configuration.
impl<V, T> TrainModel<T> where
T: Trainer<InputVocab = V>,
V: Vocab,
[src]
T: Trainer<InputVocab = V>,
V: Vocab,
pub fn input_vocab(&self) -> &V
[src]
Get this model's input vocabulary.
impl<T> TrainModel<T>
[src]
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]
W: Seek + Write,
T: Trainer<InputVocab = V, Metadata = M>,
V: Vocab + Into<VocabWrap>,
M: Serialize,
impl<T> From<T> for TrainModel<T> where
T: Trainer,
[src]
T: Trainer,
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]
fn clone(&self) -> TrainModel<T>
[src]
fn clone_from(&mut self, source: &Self)
1.0.0[src]
Auto Trait Implementations
impl<T> Send for TrainModel<T> where
T: Send,
T: Send,
impl<T> Sync for TrainModel<T> where
T: Sync,
T: Sync,
impl<T> Unpin for TrainModel<T> where
T: Unpin,
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]
U: From<T>,
impl<T> From<T> for T
[src]
impl<T> ToOwned for T where
T: Clone,
[src]
T: Clone,
type Owned = T
The resulting type after obtaining ownership.
fn to_owned(&self) -> T
[src]
fn clone_into(&self, target: &mut T)
[src]
impl<T, U> TryFrom<U> for T where
U: Into<T>,
[src]
U: Into<T>,
type Error = Infallible
The type returned in the event of a conversion error.
fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>
[src]
impl<T, U> TryInto<U> for T where
U: TryFrom<T>,
[src]
U: TryFrom<T>,
type Error = <U as TryFrom<T>>::Error
The type returned in the event of a conversion error.
fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>
[src]
impl<T> Borrow<T> for T where
T: ?Sized,
[src]
T: ?Sized,
impl<T> BorrowMut<T> for T where
T: ?Sized,
[src]
T: ?Sized,
fn borrow_mut(&mut self) -> &mut T
[src]
impl<T> Any for T where
T: 'static + ?Sized,
[src]
T: 'static + ?Sized,