pub struct ParameterGroupConfig<A: Float> {
pub learning_rate: Option<A>,
pub weight_decay: Option<A>,
pub momentum: Option<A>,
pub constraints: Vec<ParameterConstraint<A>>,
pub custom_params: HashMap<String, A>,
}Expand description
Configuration for a parameter group
Fields§
§learning_rate: Option<A>Learning rate for this group
weight_decay: Option<A>Weight decay for this group
momentum: Option<A>Momentum for this group (if applicable)
constraints: Vec<ParameterConstraint<A>>Parameter constraints for this group
custom_params: HashMap<String, A>Custom parameters as key-value pairs
Implementations§
Source§impl<A: Float + Send + Sync> ParameterGroupConfig<A>
impl<A: Float + Send + Sync> ParameterGroupConfig<A>
Sourcepub fn with_learning_rate(self, lr: A) -> Self
pub fn with_learning_rate(self, lr: A) -> Self
Set learning rate
Sourcepub fn with_weight_decay(self, wd: A) -> Self
pub fn with_weight_decay(self, wd: A) -> Self
Set weight decay
Sourcepub fn with_momentum(self, momentum: A) -> Self
pub fn with_momentum(self, momentum: A) -> Self
Set momentum
Sourcepub fn with_custom_param(self, key: String, value: A) -> Self
pub fn with_custom_param(self, key: String, value: A) -> Self
Add custom parameter
Sourcepub fn with_constraint(self, constraint: ParameterConstraint<A>) -> Self
pub fn with_constraint(self, constraint: ParameterConstraint<A>) -> Self
Add a parameter constraint
Sourcepub fn with_value_clip(self, min: A, max: A) -> Self
pub fn with_value_clip(self, min: A, max: A) -> Self
Add value clipping constraint
Sourcepub fn with_l2_norm_constraint(self, maxnorm: A) -> Self
pub fn with_l2_norm_constraint(self, maxnorm: A) -> Self
Add L2 norm constraint
Sourcepub fn with_l1_norm_constraint(self, maxnorm: A) -> Self
pub fn with_l1_norm_constraint(self, maxnorm: A) -> Self
Add L1 norm constraint
Sourcepub fn with_non_negative(self) -> Self
pub fn with_non_negative(self) -> Self
Add non-negativity constraint
Sourcepub fn with_unit_sphere(self) -> Self
pub fn with_unit_sphere(self) -> Self
Add unit sphere constraint
Sourcepub fn with_simplex(self) -> Self
pub fn with_simplex(self) -> Self
Add simplex constraint (sum to 1, all non-negative)
Sourcepub fn with_orthogonal(self, tolerance: A) -> Self
pub fn with_orthogonal(self, tolerance: A) -> Self
Add orthogonal constraint for matrices
Sourcepub fn with_positive_definite(self, mineigenvalue: A) -> Self
pub fn with_positive_definite(self, mineigenvalue: A) -> Self
Add positive definite constraint for symmetric matrices
Sourcepub fn with_spectral_norm(self, maxnorm: A) -> Self
pub fn with_spectral_norm(self, maxnorm: A) -> Self
Add spectral norm constraint
Sourcepub fn with_nuclear_norm(self, maxnorm: A) -> Self
pub fn with_nuclear_norm(self, maxnorm: A) -> Self
Add nuclear norm constraint
Sourcepub fn with_custom_constraint(self, name: String) -> Self
pub fn with_custom_constraint(self, name: String) -> Self
Add custom constraint
Trait Implementations§
Source§impl<A: Clone + Float> Clone for ParameterGroupConfig<A>
impl<A: Clone + Float> Clone for ParameterGroupConfig<A>
Source§fn clone(&self) -> ParameterGroupConfig<A>
fn clone(&self) -> ParameterGroupConfig<A>
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<A> Freeze for ParameterGroupConfig<A>where
A: Freeze,
impl<A> RefUnwindSafe for ParameterGroupConfig<A>where
A: RefUnwindSafe,
impl<A> Send for ParameterGroupConfig<A>where
A: Send,
impl<A> Sync for ParameterGroupConfig<A>where
A: Sync,
impl<A> Unpin for ParameterGroupConfig<A>where
A: Unpin,
impl<A> UnwindSafe for ParameterGroupConfig<A>where
A: 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
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 moreSource§impl<T> Pointable for T
impl<T> Pointable for T
Source§impl<SS, SP> SupersetOf<SS> for SPwhere
SS: SubsetOf<SP>,
impl<SS, SP> SupersetOf<SS> for SPwhere
SS: SubsetOf<SP>,
Source§fn to_subset(&self) -> Option<SS>
fn to_subset(&self) -> Option<SS>
The inverse inclusion map: attempts to construct
self from the equivalent element of its
superset. Read moreSource§fn is_in_subset(&self) -> bool
fn is_in_subset(&self) -> bool
Checks if
self is actually part of its subset T (and can be converted to it).Source§fn to_subset_unchecked(&self) -> SS
fn to_subset_unchecked(&self) -> SS
Use with care! Same as
self.to_subset but without any property checks. Always succeeds.Source§fn from_subset(element: &SS) -> SP
fn from_subset(element: &SS) -> SP
The inclusion map: converts
self to the equivalent element of its superset.