Пример #1
0
        public override string ToString()
        {
            var builder = new StringBuilder();

            builder.Append((IterationMode.ToString() + IterationStage).PadRight(IterationInfoNameMaxWidth, ' '));
            builder.Append(' ');

            // Usually, a benchmarks takes more than 10 iterations (rarely more than 99)
            // PadLeft(2, ' ') looks like a good trade-off between alignment and amount of characters
            builder.Append(IterationIndex.ToString(MainCultureInfo).PadLeft(2, ' '));
            builder.Append(": ");

            builder.Append(Operations.ToString(MainCultureInfo));
            builder.Append(' ');
            builder.Append(OpSymbol);
            builder.Append(", ");

            builder.Append(Nanoseconds.ToString("0.00", MainCultureInfo));
            builder.Append(' ');
            builder.Append(NsSymbol);
            builder.Append(", ");

            builder.Append(GetAverageTime().ToString(MainCultureInfo).ToAscii());
            builder.Append("/op");

            return(builder.ToString());
        }
Пример #2
0
        public string ToOutputLine()
        {
            // Usually, a benchmarks takes more than 10 iterations (rarely more than 99)
            // PadLeft(2, ' ') looks like a good trade-off between alignment and amount of characters
            string alignedIterationIndex = IterationIndex.ToString().PadLeft(2, ' ');

            return($"{IterationMode} {alignedIterationIndex}: {GetDisplayValue()}");
        }
 private void DisplayClassifierPeformanceDuringTraining()
 {
     txtIteration.Text           = IterationIndex.ToString();
     txtMCCTraining.Text         = _TraintimeEngine.PerformanceEvaluation.MCC.ToString();
     txtSensitivityTraining.Text = _TraintimeEngine.PerformanceEvaluation.Sensitivity.ToString();
     txtSpecificityTraining.Text = _TraintimeEngine.PerformanceEvaluation.Specificity.ToString();
     txtRMSETraining.Text        = _TraintimeEngine._RMSE.ToString();
     txtAccuracyTraining.Text    = _TraintimeEngine.PerformanceEvaluation.Accuracy.ToString();
 }
        private void trainToolStripMenuItem_Click(object sender, EventArgs e)
        {
            bool terminateLoop = false;

            ShowConsoleMessage("Staring training in 'batch' mode [CurrentIterationIndex = " + IterationIndex.ToString());
            tolerableError = float.Parse(txtAcceptableRMS.Text);

            _TraintimeEngine.TrainingDataTable = _TrainingDataTable;
            TotalIterations = TotalIterations + int.Parse(txtLearningIterations.Text);

            //for (; IterationIndex <= TotalIterations; IterationIndex++)
            while (!terminateLoop)
            {
                _TraintimeEngine.Run();

                //ShowConsoleMessage("Error in Iteration No. " + IterationIndex.ToString() + " was: " + _TraintimeEngine._RMSE.ToString() + " and MCC was: " + _TraintimeEngine.PerformanceEvaluation.MCC.ToString() +  );
                DisplayClassifierPeformanceDuringTraining();

                if (_TraintimeEngine._RMSE <= tolerableError)
                {
                    terminateLoop = true;
                }

                if (IterationIndex == TotalIterations)
                {
                    terminateLoop = true;
                }

                if (terminateLoop == false)
                {
                    IterationIndex++;
                }

                progressbar.Value = (int)((((float)IterationIndex) / ((float)TotalIterations)) * 100);
                Application.DoEvents();
            }
            ShowConsoleMessage("'Batch' mode training completed");
        }