code: public static double score(MultiLayerNetwork model, DataSetIterator testData, boolean average) {
          //TODO: do this properly taking into account division by N, L1/L2 etc
          double sumScore = 0.0;
          int totalExamples = 0;
          while (testData.hasNext()) {
              DataSet ds = testData.next();
              int numExamples = ds.numExamples();
  
              sumScore += numExamples * model.score(ds);
              totalExamples += numExamples;
          }
  
          if (!average)
              return sumScore;
          return sumScore / totalExamples;
      }
docs: Score the given test data
  with the given multi layer network
  @param model model to use
  @param testData the test data to test with
  @param average whether to average the score or not
  @return the score for the given test data given the model