pub struct BatchConfig {
pub batch_size: usize,
pub shuffle: bool,
pub drop_last: bool,
pub epochs: usize,
pub early_stopping_patience: Option<usize>,
pub min_quality_improvement: f32,
}Expand description
Batch configuration for training
Fields§
§batch_size: usizeBatch size
shuffle: boolShuffle examples
drop_last: boolDrop incomplete last batch
epochs: usizeNumber of epochs
early_stopping_patience: Option<usize>Early stopping patience (None = disabled)
min_quality_improvement: f32Minimum quality improvement for early stopping
Implementations§
Source§impl BatchConfig
impl BatchConfig
Sourcepub fn single_pass() -> Self
pub fn single_pass() -> Self
Create config for single pass (no batching)
Sourcepub fn for_data_size(hint: &DataSizeHint) -> Self
pub fn for_data_size(hint: &DataSizeHint) -> Self
Create config optimized for size hint
Trait Implementations§
Source§impl Clone for BatchConfig
impl Clone for BatchConfig
Source§fn clone(&self) -> BatchConfig
fn clone(&self) -> BatchConfig
Returns a duplicate of the value. Read more
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreSource§impl Debug for BatchConfig
impl Debug for BatchConfig
Source§impl Default for BatchConfig
impl Default for BatchConfig
Source§impl<'de> Deserialize<'de> for BatchConfig
impl<'de> Deserialize<'de> for BatchConfig
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 BatchConfig
impl RefUnwindSafe for BatchConfig
impl Send for BatchConfig
impl Sync for BatchConfig
impl Unpin for BatchConfig
impl UnwindSafe for BatchConfig
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