code: @Override
      public void applyUpdater(INDArray gradient, int iteration, int epoch) {
          if (v == null)
              throw new IllegalStateException("Updater has not been initialized with view state");
  
          double momentum = config.currentMomentum(iteration, epoch);
          double learningRate = config.getLearningRate(iteration, epoch);
  
          //reference https://cs231n.github.io/neural-networks-3/#sgd 2nd equation
          //DL4J default is negative step function thus we flipped the signs:
          // x += mu * v_prev + (-1 - mu) * v
          //i.e., we do params -= updatedGradient, not params += updatedGradient
  
          //v = mu * v - lr * gradient
          INDArray vPrev = v.dup(gradientReshapeOrder);
          v.muli(momentum).subi(gradient.dup(gradientReshapeOrder).muli(learningRate)); //Modify state array in-place
  
          /*
          Next line is equivalent to:
          INDArray ret = vPrev.muli(momentum).addi(v.mul(-momentum - 1));
          gradient.assign(ret);
          */
          Nd4j.getExecutioner().exec(new OldAddOp(vPrev.muli(momentum), v.mul(-momentum - 1), gradient));
      }
docs: Get the nesterov update
  
  @param gradient  the gradient to get the update for
  @param iteration
  @return