Skip to main content

Regularizer

Trait Regularizer 

Source
pub trait Regularizer<A, D>{
    // Required methods
    fn apply(
        &self,
        params: &Array<A, D>,
        gradients: &mut Array<A, D>,
    ) -> Result<A>;
    fn penalty(&self, params: &Array<A, D>) -> Result<A>;
}
Expand description

Trait for regularizers that can be applied to parameters and gradients

Required Methods§

Source

fn apply(&self, params: &Array<A, D>, gradients: &mut Array<A, D>) -> Result<A>

Apply regularization to parameters and gradients

§Arguments
  • params - The parameters to regularize
  • gradients - The gradients to modify
§Returns

The regularization penalty value

Source

fn penalty(&self, params: &Array<A, D>) -> Result<A>

Compute the regularization penalty value

§Arguments
  • params - The parameters to compute the penalty for
§Returns

The regularization penalty value

Dyn Compatibility§

This trait is dyn compatible.

In older versions of Rust, dyn compatibility was called "object safety".

Implementors§

Source§

impl<A, D> Regularizer<A, D> for ActivityRegularization<A>

Source§

impl<A, D> Regularizer<A, D> for Dropout<A>
where A: Float + ScalarOperand + Debug + Send + Sync, D: Dimension<Pattern = D>,

Source§

impl<A, D> Regularizer<A, D> for ElasticNet<A>

Source§

impl<A, D> Regularizer<A, D> for EntropyRegularization<A>

Source§

impl<A, D> Regularizer<A, D> for GroupLasso<A>

Source§

impl<A, D> Regularizer<A, D> for L1<A>

Source§

impl<A, D> Regularizer<A, D> for L2<A>

Source§

impl<A, D> Regularizer<A, D> for StructuredSparsity<A>

Source§

impl<A: Float + Debug + ScalarOperand + FromPrimitive + Send + Sync, D: Dimension + Send + Sync> Regularizer<A, D> for ManifoldRegularization<A>

Source§

impl<A: Float + Debug + ScalarOperand + FromPrimitive + Send + Sync, D: Dimension + Send + Sync> Regularizer<A, D> for OrthogonalRegularization<A>

Source§

impl<A: Float + Debug + ScalarOperand + FromPrimitive + Send + Sync, D: Dimension + Send + Sync> Regularizer<A, D> for WeightStandardization<A>

Source§

impl<A: Float + Debug + ScalarOperand + FromPrimitive, D: Dimension + Send + Sync> Regularizer<A, D> for CutMix<A>

Source§

impl<A: Float + Debug + ScalarOperand + FromPrimitive, D: Dimension + Send + Sync> Regularizer<A, D> for LabelSmoothing<A>

Source§

impl<A: Float + Debug + ScalarOperand + FromPrimitive, D: Dimension + Send + Sync> Regularizer<A, D> for MixUp<A>

Source§

impl<A: Float + Debug + ScalarOperand + FromPrimitive, D: Dimension + Send + Sync> Regularizer<A, D> for SpectralNorm<A>

Source§

impl<A: Float + Debug + ScalarOperand + FromPrimitive, D: Dimension + Send + Sync> Regularizer<A, D> for StochasticDepth<A>

Source§

impl<A: Float + Debug + ScalarOperand + Send + Sync, D: Dimension + RemoveAxis + Send + Sync> Regularizer<A, D> for FeatureDropout<A>

Source§

impl<A: Float + Debug + ScalarOperand + Send + Sync, D: Dimension + RemoveAxis + Send + Sync> Regularizer<A, D> for SpatialDropout<A>

Source§

impl<A: Float + Debug + ScalarOperand + Send + Sync, D: Dimension + Send + Sync> Regularizer<A, D> for DropConnect<A>

Source§

impl<A: Float + FromPrimitive + Debug + ScalarOperand, D: Dimension + Send + Sync> Regularizer<A, D> for ShakeDrop<A>