code: public void getGradient(int[] batch, double[] gradient) {
          for (int i=0; i<batch.length; i++) {
              addGradient(i, gradient);
          }
      }
docs: Gets the gradient at the current point, computed on the given batch of examples.
  @param batch A set of indices indicating the examples over which the gradient should be computed.
  @param gradient The output gradient, a vector of partial derivatives.