Class SGD

java.lang.Object
smile.deep.optimizer.SGD
All Implemented Interfaces:
Serializable, Optimizer

public class SGD extends Object implements Optimizer
Stochastic gradient descent (with momentum) optimizer.
See Also:
  • Constructor Summary

    Constructors
    Constructor
    Description
    SGD()
    Constructor.
    SGD(smile.math.TimeFunction learningRate)
    Constructor.
    SGD(smile.math.TimeFunction learningRate, smile.math.TimeFunction momentum)
    Constructor.
  • Method Summary

    Modifier and Type
    Method
    Description
     
    void
    update(Layer layer, int m, int t)
    Updates a layer.

    Methods inherited from class java.lang.Object

    clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
  • Constructor Details

    • SGD

      public SGD()
      Constructor.
    • SGD

      public SGD(smile.math.TimeFunction learningRate)
      Constructor.
      Parameters:
      learningRate - the learning rate.
    • SGD

      public SGD(smile.math.TimeFunction learningRate, smile.math.TimeFunction momentum)
      Constructor.
      Parameters:
      learningRate - the learning rate.
      momentum - the momentum.
  • Method Details

    • toString

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

      public void update(Layer layer, int m, int t)
      Description copied from interface: Optimizer
      Updates a layer.
      Specified by:
      update in interface Optimizer
      Parameters:
      layer - a neural network layer.
      m - the size of mini-batch.
      t - the time step, i.e. the number of training iterations so far.