edu.stanford.nlp.optimization
Class ScaledSGDMinimizer
java.lang.Object
edu.stanford.nlp.optimization.StochasticMinimizer
edu.stanford.nlp.optimization.ScaledSGDMinimizer
- All Implemented Interfaces:
- HasEvaluators, Minimizer
public class ScaledSGDMinimizer
- extends StochasticMinimizer
Stochastic Gradient Descent To Quasi Newton Minimizer
An experimental minimizer which takes a stochastic function (one implementing AbstractStochasticCachingDiffFunction)
and executes SGD for the first couple passes, During the final iterations a series of approximate hessian vector
products are built up... These are then passed to the QNminimizer so that it can start right up without the typical
delay.
- Since:
- 1.0
- Author:
- Alex Kleeman
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 |
ScaledSGDMinimizer(double SGDGain,
int batchSize)
|
ScaledSGDMinimizer(double SGDGain,
int batchSize,
int sgdPasses)
|
ScaledSGDMinimizer(double SGDGain,
int batchSize,
int sgdPasses,
int method)
|
ScaledSGDMinimizer(double SGDGain,
int batchSize,
int sgdPasses,
int method,
boolean outputToFile)
|
ScaledSGDMinimizer(SeqClassifierFlags flags)
|
Methods inherited from class edu.stanford.nlp.optimization.StochasticMinimizer |
gainSchedule, minimize, minimize, say, sayln, setEvaluators, smooth, tune, tuneBatch, tuneDouble, tuneDouble, tuneGain |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
yList
public List<double[]> yList
sList
public List<double[]> sList
diag
public double[] diag
ScaledSGDMinimizer
public ScaledSGDMinimizer(SeqClassifierFlags flags)
ScaledSGDMinimizer
public ScaledSGDMinimizer(double SGDGain,
int batchSize,
int sgdPasses)
ScaledSGDMinimizer
public ScaledSGDMinimizer(double SGDGain,
int batchSize,
int sgdPasses,
int method)
ScaledSGDMinimizer
public ScaledSGDMinimizer(double SGDGain,
int batchSize,
int sgdPasses,
int method,
boolean outputToFile)
ScaledSGDMinimizer
public ScaledSGDMinimizer(double SGDGain,
int batchSize)
tuneFixedGain
public double tuneFixedGain(Function function,
double[] initial,
long msPerTest,
double fixedStart)
tune
public Pair<Integer,Double> tune(Function function,
double[] initial,
long msPerTest)
- Specified by:
tune
in class StochasticMinimizer
shutUp
public void shutUp()
- Overrides:
shutUp
in class StochasticMinimizer
setBatchSize
public void setBatchSize(int batchSize)
setMaxTime
public void setMaxTime(Long max)
getName
public String getName()
- Specified by:
getName
in class StochasticMinimizer
takeStep
protected void takeStep(AbstractStochasticCachingDiffFunction dfunction)
- Specified by:
takeStep
in class StochasticMinimizer
init
protected void init(AbstractStochasticCachingDiffFunction func)
- Overrides:
init
in class StochasticMinimizer
serializeWeights
public void serializeWeights(String serializePath,
double[] weights)
serializeWeights
public void serializeWeights(String serializePath,
double[] weights,
double[] diag)
getWeights
public double[] getWeights(String loadPath)
throws IOException,
ClassCastException,
ClassNotFoundException
- Throws:
IOException
ClassCastException
ClassNotFoundException
getDiag
public double[] getDiag(String loadPath)
throws IOException,
ClassCastException,
ClassNotFoundException
- Throws:
IOException
ClassCastException
ClassNotFoundException
Stanford NLP Group