pub struct TrainingConfig {Show 21 fields
pub metric: Metric,
pub epochs: usize,
pub batch_size: usize,
pub learning_rate: f64,
pub beta1: f64,
pub beta2: f64,
pub penalty: f32,
pub verbose: bool,
pub patience: Option<i32>,
pub loss_reduction: LossReduction,
pub k_neighbors: usize,
pub min_desired_loss: Option<f64>,
pub timeout: Option<u64>,
pub normalized: bool,
pub minkowski_p: f64,
pub repulsion_strength: f32,
pub kernel_a: f32,
pub kernel_b: f32,
pub neg_sample_rate: usize,
pub cooldown_ms: u64,
pub figures_dir: Option<PathBuf>,
}Expand description
Configuration for training the UMAP model.
Deprecated: Use UmapConfig instead. This type is provided for
backward compatibility and converts to/from UmapConfig.
Fields§
§metric: MetricThe distance metric to use for training the model.
epochs: usizeThe total number of epochs to run during training.
batch_size: usizeThe number of samples to process in each training batch.
learning_rate: f64The learning rate for the optimizer.
beta1: f64The Beta1 parameter for the Adam optimizer.
beta2: f64The Beta2 parameter for the Adam optimizer.
penalty: f32The L2 regularization (weight decay) penalty.
verbose: boolWhether to show detailed progress information during training.
patience: Option<i32>The number of epochs to wait for improvement before triggering early stopping.
loss_reduction: LossReductionThe method used to reduce the loss during training.
k_neighbors: usizeThe number of nearest neighbors to consider.
min_desired_loss: Option<f64>Minimum desired loss to achieve before stopping early.
timeout: Option<u64>Maximum training time in seconds.
normalized: boolNormalize distance output.
minkowski_p: f64Minkowski p parameter.
repulsion_strength: f32Weight applied to the repulsion term.
kernel_a: f32UMAP kernel parameter a, fitted from min_dist and spread.
Controls the width of the kernel: q = 1 / (1 + a * d^(2b)).
kernel_b: f32UMAP kernel parameter b, fitted from min_dist and spread.
Controls the decay shape: q = 1 / (1 + a * d^(2b)).
neg_sample_rate: usizeNumber of negative samples per positive edge per epoch.
cooldown_ms: u64Milliseconds to sleep at the end of every training epoch.
0 (the default) disables the pause and gives maximum throughput.
Increase this value to reduce GPU utilisation at the cost of longer
training time (e.g. cooldown_ms = 5 for ~10–20 % GPU headroom).
figures_dir: Option<PathBuf>Directory where loss-curve and embedding snapshot plots are written.
Defaults to None, which resolves to "figures" in the current working
directory. Set to a writable PathBuf when the process runs on a
read-only filesystem.
Implementations§
Source§impl TrainingConfig
impl TrainingConfig
Sourcepub fn builder() -> TrainingConfigBuilder
pub fn builder() -> TrainingConfigBuilder
Creates a new builder for constructing a TrainingConfig.
Trait Implementations§
Source§impl Clone for TrainingConfig
impl Clone for TrainingConfig
Source§fn clone(&self) -> TrainingConfig
fn clone(&self) -> TrainingConfig
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read moreSource§impl Debug for TrainingConfig
impl Debug for TrainingConfig
Source§impl From<&TrainingConfig> for UmapConfig
impl From<&TrainingConfig> for UmapConfig
Source§fn from(config: &TrainingConfig) -> Self
fn from(config: &TrainingConfig) -> Self
Source§impl From<&UmapConfig> for TrainingConfig
impl From<&UmapConfig> for TrainingConfig
Source§fn from(config: &UmapConfig) -> Self
fn from(config: &UmapConfig) -> Self
Source§impl From<TrainingConfig> for UmapConfig
impl From<TrainingConfig> for UmapConfig
Source§fn from(config: TrainingConfig) -> Self
fn from(config: TrainingConfig) -> Self
Source§impl From<UmapConfig> for TrainingConfig
impl From<UmapConfig> for TrainingConfig
Source§fn from(config: UmapConfig) -> Self
fn from(config: UmapConfig) -> Self
Auto Trait Implementations§
impl Freeze for TrainingConfig
impl RefUnwindSafe for TrainingConfig
impl Send for TrainingConfig
impl Sync for TrainingConfig
impl Unpin for TrainingConfig
impl UnsafeUnpin for TrainingConfig
impl UnwindSafe for TrainingConfig
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
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
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>
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>
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