public void UpdateMetric(EvalMetric metric, List <NdArray> labels) { for (int index = 0; index < TrainExecs.Count; index++) { var texec = TrainExecs[index]; var islice = _slices[index]; var labelsSlice = labels.Select(s => s.Slice((uint)islice.Item1, (uint)islice.Item2)).ToList(); metric.Update(labelsSlice, texec.Outputs); } }
public void UpdateMetric(EvalMetric metric, NDArrayList labels, bool pre_sliced = false) { var labels_slice = new NDArrayList(); var i = 0; train_execs.Zip(slices, (e, s) => { if (!pre_sliced) { foreach (var label in labels) { labels_slice.Add(label.Slice(s.Begin, s.End.Value)); } } else { labels_slice.Add(labels[i]); } metric.Update(labels_slice.ToArray(), e.Outputs.ToArray()); i++; return(true); }); }