public class SGDMinimizer<T extends Function> extends java.lang.Object implements Minimizer<T>, HasEvaluators
Modifier and Type | Field and Description |
---|---|
protected int |
bSize |
protected java.util.Random |
gen |
protected double |
lambda |
protected long |
maxTime |
protected int |
numPasses |
protected boolean |
quiet |
protected double |
sigma |
protected int |
t0 |
protected int |
tuningSamples |
protected double[] |
x |
protected double |
xnorm |
protected double |
xscale |
Constructor and Description |
---|
SGDMinimizer(double sigma,
int numPasses) |
SGDMinimizer(double sigma,
int numPasses,
int tuningSamples) |
SGDMinimizer(double sigma,
int numPasses,
int tuningSamples,
int batchSize) |
SGDMinimizer(LogPrior prior,
int numPasses,
int batchSize,
int tuningSamples) |
Modifier and Type | Method and Description |
---|---|
protected java.lang.String |
getName() |
double |
getObjective(AbstractStochasticCachingDiffUpdateFunction function,
double[] w,
double wscale,
int[] sample) |
protected void |
init(AbstractStochasticCachingDiffUpdateFunction func) |
double[] |
minimize(Function function,
double functionTolerance,
double[] initial)
Attempts to find an unconstrained minimum of the objective
function starting at initial , accurate to
within functionTolerance (normally implemented as
a multiplier of the range value to give range tolerance). |
double[] |
minimize(Function f,
double functionTolerance,
double[] initial,
int maxIterations)
Attempts to find an unconstrained minimum of the objective
function starting at initial , accurate to
within functionTolerance (normally implemented as
a multiplier of the range value to give range tolerance), but
running only for at most maxIterations iterations. |
protected void |
sayln(java.lang.String s) |
void |
setEvaluators(int iters,
Evaluator[] evaluators) |
void |
shutUp() |
double |
tryEta(AbstractStochasticCachingDiffUpdateFunction function,
double[] initial,
int[] sample,
double eta) |
double |
tune(AbstractStochasticCachingDiffUpdateFunction function,
double[] initial,
int sampleSize,
double seta)
Finds a good learning rate to start with.
|
protected double xscale
protected double xnorm
protected double[] x
protected int t0
protected final double sigma
protected double lambda
protected boolean quiet
protected final int numPasses
protected int bSize
protected final int tuningSamples
protected java.util.Random gen
protected long maxTime
public SGDMinimizer(double sigma, int numPasses)
public SGDMinimizer(double sigma, int numPasses, int tuningSamples)
public SGDMinimizer(double sigma, int numPasses, int tuningSamples, int batchSize)
public SGDMinimizer(LogPrior prior, int numPasses, int batchSize, int tuningSamples)
public void shutUp()
protected java.lang.String getName()
public void setEvaluators(int iters, Evaluator[] evaluators)
setEvaluators
in interface HasEvaluators
protected void init(AbstractStochasticCachingDiffUpdateFunction func)
public double getObjective(AbstractStochasticCachingDiffUpdateFunction function, double[] w, double wscale, int[] sample)
public double tryEta(AbstractStochasticCachingDiffUpdateFunction function, double[] initial, int[] sample, double eta)
public double tune(AbstractStochasticCachingDiffUpdateFunction function, double[] initial, int sampleSize, double seta)
function
- initial
- sampleSize
- seta
- public double[] minimize(Function function, double functionTolerance, double[] initial)
Minimizer
function
starting at initial
, accurate to
within functionTolerance
(normally implemented as
a multiplier of the range value to give range tolerance).public double[] minimize(Function f, double functionTolerance, double[] initial, int maxIterations)
Minimizer
function
starting at initial
, accurate to
within functionTolerance
(normally implemented as
a multiplier of the range value to give range tolerance), but
running only for at most maxIterations
iterations.protected void sayln(java.lang.String s)