Class GradientDescent

java.lang.Object
org.tensorflow.framework.optimizers.Optimizer
org.tensorflow.framework.optimizers.GradientDescent

public class GradientDescent extends Optimizer
Basic Stochastic gradient descent optimizer. GradientDescent updates the current weight using the current gradient ?L/?w multiplied by the learning rate.
  • Field Details

    • LEARNING_RATE_DEFAULT

      public static final float LEARNING_RATE_DEFAULT
      See Also:
  • Constructor Details

    • GradientDescent

      public GradientDescent(Graph graph)
      Creates a GradientDescent Optimizer
      Parameters:
      graph - the TensorFlow graph
    • GradientDescent

      public GradientDescent(Graph graph, float learningRate)
      Creates a GradientDescent Optimizer
      Parameters:
      graph - the TensorFlow graph
      learningRate - the learning rate, defaults to 0.01
    • GradientDescent

      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
  • Method Details

    • applyDense

      protected <T extends TType> Op applyDense(Ops deps, Output<T> gradient, Output<T> variable)
      Generates the gradient update operations for the specific variable and gradient.
      Specified by:
      applyDense in class Optimizer
      Type Parameters:
      T - The type of the variable.
      Parameters:
      gradient - The gradient to use.
      variable - The variable to update.
      Returns:
      An operand which applies the desired optimizer update to the variable.
    • toString

      public String toString()
      Overrides:
      toString in class Object
    • getOptimizerName

      public String getOptimizerName()
      Get the Name of the optimizer.
      Specified by:
      getOptimizerName in class Optimizer
      Returns:
      The optimizer name.