pub struct ValidationSettings {
pub enabled: bool,
pub validation_split: f64,
pub batch_size: usize,
pub num_workers: usize,
}
Expand description
Configuration for validation during training
Validation helps monitor model performance on unseen data during training, which is crucial for detecting overfitting and ensuring good generalization.
§Examples
use scirs2_neural::training::ValidationSettings;
let validation = ValidationSettings {
enabled: true,
validation_split: 0.2, // Use 20% of data for validation
batch_size: 64,
num_workers: 2,
};
Fields§
§enabled: bool
Whether to enable validation during training
When disabled, no validation will be performed even if this struct is provided.
validation_split: f64
Fraction of training data to use for validation (0.0 to 1.0)
For example, 0.2 means 20% of the data will be used for validation and 80% for training. The data is split before training begins.
batch_size: usize
Batch size for validation
Can be larger than training batch size since no gradients are computed. Larger validation batches are more memory efficient and faster.
num_workers: usize
Number of parallel workers for validation data loading
Similar to training workers, but for validation data. Setting to 0 uses the main thread.
Trait Implementations§
Source§impl Clone for ValidationSettings
impl Clone for ValidationSettings
Source§fn clone(&self) -> ValidationSettings
fn clone(&self) -> ValidationSettings
1.0.0 · Source§const fn clone_from(&mut self, source: &Self)
const fn clone_from(&mut self, source: &Self)
source
. Read moreSource§impl Debug for ValidationSettings
impl Debug for ValidationSettings
Auto Trait Implementations§
impl Freeze for ValidationSettings
impl RefUnwindSafe for ValidationSettings
impl Send for ValidationSettings
impl Sync for ValidationSettings
impl Unpin for ValidationSettings
impl UnwindSafe for ValidationSettings
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> 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