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 Detail

      • 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 Detail

      • update

        public void update​(java.lang.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