GradientDescent

public class GradientDescent

Basic Stochastic gradient descent optimizer. GradientDescent updates the current weight using the current gradient ?L/?w multiplied by the learning rate.

Constants

Inherited Constants

org.tensorflow.framework.optimizers.Optimizer
String VARIABLE_V2

Public Constructors

GradientDescent(Graph graph)
Creates a GradientDescent Optimizer
GradientDescent(Graph graph, float learningRate)
Creates a GradientDescent Optimizer
GradientDescent(Graph graph, String name, float learningRate)
Creates a GradientDescent Optimizer

Public Methods

String
getOptimizerName()
Get the Name of the optimizer.
String

Inherited Methods

org.tensorflow.framework.optimizers.Optimizer
Op
applyGradients(List<GradAndVar<? extends TType>> gradsAndVars, String name)
Applies gradients to variables
<T extends TType> List<GradAndVar<?>>
computeGradients(Operand<?> loss)
Computes the gradients based on a loss operand.
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>>
getSlot(Output<T> var, String slotName)
Gets the slot associated with the specified variable and slot name.
final Ops
getTF()
Gets the Optimizer's Ops instance
Op
minimize(Operand<?> loss)
Minimizes the loss by updating the variables
Op
minimize(Operand<?> loss, String name)
Minimizes the loss by updating the variables
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 Constructors

public GradientDescent (Graph graph)

Creates a GradientDescent Optimizer

Parameters
graph the TensorFlow graph

public GradientDescent (Graph graph, float learningRate)

Creates a GradientDescent Optimizer

Parameters
graph the TensorFlow graph
learningRate the learning rate, defaults to 0.01

public GradientDescent (Graph graph, String name, float learningRate)

Creates a GradientDescent Optimizer

Parameters
graph the TensorFlow graph
name the name for this Optimizer, default is "GradientDescent"
learningRate the learning rate, defaults to 0.01

Public Methods

public String getOptimizerName ()

Get the Name of the optimizer.

Returns
  • The optimizer name.

public String toString ()