pub trait Regularization:
Debug
+ Send
+ Sync {
// Required methods
fn penalty(&self, coefficients: &Array1<Float>) -> Result<Float>;
fn penalty_gradient(
&self,
coefficients: &Array1<Float>,
) -> Result<Array1<Float>>;
fn strength(&self) -> Float;
fn name(&self) -> &'static str;
// Provided methods
fn proximal_operator(
&self,
coefficients: &Array1<Float>,
_step_size: Float,
) -> Result<Array1<Float>> { ... }
fn is_non_smooth(&self) -> bool { ... }
}Expand description
Trait for regularization penalties
Required Methods§
Sourcefn penalty(&self, coefficients: &Array1<Float>) -> Result<Float>
fn penalty(&self, coefficients: &Array1<Float>) -> Result<Float>
Compute the regularization penalty value
Provided Methods§
Sourcefn 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)
Sourcefn is_non_smooth(&self) -> bool
fn is_non_smooth(&self) -> bool
Check if this regularization is non-smooth (requires proximal methods)