public class SGDMinimizer<T extends Function> extends Object implements Minimizer<T>, HasEvaluators
Modifier and Type | Field and Description |
---|---|
protected int |
bSize |
protected 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 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 , within
functionTolerance . |
double[] |
minimize(Function f,
double functionTolerance,
double[] initial,
int maxIterations) |
protected void |
say(String s) |
protected void |
sayln(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 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 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
, within
functionTolerance
.public double[] minimize(Function f, double functionTolerance, double[] initial, int maxIterations)
protected void sayln(String s)
protected void say(String s)