LRegularizer< TPower > Class Template Reference

The L_p regularizer for arbitrary integer p. More...

Public Member Functions

 LRegularizer (double factor=1.0)
 Create the regularizer object. More...

void Evaluate (const MatType &weight, MatType &gradient)
 Calculate the gradient for regularization. More...

void serialize (Archive &ar, const unsigned int)
 Serialize the regularizer (nothing to do). More...


Public Attributes

double factor
 The constant for the regularization. More...


Static Public Attributes

static const int Power = TPower
 The power of the regularizer. More...


Detailed Description

template<int TPower>
class mlpack::ann::LRegularizer< TPower >

The L_p regularizer for arbitrary integer p.

Template Parameters
PowerPower of regularizer; i.e. Power = 1 gives the L1-regularization.

Definition at line 27 of file lregularizer.hpp.

Constructor & Destructor Documentation

◆ LRegularizer()

LRegularizer ( double  factor = 1.0)

Create the regularizer object.

factorThe factor for regularization.

Member Function Documentation

◆ Evaluate()

void Evaluate ( const MatType &  weight,
MatType &  gradient 

Calculate the gradient for regularization.

Template Parameters
MatTypeType of weight matrix.
weightThe weight matrix to be regularized.
gradientThe calculated gradient.

◆ serialize()

void serialize ( Archive &  ar,
const unsigned  int 

Serialize the regularizer (nothing to do).

Member Data Documentation

◆ factor

double factor

The constant for the regularization.

Definition at line 55 of file lregularizer.hpp.

◆ Power

const int Power = TPower

The power of the regularizer.

Definition at line 52 of file lregularizer.hpp.

The documentation for this class was generated from the following file:
  • /home/jenkins-mlpack/