pub struct MlBatchSize(/* private fields */);Implementations§
Source§impl MlBatchSize
impl MlBatchSize
Sourcepub fn new(value: usize) -> Result<Self, MlTrainingError>
pub fn new(value: usize) -> Result<Self, MlTrainingError>
Examples found in repository?
examples/basic_usage.rs (line 5)
3fn main() -> Result<(), use_ml_training::MlTrainingError> {
4 let run_id = MlTrainingRunId::new("run-001")?;
5 let batch_size = MlBatchSize::new(32)?;
6 let learning_rate = MlLearningRate::new(0.001)?;
7 let optimizer: MlOptimizerKind = "adamw".parse()?;
8
9 assert_eq!(run_id.as_str(), "run-001");
10 assert_eq!(batch_size.get(), 32);
11 assert_eq!(learning_rate.value(), 0.001);
12 assert_eq!(optimizer, MlOptimizerKind::AdamW);
13 Ok(())
14}Sourcepub const fn get(self) -> usize
pub const fn get(self) -> usize
Examples found in repository?
examples/basic_usage.rs (line 10)
3fn main() -> Result<(), use_ml_training::MlTrainingError> {
4 let run_id = MlTrainingRunId::new("run-001")?;
5 let batch_size = MlBatchSize::new(32)?;
6 let learning_rate = MlLearningRate::new(0.001)?;
7 let optimizer: MlOptimizerKind = "adamw".parse()?;
8
9 assert_eq!(run_id.as_str(), "run-001");
10 assert_eq!(batch_size.get(), 32);
11 assert_eq!(learning_rate.value(), 0.001);
12 assert_eq!(optimizer, MlOptimizerKind::AdamW);
13 Ok(())
14}Trait Implementations§
Source§impl Clone for MlBatchSize
impl Clone for MlBatchSize
Source§fn clone(&self) -> MlBatchSize
fn clone(&self) -> MlBatchSize
Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · 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 MlBatchSize
impl Debug for MlBatchSize
Source§impl Hash for MlBatchSize
impl Hash for MlBatchSize
Source§impl Ord for MlBatchSize
impl Ord for MlBatchSize
Source§fn cmp(&self, other: &MlBatchSize) -> Ordering
fn cmp(&self, other: &MlBatchSize) -> Ordering
1.21.0 (const: unstable) · Source§fn max(self, other: Self) -> Selfwhere
Self: Sized,
fn max(self, other: Self) -> Selfwhere
Self: Sized,
Compares and returns the maximum of two values. Read more
Source§impl PartialEq for MlBatchSize
impl PartialEq for MlBatchSize
Source§fn eq(&self, other: &MlBatchSize) -> bool
fn eq(&self, other: &MlBatchSize) -> bool
Tests for
self and other values to be equal, and is used by ==.Source§impl PartialOrd for MlBatchSize
impl PartialOrd for MlBatchSize
impl Copy for MlBatchSize
impl Eq for MlBatchSize
impl StructuralPartialEq for MlBatchSize
Auto Trait Implementations§
impl Freeze for MlBatchSize
impl RefUnwindSafe for MlBatchSize
impl Send for MlBatchSize
impl Sync for MlBatchSize
impl Unpin for MlBatchSize
impl UnsafeUnpin for MlBatchSize
impl UnwindSafe for MlBatchSize
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