pub struct TrainingConfigBuilder { /* private fields */ }Expand description
Builder pattern for constructing a TrainingConfig with optional parameters.
Implementations§
Source§impl TrainingConfigBuilder
impl TrainingConfigBuilder
pub fn with_metric(self, metric: Metric) -> Self
pub fn with_epochs(self, epochs: usize) -> Self
pub fn with_batch_size(self, batch_size: usize) -> Self
pub fn with_learning_rate(self, learning_rate: f64) -> Self
pub fn with_beta1(self, beta1: f64) -> Self
pub fn with_beta2(self, beta2: f64) -> Self
pub fn with_penalty(self, penalty: f32) -> Self
pub fn with_verbose(self, verbose: bool) -> Self
pub fn with_patience(self, patience: i32) -> Self
pub fn with_loss_reduction(self, loss_reduction: LossReduction) -> Self
pub fn with_k_neighbors(self, k_neighbors: usize) -> Self
pub fn with_min_desired_loss(self, min_desired_loss: f64) -> Self
pub fn with_timeout(self, timeout: u64) -> Self
pub fn with_normalized(self, normalized: bool) -> Self
pub fn with_minkowski_p(self, minkowski_p: f64) -> Self
pub fn with_repulsion_strength(self, repulsion_strength: f32) -> Self
pub fn with_neg_sample_rate(self, neg_sample_rate: usize) -> Self
Sourcepub fn with_cooldown_ms(self, cooldown_ms: u64) -> Self
pub fn with_cooldown_ms(self, cooldown_ms: u64) -> Self
Set the per-epoch cooldown sleep in milliseconds.
Inserting a pause between epochs prevents the GPU from being pinned at
100 % utilisation. 0 (the default) disables the sleep entirely.
Sourcepub fn with_figures_dir(self, dir: impl Into<PathBuf>) -> Self
pub fn with_figures_dir(self, dir: impl Into<PathBuf>) -> Self
Set the directory where loss-curve and snapshot plots are saved.
Use this to redirect output away from a read-only working directory:
ⓘ
.with_figures_dir(std::env::temp_dir().join("umap_figures"))pub fn build(self) -> Option<TrainingConfig>
Trait Implementations§
Source§impl Default for TrainingConfigBuilder
impl Default for TrainingConfigBuilder
Source§fn default() -> TrainingConfigBuilder
fn default() -> TrainingConfigBuilder
Returns the “default value” for a type. Read more
Auto Trait Implementations§
impl Freeze for TrainingConfigBuilder
impl RefUnwindSafe for TrainingConfigBuilder
impl Send for TrainingConfigBuilder
impl Sync for TrainingConfigBuilder
impl Unpin for TrainingConfigBuilder
impl UnsafeUnpin for TrainingConfigBuilder
impl UnwindSafe for TrainingConfigBuilder
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
Source§impl<T> Instrument for T
impl<T> Instrument for T
Source§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
Source§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
Converts
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
Converts
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read more