code: public double getValue(int[] batch) {
          double value = 0.0;
          for (int i=0; i<batch.length; i++) {
              value += getValue(i);
          }
          return value;
      }
docs: Gets value of this function 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.
  @return The value of the function at the point.