public interface TimeFunction
extends java.io.Serializable
| Modifier and Type | Method and Description |
|---|---|
double |
apply(int t)
Returns the function value at time step t.
|
static TimeFunction |
constant(double alpha)
Returns the constant learning rate.
|
static TimeFunction |
exp(double initLearningRate,
double decaySteps)
Returns the exponential decay function
initLearningRate * exp(-t / decaySteps). |
static TimeFunction |
exp(double initLearningRate,
double decaySteps,
double endLearningRate)
Returns the exponential decay function
initLearningRate * pow(endLearningRate / initLearningRate, min(t, decaySteps) / decaySteps). |
static TimeFunction |
exp(double initLearningRate,
double decaySteps,
double decayRate,
boolean staircase)
Returns the exponential decay function
initLearningRate * pow(decayRate, t / decaySteps). |
static TimeFunction |
inverse(double initLearningRate,
double decaySteps)
Returns the inverse decay function
initLearningRate * decaySteps / (t + decaySteps). |
static TimeFunction |
inverse(double initLearningRate,
double decaySteps,
double decayRate)
Returns the inverse decay function
initLearningRate / (1 + decayRate * t / decaySteps). |
static TimeFunction |
inverse(double initLearningRate,
double decaySteps,
double decayRate,
boolean staircase)
Returns the inverse decay function
initLearningRate / (1 + decayRate * t / decaySteps). |
static TimeFunction |
linear(double initLearningRate,
double decaySteps)
Returns the linear learning rate decay function that ends at 0.0001.
|
static TimeFunction |
linear(double initLearningRate,
double decaySteps,
double endLearningRate)
Returns the linear learning rate decay function that starts with
an initial learning rate and reach an end learning rate in the given
decay steps..
|
static TimeFunction |
piecewise(int[] boundaries,
double[] values)
Returns the piecewise constant learning rate.
|
static TimeFunction |
polynomial(double initLearningRate,
double decaySteps,
double endLearningRate,
boolean cycle,
double power)
Returns the polynomial learning rate decay function that starts with
an initial learning rate and reach an end learning rate in the given
decay steps.
|
double apply(int t)
t - the discrete time step.static TimeFunction constant(double alpha)
alpha - the learning rate.static TimeFunction piecewise(int[] boundaries, double[] values)
boundaries - A list of integers with strictly increasing entries.values - The values for the intervals defined by boundaries.
It should have one more element than boundaries.static TimeFunction linear(double initLearningRate, double decaySteps)
initLearningRate - the initial learning rate.decaySteps - the decay steps.static TimeFunction linear(double initLearningRate, double decaySteps, double endLearningRate)
initLearningRate - the initial learning rate.decaySteps - the decay steps.endLearningRate - the end learning rate.static TimeFunction polynomial(double initLearningRate, double decaySteps, double endLearningRate, boolean cycle, double power)
initLearningRate - the initial learning rate.decaySteps - the decay steps.endLearningRate - the end learning rate.cycle - the flag whether or not it should cycle beyond decaySteps.power - the power of the polynomial.static TimeFunction inverse(double initLearningRate, double decaySteps)
initLearningRate * decaySteps / (t + decaySteps).initLearningRate - the initial learning rate.decaySteps - the decay steps that should be a small percentage
of the number of iterations.static TimeFunction inverse(double initLearningRate, double decaySteps, double decayRate)
initLearningRate / (1 + decayRate * t / decaySteps).initLearningRate - the initial learning rate.decaySteps - how often to apply decay.decayRate - the decay rate.static TimeFunction inverse(double initLearningRate, double decaySteps, double decayRate, boolean staircase)
initLearningRate / (1 + decayRate * t / decaySteps).initLearningRate - the initial learning rate.decaySteps - how often to apply decay.decayRate - the decay rate.staircase - the flag whether to apply decay in a discrete staircase,
as opposed to continuous, fashion.static TimeFunction exp(double initLearningRate, double decaySteps)
initLearningRate * exp(-t / decaySteps).initLearningRate - the initial learning rate.decaySteps - the decay steps that should be a small percentage
of the number of iterations.static TimeFunction exp(double initLearningRate, double decaySteps, double endLearningRate)
initLearningRate * pow(endLearningRate / initLearningRate, min(t, decaySteps) / decaySteps).initLearningRate - the initial learning rate.decaySteps - the maximum decay steps.endLearningRate - the end learning rate.static TimeFunction exp(double initLearningRate, double decaySteps, double decayRate, boolean staircase)
initLearningRate * pow(decayRate, t / decaySteps).initLearningRate - the initial learning rate.decaySteps - how often to apply decay.decayRate - the decay rate.staircase - the flag whether to apply decay in a discrete staircase,
as opposed to continuous, fashion.