コード例 #1
0
        //--------------------------------------------------
        private void BenchMarker_BenchmarkComplete(object sender, BenchmarkCompleteArgs e)
        //--------------------------------------------------
        {
            _benchmarkRunning = false;

            switch ((ExitCodes)e.ExitCode)
            {
            case ExitCodes.Normal:
                OutputLog += "Benchmark finished.\n";
                if (_benchmarkData.Count != 0)
                {
                    var byAccuracy = _benchmarkData.Select(x => x).OrderByDescending(x => x.Error).First();
                    OutputLog += $"Most accurate:\n  Neurons - {string.Join(", ", byAccuracy.HiddenNeurons.LayerDefinitions.Select(x => x.Neurons).ToArray())}\n  Average error - {byAccuracy.Error}\n";
                    var byNeurons = _benchmarkData.Select(x => x).OrderBy(x => x.HiddenNeurons.NeuronCount).First();
                    OutputLog += $"Least neurons:\n  Neurons - {string.Join(", ", byNeurons.HiddenNeurons.LayerDefinitions.Select(x => x.Neurons).ToArray())}\n  Average error - {byNeurons.Error}";
                }
                else
                {
                    OutputLog += "No stable networks generated.";
                }
                break;

            case ExitCodes.Cancelled:
                OutputLog += "Benchmark cancelled.\n";
                break;
            }

            _benchmarkData.Clear();
        }
コード例 #2
0
 private void OnBenchmarkComplete(BenchmarkCompleteArgs e) => BenchmarkComplete?.Invoke(this, e);