mlpack  git-master
ConstrLpBallSolver Class Reference

LinearConstrSolver for FrankWolfe algorithm. More...

Public Member Functions

 ConstrLpBallSolver (const double p)
 Construct the solver of constrained problem. More...

 
 ConstrLpBallSolver (const double p, const arma::vec lambda)
 Construct the solver of constrained problem, with regularization parameter lambda here. More...

 
arma::vec Lambda () const
 Get the regularization parameter. More...

 
arma::vec & Lambda ()
 Modify the regularization parameter. More...

 
void Optimize (const arma::mat &v, arma::mat &s)
 Optimizer of Linear Constrained Problem for FrankWolfe. More...

 
double P () const
 Get the p-norm. More...

 
double & P ()
 Modify the p-norm. More...

 
bool RegFlag () const
 Get regularization flag. More...

 
bool & RegFlag ()
 Modify regularization flag. More...

 

Detailed Description

LinearConstrSolver for FrankWolfe algorithm.

Constraint domain given in the form of lp ball. That is, given $ v $, solve $ s:=arg\min_{s\in D} <s, v> $ when $ D $ is a regularized lp ball. That is,

\[ D = \{ x: (\sum_j|\lambda_j x_j|^p)^{1/p}\leq 1 \}. \]

If $ \lambda $ is not given in the constructor, default is using all $ \lambda_j = 1 $ for all $ j $.

In applications such as Orthogonal Matching Pursuit (OMP), $ \lambda $ could be ideally set to the norm of the elements in the dictionary.

For $ p=1 $: take (one) $ k = arg\max_j |v_j/\lambda_j|$, then the solution is:

\[ s_k = -sign(v_k)/\lambda_k, \qquad s_j = 0, \quad j\neq k. \]

For $ 1<p<\infty $: the solution is

\[ t_j = -sign(v_j) |v_j/\lambda_j|^{q-1}, \qquad s_j = \frac{t_j}{||t||_p\cdot\lambda_j}, \quad 1/p + 1/q = 1. \]

For $ p=\infty $: the solution is

\[ s_j = -sign(v_j)/\lambda_j \]

Definition at line 55 of file constr_lpball.hpp.

Constructor & Destructor Documentation

◆ ConstrLpBallSolver() [1/2]

ConstrLpBallSolver ( const double  p)
inline

Construct the solver of constrained problem.

The constrained domain should be unit lp ball for this class.

Parameters
pThe constraint is unit lp ball.

Definition at line 64 of file constr_lpball.hpp.

◆ ConstrLpBallSolver() [2/2]

ConstrLpBallSolver ( const double  p,
const arma::vec  lambda 
)
inline

Construct the solver of constrained problem, with regularization parameter lambda here.

Parameters
pThe constraint is unit lp ball.
lambdaRegularization parameter.

Definition at line 74 of file constr_lpball.hpp.

Member Function Documentation

◆ Lambda() [1/2]

arma::vec Lambda ( ) const
inline

Get the regularization parameter.

Definition at line 145 of file constr_lpball.hpp.

◆ Lambda() [2/2]

arma::vec& Lambda ( )
inline

Modify the regularization parameter.

Definition at line 147 of file constr_lpball.hpp.

◆ Optimize()

void Optimize ( const arma::mat &  v,
arma::mat &  s 
)
inline

Optimizer of Linear Constrained Problem for FrankWolfe.

Parameters
vInput local gradient.
sOutput optimal solution in the constrained domain (lp ball).

Definition at line 85 of file constr_lpball.hpp.

References Log::Fatal, and mlpack::math::Sign().

◆ P() [1/2]

double P ( ) const
inline

Get the p-norm.

Definition at line 135 of file constr_lpball.hpp.

◆ P() [2/2]

double& P ( )
inline

Modify the p-norm.

Definition at line 137 of file constr_lpball.hpp.

◆ RegFlag() [1/2]

bool RegFlag ( ) const
inline

Get regularization flag.

Definition at line 140 of file constr_lpball.hpp.

◆ RegFlag() [2/2]

bool& RegFlag ( )
inline

Modify regularization flag.

Definition at line 142 of file constr_lpball.hpp.


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