Class Nag


public class Nag extends Optimizer
Nag is a Nesterov accelerated gradient optimizer.

This optimizer updates each weight by:
\( state = momentum * state + grad + wd *weight\)
\( weight = weight - (lr * (grad + momentum * state))

  • Constructor Details

    • Nag

      protected Nag(Nag.Builder builder)
      Creates a new instance of Nag optimizer.
      Parameters:
      builder - the builder to create a new instance of Nag optimizer
  • Method Details

    • update

      public void update(String parameterId, NDArray weight, NDArray grad)
      Updates the parameters according to the gradients.
      Specified by:
      update in class Optimizer
      Parameters:
      parameterId - the parameter to be updated
      weight - the weights of the parameter
      grad - the gradients