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
Method Summary |
protected double |
gainSchedule(int it,
double tau)
|
protected abstract String |
getName()
|
protected void |
init(AbstractStochasticCachingDiffFunction 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 function,
double functionTolerance,
double[] initial,
int maxIterations)
|
protected void |
say(String s)
|
protected void |
sayln(String s)
|
void |
shutUp()
|
protected double[] |
smooth(List<double[]> toSmooth)
|
protected abstract void |
takeStep(AbstractStochasticCachingDiffFunction dfunction)
|
abstract Pair<Integer,Double> |
tune(Function function,
double[] initial,
long msPerTest)
|
Pair<Integer,Double> |
tune(Function function,
double[] initial,
long msPerTest,
List<Integer> batchSizes,
List<Double> gains)
|
int |
tuneBatch(Function function,
double[] initial,
long msPerTest,
int bStart)
|
double |
tuneDouble(Function function,
double[] initial,
long msPerTest,
StochasticMinimizer.PropertySetter<Double> ps,
double lower,
double upper)
|
double |
tuneDouble(Function function,
double[] initial,
long msPerTest,
StochasticMinimizer.PropertySetter<Double> ps,
double lower,
double upper,
double TOL)
|
double |
tuneGain(Function function,
double[] initial,
long msPerTest,
double lower,
double upper)
|
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
outputIterationsToFile
public boolean outputIterationsToFile
outputFrequency
public int outputFrequency
gain
public static double gain
x
protected double[] x
newX
protected double[] newX
grad
protected double[] grad
newGrad
protected double[] newGrad
v
protected double[] v
numBatches
protected int numBatches
k
protected int k
bSize
protected static int bSize
quiet
protected boolean quiet
gradList
protected List<double[]> gradList
memory
protected int memory
numPasses
protected int numPasses
gen
protected Random gen
file
protected PrintWriter file
infoFile
protected PrintWriter infoFile
maxTime
protected long maxTime
StochasticMinimizer
public StochasticMinimizer()
shutUp
public void shutUp()
getName
protected abstract String getName()
takeStep
protected abstract void takeStep(AbstractStochasticCachingDiffFunction dfunction)
gainSchedule
protected double gainSchedule(int it,
double tau)
smooth
protected double[] smooth(List<double[]> toSmooth)
tune
public abstract Pair<Integer,Double> tune(Function function,
double[] initial,
long msPerTest)
tuneDouble
public double tuneDouble(Function function,
double[] initial,
long msPerTest,
StochasticMinimizer.PropertySetter<Double> ps,
double lower,
double upper)
tuneDouble
public double tuneDouble(Function function,
double[] initial,
long msPerTest,
StochasticMinimizer.PropertySetter<Double> ps,
double lower,
double upper,
double TOL)
tuneGain
public double tuneGain(Function function,
double[] initial,
long msPerTest,
double lower,
double upper)
tuneBatch
public int tuneBatch(Function function,
double[] initial,
long msPerTest,
int bStart)
tune
public Pair<Integer,Double> tune(Function function,
double[] initial,
long msPerTest,
List<Integer> batchSizes,
List<Double> gains)
init
protected void init(AbstractStochasticCachingDiffFunction func)
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 functionfunctionTolerance
- a double
valueinitial
- a initial feasible point
minimize
public double[] minimize(Function function,
double functionTolerance,
double[] initial,
int maxIterations)
- Specified by:
minimize
in interface Minimizer
sayln
protected void sayln(String s)
say
protected void say(String s)
Stanford NLP Group