public class Nesterovs extends Object implements IUpdater
Modifier and Type | Class and Description |
---|---|
static class |
Nesterovs.Builder |
Modifier and Type | Field and Description |
---|---|
static double |
DEFAULT_NESTEROV_LEARNING_RATE |
static double |
DEFAULT_NESTEROV_MOMENTUM |
Constructor and Description |
---|
Nesterovs() |
Nesterovs(double momentum) |
Nesterovs(double learningRate,
double momentum) |
Nesterovs(double learningRate,
ISchedule momentumSchedule) |
Nesterovs(ISchedule learningRateSchedule) |
Nesterovs(ISchedule learningRateSchedule,
double momentum) |
Nesterovs(ISchedule learningRateSchedule,
ISchedule momentumSchedule) |
Modifier and Type | Method and Description |
---|---|
Nesterovs |
clone()
Clone the updater
|
double |
currentMomentum(int iteration,
int epoch) |
double |
getLearningRate(int iteration,
int epoch)
Get the learning rate - if any - for the updater, at the specified iteration and epoch.
|
boolean |
hasLearningRate() |
GradientUpdater |
instantiate(INDArray viewArray,
boolean initializeViewArray)
Create a new gradient updater
|
GradientUpdater |
instantiate(Map<String,INDArray> updaterState,
boolean initializeStateArrays) |
void |
setLrAndSchedule(double lr,
ISchedule lrSchedule)
Set the learning rate and schedule.
|
long |
stateSize(long numParams)
Determine the updater state size for the given number of parameters.
|
public static final double DEFAULT_NESTEROV_MOMENTUM
public static final double DEFAULT_NESTEROV_LEARNING_RATE
public Nesterovs()
public Nesterovs(double momentum)
public Nesterovs(double learningRate, double momentum)
public Nesterovs(ISchedule learningRateSchedule)
public Nesterovs(ISchedule learningRateSchedule, double momentum)
public Nesterovs(double learningRate, ISchedule momentumSchedule)
public long stateSize(long numParams)
IUpdater
public GradientUpdater instantiate(INDArray viewArray, boolean initializeViewArray)
IUpdater
instantiate
in interface IUpdater
viewArray
- The updater state size view awayinitializeViewArray
- If true: initialise the updater statepublic GradientUpdater instantiate(Map<String,INDArray> updaterState, boolean initializeStateArrays)
instantiate
in interface IUpdater
public double getLearningRate(int iteration, int epoch)
IUpdater
getLearningRate
in interface IUpdater
iteration
- Iteration at which to get the learning rateepoch
- Epoch at which to get the learning ratepublic boolean hasLearningRate()
hasLearningRate
in interface IUpdater
public void setLrAndSchedule(double lr, ISchedule lrSchedule)
IUpdater
IUpdater.hasLearningRate()
returns false.setLrAndSchedule
in interface IUpdater
lr
- Learning rate to set (typically not used if LR schedule is non-null)lrSchedule
- Learning rate schedule to set (may be null)public double currentMomentum(int iteration, int epoch)
Copyright © 2020. All rights reserved.