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 moreSource§impl<T: Debug> Debug for StandardModelConfig<T>
impl<T: Debug> Debug for StandardModelConfig<T>
Source§impl<T> Default for StandardModelConfig<T>
impl<T> Default for StandardModelConfig<T>
Source§impl<'de, T> Deserialize<'de> for StandardModelConfig<T>where
T: Deserialize<'de>,
impl<'de, T> Deserialize<'de> for StandardModelConfig<T>where
T: Deserialize<'de>,
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>,
Source§impl<T> NetworkConfig<T> for StandardModelConfig<T>
impl<T> NetworkConfig<T> for StandardModelConfig<T>
Source§impl<T> Serialize for StandardModelConfig<T>where
T: Serialize,
impl<T> Serialize for StandardModelConfig<T>where
T: Serialize,
Source§impl<T> TrainingConfiguration<T> for StandardModelConfig<T>
impl<T> TrainingConfiguration<T> for StandardModelConfig<T>
fn epochs(&self) -> usize
fn batch_size(&self) -> usize
fn learning_rate(&self) -> Option<&T>
fn momentum(&self) -> Option<&T>
fn weight_decay(&self) -> Option<&T>
fn dropout(&self) -> Option<&T>
fn decay(&self) -> Option<&T>
fn beta1(&self) -> Option<&T>
fn beta2(&self) -> Option<&T>
fn epsilon(&self) -> Option<&T>
fn gradient_clip(&self) -> Option<&T>
impl<T> Send for StandardModelConfig<T>where
T: Send,
impl<T> Sync for StandardModelConfig<T>where
T: Sync,
Auto Trait Implementations§
impl<T> Freeze for StandardModelConfig<T>
impl<T> RefUnwindSafe for StandardModelConfig<T>where
T: RefUnwindSafe,
impl<T> Unpin for StandardModelConfig<T>where
T: Unpin,
impl<T> UnwindSafe for StandardModelConfig<T>where
T: UnwindSafe,
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> CallInPlace<T> for Twhere
T: CallInto<T>,
impl<T> CallInPlace<T> for Twhere
T: CallInto<T>,
Source§fn call_inplace<F>(&mut self, f: F) -> <T as CallInto<T>>::Output
fn call_inplace<F>(&mut self, f: F) -> <T as CallInto<T>>::Output
call_on_mut method allows an object to be passed onto a function that takes a mutable reference
to the object. This is useful for cases where you want to perform an operation on
an object and mutate it in the process.Source§impl<T> CallInto<T> for T
impl<T> CallInto<T> for T
Source§impl<T> CallOn<T> for Twhere
T: CallInto<T>,
impl<T> CallOn<T> for Twhere
T: CallInto<T>,
Source§fn call_on<F>(&self, f: F) -> <T as CallInto<T>>::Output
fn call_on<F>(&self, f: F) -> <T as CallInto<T>>::Output
call_on method allows an object to be passed onto a function that takes a reference
to the object. This is useful for cases where you want to perform an operation on
an object without needing to extract it from a container or context.