public class InefficientSGDMinimizer<T extends Function> extends StochasticMinimizer<T>
The basic way to use the minimizer is with a null constructor, then the simple minimize method:
Minimizer smd = new InefficientSGDMinimizer();
DiffFunction df = new SomeDiffFunction(); //Note that it must be a incidence of AbstractStochasticCachingDiffFunction
double tol = 1e-4;
double[] initial = getInitialGuess();
int maxIterations = someSafeNumber;
double[] minimum = qnm.minimize(df,tol,initial,maxIterations);
Constructing with a null constructor will use the default values of
batchSize = 15;
initialGain = 0.1;
NOTE: This class was previously called SGDMinimizer. SGDMinimizer is now what was StochasticInPlaceMinimizer.
New projects should use that class, since it uses the ideas of Bottou's work to provide efficient SGD.
StochasticMinimizer.PropertySetter<T1>
Constructor and Description |
---|
InefficientSGDMinimizer() |
InefficientSGDMinimizer(double SGDGain,
int batchSize) |
InefficientSGDMinimizer(double SGDGain,
int batchSize,
int passes) |
InefficientSGDMinimizer(double SGDGain,
int batchSize,
int passes,
boolean outputToFile) |
InefficientSGDMinimizer(double SGDGain,
int batchSize,
int passes,
long maxTime) |
InefficientSGDMinimizer(double SGDGain,
int batchSize,
int passes,
long maxTime,
boolean outputToFile) |
Modifier and Type | Method and Description |
---|---|
protected java.lang.String |
getName() |
static void |
main(java.lang.String[] args) |
void |
setBatchSize(int batchSize) |
void |
shutUp() |
protected void |
takeStep(AbstractStochasticCachingDiffFunction dfunction) |
Pair<java.lang.Integer,java.lang.Double> |
tune(Function function,
double[] initial,
long msPerTest) |
Pair<java.lang.Integer,java.lang.Double> |
tune(Function function,
double[] initial,
long msPerTest,
double gainLow,
double gainHigh) |
gainSchedule, init, minimize, minimize, say, sayln, setEvaluators, smooth, tune, tuneBatch, tuneDouble, tuneDouble, tuneGain
public InefficientSGDMinimizer()
public InefficientSGDMinimizer(double SGDGain, int batchSize)
public InefficientSGDMinimizer(double SGDGain, int batchSize, int passes)
public InefficientSGDMinimizer(double SGDGain, int batchSize, int passes, boolean outputToFile)
public InefficientSGDMinimizer(double SGDGain, int batchSize, int passes, long maxTime)
public InefficientSGDMinimizer(double SGDGain, int batchSize, int passes, long maxTime, boolean outputToFile)
public void shutUp()
shutUp
in class StochasticMinimizer<T extends Function>
public void setBatchSize(int batchSize)
protected java.lang.String getName()
getName
in class StochasticMinimizer<T extends Function>
public Pair<java.lang.Integer,java.lang.Double> tune(Function function, double[] initial, long msPerTest, double gainLow, double gainHigh)
public Pair<java.lang.Integer,java.lang.Double> tune(Function function, double[] initial, long msPerTest)
tune
in class StochasticMinimizer<T extends Function>
protected void takeStep(AbstractStochasticCachingDiffFunction dfunction)
takeStep
in class StochasticMinimizer<T extends Function>
public static void main(java.lang.String[] args)