edu.stanford.nlp.optimization
Class SGDMinimizer

java.lang.Object
  extended by edu.stanford.nlp.optimization.SGDMinimizer
All Implemented Interfaces:
Minimizer

public class SGDMinimizer
extends Object
implements Minimizer

Stochastic Gradient Descent Minimizer The basic way to use the minimizer is with a null constructor, then the simple minimize method:

Minimizer smd = new SGDMinimizer();
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;

Since:
1.0
Author:
Alex Kleeman

Field Summary
 double gain
           
 int outputFrequency
           
 boolean outputIterationsToFile
           
 
Constructor Summary
SGDMinimizer()
           
SGDMinimizer(double SGDGain, int batchSize)
           
 
Method Summary
static void main(String[] args)
           
 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 function, double functionTolerance, double[] initial, int maxIterations)
           
 void setBatchSize(int batchSize)
           
 void shutUp()
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

outputIterationsToFile

public boolean outputIterationsToFile

outputFrequency

public int outputFrequency

gain

public double gain
Constructor Detail

SGDMinimizer

public SGDMinimizer()

SGDMinimizer

public SGDMinimizer(double SGDGain,
                    int batchSize)
Method Detail

shutUp

public void shutUp()

setBatchSize

public void setBatchSize(int batchSize)

minimize

public double[] minimize(Function function,
                         double functionTolerance,
                         double[] initial)
Description copied from interface: Minimizer
Attempts to find an unconstrained minimum of the objective function starting at initial, within functionTolerance.

Specified by:
minimize in interface Minimizer
Parameters:
function - the objective function
functionTolerance - a double value
initial - a initial feasible point

minimize

public double[] minimize(Function function,
                         double functionTolerance,
                         double[] initial,
                         int maxIterations)
Specified by:
minimize in interface Minimizer

main

public static void main(String[] args)


Stanford NLP Group