public class ModifiedOWLQN extends Object implements Optimizer2
LBFGS
, and solves minimization problems of the form: f(x) +
λ
||x||1. It requires the
function and it's gradient to work. Modifier | Constructor and Description |
---|---|
|
ModifiedOWLQN()
Creates a new mOWL-QN optimizer with no regularization penalty
|
|
ModifiedOWLQN(double lambda)
Creates a new mOWL-QN optimizer
|
protected |
ModifiedOWLQN(ModifiedOWLQN toCopy)
copy constructor
|
Modifier and Type | Method and Description |
---|---|
ModifiedOWLQN |
clone() |
double |
getBeta() |
double |
getEps() |
Vec |
getLambdaMultipler() |
int |
getM()
Returns the number of history items that will be used
|
int |
getMaximumIterations()
Returns the maximum number of iterations to perform
|
void |
optimize(double tolerance,
Vec w,
Vec x0,
Function f,
FunctionVec fp,
FunctionVec fpp)
Attempts to optimize the given function by finding the value of
w
that will minimize the value returned by f(w) , using
w = x0 as an initial starting point. |
void |
optimize(double tolerance,
Vec w,
Vec x0,
Function f,
FunctionVec fp,
FunctionVec fpp,
ExecutorService ex)
Attempts to optimize the given function by finding the value of
w
that will minimize the value returned by f(w) , using
w = x0 as an initial starting point. |
void |
setBeta(double beta)
Sets the shrinkage term used for the line search.
|
void |
setEps(double eps)
Sets the epsilon term that helps control when the gradient descent step
is taken instead of the normal Quasi-Newton step.
|
void |
setLambda(double lambda)
Sets the regularization term for the optimizer
|
void |
setLambdaMultipler(Vec lambdaMultipler)
This method sets a vector that will contain a separate multiplier for
lambda for each dimension of the problem. |
void |
setM(int m)
Sets the number of history items to keep that are used to approximate the
Hessian of the problem
|
void |
setMaximumIterations(int iterations)
Sets the maximum number of iterations allowed for the optimization method
|
public ModifiedOWLQN()
public ModifiedOWLQN(double lambda)
lambda
- the regularization penalty to useprotected ModifiedOWLQN(ModifiedOWLQN toCopy)
toCopy
- the object to copypublic void setLambda(double lambda)
lambda
- the regularization penaltypublic void setLambdaMultipler(Vec lambdaMultipler)
lambda
for each dimension of the problem. This
allows for each dimension to have a different regularization penalty.null
, all dimensions will simply use λ as their
regularization value.lambdaMultipler
- the per-dimension regularization multiplier, or null
.public Vec getLambdaMultipler()
public void setM(int m)
m
- the number of history items to keeppublic int getM()
public void setEps(double eps)
eps
- tolerance term for GD stepspublic double getEps()
public void setBeta(double beta)
beta
- the line search shrinkage termpublic double getBeta()
public void optimize(double tolerance, Vec w, Vec x0, Function f, FunctionVec fp, FunctionVec fpp)
Optimizer2
w
that will minimize the value returned by f(w)
, using
w = x0 as an initial starting point.optimize
in interface Optimizer2
tolerance
- the value that the gradient norm must be less than to
consider convergedw
- the the location to store the final solutionx0
- the initial guess for the solution. This value will not be
changed, and intermediate matrices will be created as the same type.f
- the objective function to minimizerfp
- the derivative of the objective function, may be null
depending on the optimizerfpp
- the Hessian of the objective function, may be null
depending on the optimizerpublic void optimize(double tolerance, Vec w, Vec x0, Function f, FunctionVec fp, FunctionVec fpp, ExecutorService ex)
Optimizer2
w
that will minimize the value returned by f(w)
, using
w = x0 as an initial starting point.optimize
in interface Optimizer2
tolerance
- the value that the gradient norm must be less than to
consider convergedw
- the the location to store the final solutionx0
- the initial guess for the solution. This value will not be
changed, and intermediate matrices will be created as the same type.f
- the objective function to minimizerfp
- the derivative of the objective function, may be null
depending on the optimizerfpp
- the Hessian of the objective function, may be null
depending on the optimizerex
- the source of threads for parallel computation, may be
null
to perform serial computation.public void setMaximumIterations(int iterations)
Optimizer2
setMaximumIterations
in interface Optimizer2
iterations
- the maximum number of iterations to performpublic int getMaximumIterations()
Optimizer2
getMaximumIterations
in interface Optimizer2
public ModifiedOWLQN clone()
clone
in interface Optimizer2
clone
in class Object
Copyright © 2017. All rights reserved.