pub struct StandardModelConfig<T> { /* private fields */ }Implementations§
Source§impl<T> StandardModelConfig<T>
impl<T> StandardModelConfig<T>
pub fn new() -> Self
Sourcepub const fn batch_size(&self) -> usize
pub const fn batch_size(&self) -> usize
returns a copy of the batch size
Sourcepub const fn batch_size_mut(&mut self) -> &mut usize
pub const fn batch_size_mut(&mut self) -> &mut usize
returns a mutable reference to the batch size
Sourcepub const fn epochs_mut(&mut self) -> &mut usize
pub const fn epochs_mut(&mut self) -> &mut usize
returns a mutable reference to the epochs
Sourcepub const fn hyperparameters(&self) -> &HashMap<String, T>
pub const fn hyperparameters(&self) -> &HashMap<String, T>
returns a reference to the hyperparameters map
Sourcepub const fn hyperparameters_mut(&mut self) -> &mut HashMap<String, T>
pub const fn hyperparameters_mut(&mut self) -> &mut HashMap<String, T>
returns a mutable reference to the hyperparameters map
Sourcepub fn add_parameter(&mut self, key: impl ToString, value: T) -> Option<T>
pub fn add_parameter(&mut self, key: impl ToString, value: T) -> Option<T>
inserts a hyperparameter into the map, returning the previous value if it exists
Sourcepub fn get_parameter<Q>(&self, key: &Q) -> Option<&T>
pub fn get_parameter<Q>(&self, key: &Q) -> Option<&T>
gets a reference to a hyperparameter by key, returning None if it does not exist
Sourcepub fn parameter<Q>(&mut self, key: Q) -> Entry<'_, String, T>where
Q: ToString,
pub fn parameter<Q>(&mut self, key: Q) -> Entry<'_, String, T>where
Q: ToString,
returns an entry for the hyperparameter, allowing for insertion or modification
Sourcepub fn remove_hyperparameter(&mut self, key: impl ToString) -> Option<T>
pub fn remove_hyperparameter(&mut self, key: impl ToString) -> Option<T>
removes a hyperparameter from the map, returning the value if it exists
Sourcepub fn set_batch_size(&mut self, batch_size: usize) -> &mut Self
pub fn set_batch_size(&mut self, batch_size: usize) -> &mut Self
sets the batch size, returning a mutable reference to the current instance
Sourcepub fn set_epochs(&mut self, epochs: usize) -> &mut Self
pub fn set_epochs(&mut self, epochs: usize) -> &mut Self
sets the number of epochs, returning a mutable reference to the current instance
Sourcepub fn with_batch_size(self, batch_size: usize) -> Self
pub fn with_batch_size(self, batch_size: usize) -> Self
consumes the current instance to create another with the given batch size
Sourcepub fn with_epochs(self, epochs: usize) -> Self
pub fn with_epochs(self, epochs: usize) -> Self
consumes the current instance to create another with the given epochs
Sourcepub fn set_decay(&mut self, decay: T) -> Option<T>
pub fn set_decay(&mut self, decay: T) -> Option<T>
sets the decay hyperparameter, returning the previous value if it exists
pub fn set_learning_rate(&mut self, learning_rate: T) -> Option<T>
Sourcepub fn set_momentum(&mut self, momentum: T) -> Option<T>
pub fn set_momentum(&mut self, momentum: T) -> Option<T>
sets the momentum hyperparameter, returning the previous value if it exists
Sourcepub fn set_weight_decay(&mut self, decay: T) -> Option<T>
pub fn set_weight_decay(&mut self, decay: T) -> Option<T>
sets the weight decay hyperparameter, returning the previous value if it exists
Sourcepub fn learning_rate(&self) -> Option<&T>
pub fn learning_rate(&self) -> Option<&T>
returns a reference to the learning rate hyperparameter, if it exists
Sourcepub fn momentum(&self) -> Option<&T>
pub fn momentum(&self) -> Option<&T>
returns a reference to the momentum hyperparameter, if it exists
Sourcepub fn decay(&self) -> Option<&T>
pub fn decay(&self) -> Option<&T>
returns a reference to the decay hyperparameter, if it exists
Sourcepub fn weight_decay(&self) -> Option<&T>
pub fn weight_decay(&self) -> Option<&T>
returns a reference to the weight decay hyperparameter, if it exists
Source§impl<T> StandardModelConfig<T>
impl<T> StandardModelConfig<T>
pub fn insert_parameter(&mut self, key: impl ToString, value: T) -> Option<T>
add_parameter instead.pub fn hyperparam<Q>(&mut self, key: Q) -> Entry<'_, String, T>where
Q: ToString,
parameter instead.pub fn get(&self, key: impl ToString) -> Option<&T>
get_parameter instead.Trait Implementations§
Source§impl<T: Clone> Clone for StandardModelConfig<T>
impl<T: Clone> Clone for StandardModelConfig<T>
Source§fn clone(&self) -> StandardModelConfig<T>
fn clone(&self) -> StandardModelConfig<T>
1.0.0 · Source§const fn clone_from(&mut self, source: &Self)
const fn clone_from(&mut self, source: &Self)
source. Read more