12 #ifndef MLPACK_CORE_OPTIMIZERS_FW_CONSTR_LPBALL_HPP 13 #define MLPACK_CORE_OPTIMIZERS_FW_CONSTR_LPBALL_HPP 18 namespace optimization {
75 p(p), regFlag(true), lambda(lambda)
88 if (p == std::numeric_limits<double>::infinity())
103 double q = 1 / (1.0 - 1.0 / p);
104 s = - sign(v) % pow(abs(s), q - 1);
105 s = arma::normalise(s, p);
114 s = arma::abs(v / lambda);
135 double P()
const {
return p; }
137 double&
P() {
return p;}
145 arma::vec
Lambda()
const {
return lambda;}
155 bool regFlag =
false;
double & P()
Modify the p-norm.
void Optimize(const arma::mat &v, arma::mat &s)
Optimizer of Linear Constrained Problem for FrankWolfe.
T Sign(const T x)
Signum function.
arma::vec & Lambda()
Modify the regularization parameter.
double P() const
Get the p-norm.
The core includes that mlpack expects; standard C++ includes and Armadillo.
bool RegFlag() const
Get regularization flag.
ConstrLpBallSolver(const double p, const arma::vec lambda)
Construct the solver of constrained problem, with regularization parameter lambda here...
arma::vec Lambda() const
Get the regularization parameter.
static MLPACK_EXPORT util::PrefixedOutStream Fatal
Prints fatal messages prefixed with [FATAL], then terminates the program.
bool & RegFlag()
Modify regularization flag.
LinearConstrSolver for FrankWolfe algorithm.
ConstrLpBallSolver(const double p)
Construct the solver of constrained problem.