/// <summary> /// Called on each testing iteration of the sequence model. /// </summary> /// <param name="sender">Specifies the event sender.</param> /// <param name="e">Specifies the event args.</param> private void m_mycaffe_OnTestingIteration(object sender, TestingIterationArgs <float> e) { float fAccuracy = m_rgAccuracyTraining.Average(); m_plotsSequenceAccuracyTrain.Add(m_nTotalSequences, fAccuracy * 100); if (m_plotsSequenceAccuracyTrain.Count > 100) { m_plotsSequenceAccuracyTrain.RemoveAt(0); } m_rgAccuracyTesting.Add((float)e.Accuracy); m_rgAccuracyTesting.RemoveAt(0); fAccuracy = m_rgAccuracyTesting.Average(); m_plotsSequenceAccuracyTest.Add(m_nTotalSequences, fAccuracy * 100); if (m_plotsSequenceAccuracyTest.Count > 100) { m_plotsSequenceAccuracyTest.RemoveAt(0); } PlotCollectionSet set = new PlotCollectionSet(); set.Add(m_plotsSequenceAccuracyTrain); set.Add(m_plotsSequenceAccuracyTest); Image img = SimpleGraphingControl.QuickRender(set, pbImageAccuracy.Width, pbImageAccuracy.Height, false, null, null, false, m_rgZeroLine); m_bw.ReportProgress(1, new Tuple <Image, int>(img, 1)); }
private void m_solver_OnTestingIteration(object sender, TestingIterationArgs <T> e) { if (m_sw.Elapsed.TotalMilliseconds > 1000) { updateStatus(e.Iteration, m_solver.MaximumIteration, e.Accuracy, m_dfLastLoss, m_dfLastLearningRate); m_sw.Restart(); } }