pub struct CompositeRegularization { /* private fields */ }Expand description
Composite regularization that combines multiple regularization schemes
Implementations§
Source§impl CompositeRegularization
impl CompositeRegularization
Sourcepub fn add_regularization(
self,
weight: Float,
regularization: Box<dyn Regularization>,
) -> Self
pub fn add_regularization( self, weight: Float, regularization: Box<dyn Regularization>, ) -> Self
Add a regularization scheme with a weight
Sourcepub fn add_group_lasso(self, alpha: Float, groups: Vec<usize>) -> Result<Self>
pub fn add_group_lasso(self, alpha: Float, groups: Vec<usize>) -> Result<Self>
Add Group Lasso regularization
Sourcepub fn is_any_non_smooth(&self) -> bool
pub fn is_any_non_smooth(&self) -> bool
Check if any component is non-smooth
Trait Implementations§
Source§impl Debug for CompositeRegularization
impl Debug for CompositeRegularization
Source§impl Default for CompositeRegularization
impl Default for CompositeRegularization
Source§impl Regularization for CompositeRegularization
impl Regularization for CompositeRegularization
Source§fn penalty(&self, coefficients: &Array1<Float>) -> Result<Float>
fn penalty(&self, coefficients: &Array1<Float>) -> Result<Float>
Compute the regularization penalty value
Source§fn penalty_gradient(
&self,
coefficients: &Array1<Float>,
) -> Result<Array1<Float>>
fn penalty_gradient( &self, coefficients: &Array1<Float>, ) -> Result<Array1<Float>>
Compute the regularization gradient (subgradient for non-smooth penalties)
Source§fn proximal_operator(
&self,
coefficients: &Array1<Float>,
step_size: Float,
) -> Result<Array1<Float>>
fn proximal_operator( &self, coefficients: &Array1<Float>, step_size: Float, ) -> Result<Array1<Float>>
Apply the proximal operator (for proximal gradient methods)
Source§fn is_non_smooth(&self) -> bool
fn is_non_smooth(&self) -> bool
Check if this regularization is non-smooth (requires proximal methods)
Auto Trait Implementations§
impl Freeze for CompositeRegularization
impl !RefUnwindSafe for CompositeRegularization
impl Send for CompositeRegularization
impl Sync for CompositeRegularization
impl Unpin for CompositeRegularization
impl !UnwindSafe for CompositeRegularization
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> 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