Turi Create  4.0
turi::optimization::l1_norm Class Reference

#include <ml/optimization/regularizers-inl.hpp>

Public Member Functions

 l1_norm (const DenseVector &_lambda)
 
 ~l1_norm ()
 
double compute_function_value (const DenseVector &point) const
 
void compute_gradient (const DenseVector &point, DenseVector &gradient) const
 
void apply_proximal_operator (DenseVector &point, const double &_penalty=0) const
 
bool is_smooth ()
 

Protected Attributes

DenseVector lambda
 
size_t variables
 

Detailed Description

Interface for the regularizer (Scaled L1-norm)

 f(x) = \sum_{i} lambda_i * |x_i|

Definition at line 129 of file regularizers-inl.hpp.

Constructor & Destructor Documentation

◆ l1_norm()

turi::optimization::l1_norm::l1_norm ( const DenseVector &  _lambda)
inline

Default constructor.

Definition at line 141 of file regularizers-inl.hpp.

◆ ~l1_norm()

turi::optimization::l1_norm::~l1_norm ( )
inline

Default desctuctor. Do nothing.

Definition at line 149 of file regularizers-inl.hpp.

Member Function Documentation

◆ apply_proximal_operator()

void turi::optimization::l1_norm::apply_proximal_operator ( DenseVector &  point,
const double &  _penalty = 0 
) const
inlinevirtual

Compute the proximal operator for the l2-regularizer

Parameters
[in,out]pointPoint at which we are computing the gradient.
[in]penaltyPenalty
Note
The proximal operator for lambda * ||x||_1 at the point v is given by soft(x, lambda) = (x - lambda)_+ - (-x - lambda)_+

Implements turi::optimization::regularizer_interface.

Definition at line 191 of file regularizers-inl.hpp.

◆ compute_function_value()

double turi::optimization::l1_norm::compute_function_value ( const DenseVector &  point) const
inlinevirtual

Compute the function value of the regularizer at a given point.

Parameters
[in]pointPoint at which we are computing the gradient.

Implements turi::optimization::regularizer_interface.

Definition at line 157 of file regularizers-inl.hpp.

◆ compute_gradient()

void turi::optimization::l1_norm::compute_gradient ( const DenseVector &  point,
DenseVector &  gradient 
) const
inlinevirtual

Compute the subgradient at the given point.

Parameters
[in]pointPoint at which we are computing the gradient.
[out]gradientDense sub-gradient

Implements turi::optimization::regularizer_interface.

Definition at line 170 of file regularizers-inl.hpp.

◆ is_smooth()

bool turi::optimization::regularizer_interface::is_smooth ( )
inlineinherited

Function to determine if the regularizer is smooth.

Returns
false

Definition at line 56 of file regularizer_interface.hpp.

Member Data Documentation

◆ lambda

DenseVector turi::optimization::l1_norm::lambda
protected

Penalty on the regularizer

Definition at line 133 of file regularizers-inl.hpp.

◆ variables

size_t turi::optimization::l1_norm::variables
protected

Variables in the problem

Definition at line 134 of file regularizers-inl.hpp.


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