pub struct Config {
pub embedding_dim: usize,
pub window_size: usize,
pub negative_samples: usize,
pub epochs: usize,
pub learning_rate: f32,
pub min_learning_rate: f32,
pub min_count: usize,
pub subsample_threshold: f64,
pub model: ModelType,
pub num_threads: usize,
pub seed: u64,
}Expand description
Full training configuration.
All fields have sensible defaults via Config::default().
Fields§
§embedding_dim: usizeDimensionality of word embeddings (typical: 50–300).
window_size: usizeHalf-width of the context window (words on each side of target).
negative_samples: usizeNumber of negative samples per positive pair (typical: 5–20).
epochs: usizeFull passes over the corpus.
learning_rate: f32Initial learning rate (decays linearly to min_learning_rate).
min_learning_rate: f32Floor for decayed learning rate.
min_count: usizeDiscard words appearing fewer than this many times.
subsample_threshold: f64Frequent-word subsampling threshold (Mikolov et al. suggest 1e-3 – 1e-5).
model: ModelTypeArchitecture choice.
num_threads: usizeRayon thread count (0 = use all logical cores).
seed: u64RNG seed for reproducibility.
Implementations§
Trait Implementations§
Source§impl<'de> Deserialize<'de> for Config
impl<'de> Deserialize<'de> for Config
Source§fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
Deserialize this value from the given Serde deserializer. Read more
Auto Trait Implementations§
impl Freeze for Config
impl RefUnwindSafe for Config
impl Send for Config
impl Sync for Config
impl Unpin for Config
impl UnsafeUnpin for Config
impl UnwindSafe for Config
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more