docs: private static MeanMagnitudes getLayerMeanMagnitudes(int layerIdx, TrainModuleUtils.GraphInfo gi,
                      List<Persistable> updates, List<Integer> iterationCounts, ModelType modelType) {
          if (gi == null) {
              return new MeanMagnitudes(Collections.emptyList(), Collections.emptyMap(), Collections.emptyMap(),
                              Collections.emptyMap());
          }
  
          String layerName = gi.getVertexNames().get(layerIdx);
          if (modelType != ModelType.CG) {
              //Get the original name, for the index...
              layerName = gi.getOriginalVertexName().get(layerIdx);
          }
          String layerType = gi.getVertexTypes().get(layerIdx);
          if ("input".equalsIgnoreCase(layerType)) { //TODO better checking - other vertices, etc
              return new MeanMagnitudes(Collections.emptyList(), Collections.emptyMap(), Collections.emptyMap(),
                              Collections.emptyMap());
          }
  
          List<Integer> iterCounts = new ArrayList<>();
          Map<String, List<Double>> ratioValues = new HashMap<>();
          Map<String, List<Double>> outParamMM = new HashMap<>();
          Map<String, List<Double>> outUpdateMM = new HashMap<>();
  
          if (updates != null) {
              int pCount = -1;
              for (Persistable u : updates) {
                  pCount++;
                  if (!(u instanceof StatsReport))
                      continue;
                  StatsReport sp = (StatsReport) u;
                  if (iterationCounts != null) {
                      iterCounts.add(iterationCounts.get(pCount));
                  } else {
                      int iterCount = sp.getIterationCount();
                      iterCounts.add(iterCount);
                  }
  
  
                  //Info we want, for each parameter in this layer: mean magnitudes for parameters, updates AND the ratio of these
                  Map<String, Double> paramMM = sp.getMeanMagnitudes(StatsType.Parameters);
                  Map<String, Double> updateMM = sp.getMeanMagnitudes(StatsType.Updates);
                  for (String s : paramMM.keySet()) {
                      String prefix;
                      if (modelType == ModelType.Layer) {
                          prefix = layerName;
                      } else {
                          prefix = layerName + "_";
                      }
  
                      if (s.startsWith(prefix)) {
                          //Relevant parameter for this layer...
                          String layerParam = s.substring(prefix.length());
                          double pmm = paramMM.getOrDefault(s, 0.0);
                          double umm = updateMM.getOrDefault(s, 0.0);
                          if (!Double.isFinite(pmm)) {
                              pmm = NAN_REPLACEMENT_VALUE;
                          }
                          if (!Double.isFinite(umm)) {
                              umm = NAN_REPLACEMENT_VALUE;
                          }
                          double ratio;
                          if (umm == 0.0 && pmm == 0.0) {
                              ratio = 0.0; //To avoid NaN from 0/0
                          } else {
                              ratio = umm / pmm;
                          }
                          List<Double> list = ratioValues.get(layerParam);
                          if (list == null) {
                              list = new ArrayList<>();
                              ratioValues.put(layerParam, list);
                          }
                          list.add(ratio);
  
                          List<Double> pmmList = outParamMM.get(layerParam);
                          if (pmmList == null) {
                              pmmList = new ArrayList<>();
                              outParamMM.put(layerParam, pmmList);
                          }
                          pmmList.add(pmm);
  
                          List<Double> ummList = outUpdateMM.get(layerParam);
                          if (ummList == null) {
                              ummList = new ArrayList<>();
                              outUpdateMM.put(layerParam, ummList);
                          }
                          ummList.add(umm);
                      }
                  }
              }
          }
  
          return new MeanMagnitudes(iterCounts, ratioValues, outParamMM, outUpdateMM);
      }