pub struct ParamGroupState {
pub lr: f32,
pub options: HashMap<String, f32>,
pub param_count: usize,
}Expand description
Parameter group state
Fields§
§lr: f32Learning rate for this group
options: HashMap<String, f32>Additional options for this group
param_count: usizeNumber of parameters in this group (for validation)
Implementations§
Source§impl ParamGroupState
impl ParamGroupState
Sourcepub fn from_param_group(group: &ParamGroup) -> Self
pub fn from_param_group(group: &ParamGroup) -> Self
Create from a ParamGroup
Sourcepub fn get_option(&self, key: &str, default: f32) -> f32
pub fn get_option(&self, key: &str, default: f32) -> f32
Get an option value with a default
Sourcepub fn set_option(&mut self, key: String, value: f32)
pub fn set_option(&mut self, key: String, value: f32)
Set an option value
Trait Implementations§
Source§impl Clone for ParamGroupState
impl Clone for ParamGroupState
Source§fn clone(&self) -> ParamGroupState
fn clone(&self) -> ParamGroupState
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 moreAuto Trait Implementations§
impl Freeze for ParamGroupState
impl RefUnwindSafe for ParamGroupState
impl Send for ParamGroupState
impl Sync for ParamGroupState
impl Unpin for ParamGroupState
impl UnsafeUnpin for ParamGroupState
impl UnwindSafe for ParamGroupState
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
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>
Converts
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>
Converts
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