mlpack
Public Member Functions | Public Attributes | Static Public Attributes | List of all members
mlpack::ann::LRegularizer< TPower > Class Template Reference

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

#include <lregularizer.hpp>

Public Member Functions

 LRegularizer (double factor=1.0)
 Create the regularizer object. More...
 
template<typename MatType >
void Evaluate (const MatType &weight, MatType &gradient)
 Calculate the gradient for regularization. More...
 
template<typename Archive >
void serialize (Archive &ar, const uint32_t)
 Serialize the regularizer (nothing to do).
 
template<>
void Evaluate (const MatType &weight, MatType &gradient)
 
template<>
void Evaluate (const MatType &weight, MatType &gradient)
 

Public Attributes

double factor
 The constant for the regularization.
 

Static Public Attributes

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

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.

Constructor & Destructor Documentation

◆ LRegularizer()

template<int Power>
mlpack::ann::LRegularizer< Power >::LRegularizer ( double  factor = 1.0)

Create the regularizer object.

Parameters
factorThe factor for regularization.

Member Function Documentation

◆ Evaluate()

template<int Power>
template<typename MatType >
void mlpack::ann::LRegularizer< Power >::Evaluate ( const MatType &  weight,
MatType &  gradient 
)

Calculate the gradient for regularization.

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

The documentation for this class was generated from the following files: