[−][src]Struct finalfrontier::SkipgramTrainer
Skipgram Trainer
The SkipgramTrainer
holds the information and logic necessary to transform a tokenized
sentence into an iterator of focus and context tuples. The struct is cheap to clone because
the vocabulary is shared between clones.
Methods
impl<R> SkipgramTrainer<ReseedOnCloneRng<R>> where
R: Rng + Clone + SeedableRng,
[src]
R: Rng + Clone + SeedableRng,
pub fn new(
vocab: SubwordVocab,
rng: R,
common_config: CommonConfig,
skipgram_config: SkipGramConfig
) -> Self
[src]
vocab: SubwordVocab,
rng: R,
common_config: CommonConfig,
skipgram_config: SkipGramConfig
) -> Self
Constructs a new SkipgramTrainer
.
Trait Implementations
impl<R> Trainer for SkipgramTrainer<R> where
R: Rng + Clone,
[src]
R: Rng + Clone,
type InputVocab = SubwordVocab
type Metadata = SkipgramMetadata<SubwordVocabConfig>
fn input_indices(&self, idx: usize) -> Vec<u64>
[src]
fn input_vocab(&self) -> &SubwordVocab
[src]
fn try_into_input_vocab(self) -> Result<SubwordVocab, 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) -> SkipgramMetadata<SubwordVocabConfig>
[src]
impl<R: Clone> Clone for SkipgramTrainer<R>
[src]
fn clone(&self) -> SkipgramTrainer<R>
[src]
fn clone_from(&mut self, source: &Self)
1.0.0[src]
Auto Trait Implementations
impl<R> Send for SkipgramTrainer<R> where
R: Send,
R: Send,
impl<R> Sync for SkipgramTrainer<R> where
R: Sync,
R: Sync,
impl<R> Unpin for SkipgramTrainer<R> where
R: Unpin,
R: Unpin,
impl<R> UnwindSafe for SkipgramTrainer<R> where
R: UnwindSafe,
R: UnwindSafe,
impl<R> RefUnwindSafe for SkipgramTrainer<R> where
R: RefUnwindSafe,
R: RefUnwindSafe,
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,