public class
Momentum
Stochastic gradient descent plus momentum, either nesterov or traditional.
See the paper for details of nesterov momentum.
Constants
float | LEARNING_RATE_DEFAULT | |
String | MOMENTUM | |
float | MOMENTUM_DEFAULT | |
boolean | NESTEROV_DEFAULT |
Inherited Constants
String | VARIABLE_V2 |
Public Constructors
Public Methods
String |
getOptimizerName()
Get the Name of the optimizer.
|
String |
toString()
|
Inherited Methods
Op |
applyGradients(List<GradAndVar<? extends TType>> gradsAndVars, String name)
Applies gradients to variables
|
<T extends TType> List<GradAndVar<?>> | |
static String |
createName(Output<? extends TType> variable, String slotName)
Creates a name by combining a variable name and a slot name
|
abstract String |
getOptimizerName()
Get the Name of the optimizer.
|
<T extends TType> Optional<Variable<T>> | |
final Ops |
getTF()
Gets the Optimizer's Ops instance
|
Op | |
Op |
boolean |
equals(Object arg0)
|
final Class<?> |
getClass()
|
int |
hashCode()
|
final void |
notify()
|
final void |
notifyAll()
|
String |
toString()
|
final void |
wait(long arg0, int arg1)
|
final void |
wait(long arg0)
|
final void |
wait()
|
Constants
public static final float LEARNING_RATE_DEFAULT
Constant Value:
0.01
public static final String MOMENTUM
Constant Value:
"momentum"
public static final float MOMENTUM_DEFAULT
Constant Value:
0.0
public static final boolean NESTEROV_DEFAULT
Constant Value:
false
Public Constructors
public Momentum (Graph graph, float learningRate)
Creates a Momentum Optimizer
Parameters
graph | the TensorFlow graph |
---|---|
learningRate | the learning rate |
public Momentum (Graph graph, float learningRate, float momentum)
Creates a Momentum Optimizer
Parameters
graph | the TensorFlow graph |
---|---|
learningRate | the learning rate |
momentum | hyperparameter that accelerates gradient descent in the relevant direction and dampens oscillations, Must be greater than or equal to zero. Default is 0. |
public Momentum (Graph graph, float learningRate, float momentum, boolean useNesterov)
Creates a Momentum Optimizer
Parameters
graph | the TensorFlow graph |
---|---|
learningRate | the learning rate |
momentum | hyperparameter that accelerates gradient descent in the relevant direction and dampens oscillations, Must be greater than or equal to zero. Default is 0. |
useNesterov | Whether to apply Nesterov momentum. Defaults to false. |
public Momentum (Graph graph, String name, float learningRate, float momentum, boolean useNesterov)
Creates a Momentum Optimizer
Parameters
graph | the TensorFlow graph |
---|---|
name | the name for this Optimizer |
learningRate | the learning rate |
momentum | hyperparameter that accelerates gradient descent in the relevant direction and dampens oscillations, Must be greater than or equal to zero. Default is 0. |
useNesterov | Whether to apply Nesterov momentum. Defaults to false. |
Public Methods
public String getOptimizerName ()
Get the Name of the optimizer.
Returns
- The optimizer name.
public String toString ()