edu.stanford.nlp.optimization
Class SMDMinimizer

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

public class SMDMinimizer
extends StochasticMinimizer

Stochastic Meta Descent Minimizer based on

Accelerated training of conditional random fields with stochastic gradient methods S. V. N. Vishwanathan, Nicol N. Schraudolph, Mark W. Schmidt, Kevin P. Murphy June 2006 Proceedings of the 23rd international conference on Machine learning ICML '06 Publisher: ACM Press

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

Minimizer smd = new SMDMinimizer();
DiffFunction df = new SomeDiffFunction();
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;
useAlgorithmicDifferentiation = true;

Since:
1.0
Author:
Alex Kleeman

Nested Class Summary
 
Nested classes/interfaces inherited from class edu.stanford.nlp.optimization.StochasticMinimizer
StochasticMinimizer.InvalidElementException, StochasticMinimizer.PropertySetter<T1>
 
Field Summary
 double cPosDef
           
 double lam
           
 double meta
           
 double mu
           
 boolean printMinMax
           
 
Fields inherited from class edu.stanford.nlp.optimization.StochasticMinimizer
bSize, file, gain, gen, grad, gradList, infoFile, k, maxTime, memory, newGrad, newX, numBatches, numPasses, outputFrequency, outputIterationsToFile, quiet, v, x
 
Constructor Summary
SMDMinimizer()
           
SMDMinimizer(double initialSMDGain, int batchSize, StochasticCalculateMethods method, int passes)
           
SMDMinimizer(double initGain, int batchSize, StochasticCalculateMethods method, int passes, boolean outputToFile)
           
 
Method Summary
protected  String getName()
           
protected  void init(AbstractStochasticCachingDiffFunction func)
           
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.
 void setBatchSize(int batchSize)
           
 void shutUp()
           
protected  void takeStep(AbstractStochasticCachingDiffFunction dfunction)
           
 Pair<Integer,Double> tune(Function function, double[] initial, long msPerTest)
           
 
Methods inherited from class edu.stanford.nlp.optimization.StochasticMinimizer
gainSchedule, minimize, say, sayln, smooth, tune, tuneBatch, tuneDouble, tuneDouble, tuneGain
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

mu

public double mu

lam

public double lam

cPosDef

public double cPosDef

meta

public double meta

printMinMax

public boolean printMinMax
Constructor Detail

SMDMinimizer

public SMDMinimizer()

SMDMinimizer

public SMDMinimizer(double initialSMDGain,
                    int batchSize,
                    StochasticCalculateMethods method,
                    int passes)

SMDMinimizer

public SMDMinimizer(double initGain,
                    int batchSize,
                    StochasticCalculateMethods method,
                    int passes,
                    boolean outputToFile)
Method Detail

shutUp

public void shutUp()
Overrides:
shutUp in class StochasticMinimizer

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
Overrides:
minimize in class StochasticMinimizer
Parameters:
function - the objective function
functionTolerance - a double value
initial - a initial feasible point

init

protected void init(AbstractStochasticCachingDiffFunction func)
Overrides:
init in class StochasticMinimizer

tune

public Pair<Integer,Double> tune(Function function,
                                 double[] initial,
                                 long msPerTest)
Specified by:
tune in class StochasticMinimizer

takeStep

protected void takeStep(AbstractStochasticCachingDiffFunction dfunction)
Specified by:
takeStep in class StochasticMinimizer

getName

protected String getName()
Specified by:
getName in class StochasticMinimizer

main

public static void main(String[] args)


Stanford NLP Group