pub struct GcConfig {
pub strategy: GcStrategy,
pub enabled: bool,
pub min_dims: usize,
pub eps: f64,
}Expand description
Configuration for gradient centralization.
Fields§
§strategy: GcStrategyCentralization strategy.
enabled: boolWhether to apply GC (can be toggled dynamically).
min_dims: usizeMinimum parameter dimensions to apply GC (skip small parameters). For example, bias vectors (1D) are typically not centralized.
eps: f64Epsilon for numerical stability.
Implementations§
Source§impl GcConfig
impl GcConfig
Sourcepub fn new(strategy: GcStrategy) -> Self
pub fn new(strategy: GcStrategy) -> Self
Create a new GC configuration.
Sourcepub fn with_min_dims(self, min_dims: usize) -> Self
pub fn with_min_dims(self, min_dims: usize) -> Self
Set minimum dimensions for applying GC.
Trait Implementations§
Auto Trait Implementations§
impl Freeze for GcConfig
impl RefUnwindSafe for GcConfig
impl Send for GcConfig
impl Sync for GcConfig
impl Unpin for GcConfig
impl UnwindSafe for GcConfig
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