当前位置: 首页>>代码示例>>C#>>正文


C# BasicNetwork.CalculateError方法代码示例

本文整理汇总了C#中Encog.Neural.Networks.BasicNetwork.CalculateError方法的典型用法代码示例。如果您正苦于以下问题:C# BasicNetwork.CalculateError方法的具体用法?C# BasicNetwork.CalculateError怎么用?C# BasicNetwork.CalculateError使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在Encog.Neural.Networks.BasicNetwork的用法示例。


在下文中一共展示了BasicNetwork.CalculateError方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。

示例1: EvaluateMPROP

 public double EvaluateMPROP(BasicNetwork network, IMLDataSet data)
 {
     var train = new ResilientPropagation(network, data);
     long start = DateTime.Now.Ticks;
     Console.WriteLine(@"Training 20 Iterations with MPROP");
     for (int i = 1; i <= 20; i++)
     {
         train.Iteration();
         Console.WriteLine("Iteration #" + i + " Error:" + train.Error);
     }
     //train.finishTraining();
     long stop = DateTime.Now.Ticks;
     double diff = new TimeSpan(stop - start).Seconds;
     Console.WriteLine("MPROP Result:" + diff + " seconds.");
     Console.WriteLine("Final MPROP error: " + network.CalculateError(data));
     return diff;
 }
开发者ID:Romiko,项目名称:encog-dotnet-core,代码行数:17,代码来源:MultiThreadBenchmark.cs

示例2: Evaluate

 public double Evaluate(BasicNetwork network, IMLDataSet training)
 {
     var rprop = new ResilientPropagation(network, training);
     double startingError = network.CalculateError(training);
     for (int i = 0; i < ITERATIONS; i++)
     {
         rprop.Iteration();
     }
     double finalError = network.CalculateError(training);
     return startingError - finalError;
 }
开发者ID:tonyc2a,项目名称:encog-dotnet-core,代码行数:11,代码来源:WeightInitialization.cs

示例3: Train

        public void Train()
        {
            TrainingErrorData.Clear();
            TestingIdealData.Clear();
            TestingResultsData.Clear();
            _network = ConstructNetwork(TrainingSet.InputSize,TrainingSet.IdealSize);

            //var trainer = new Backpropagation(_network, TrainingSet, LearningRate, Momentum);
            var trainer = new ResilientPropagation(_network, TrainingSet);
            double[] resultsArray = new double[TrainingSet.Count];
            double[] errorArray = new double[NumberOfIterations];
            IsBusy = true;
            for (int iteration = 0; iteration < numberOfIterations; iteration++)
            {
                trainer.Iteration();
                TrainingErrorData.Add(new Tuple<int,double>(iteration, trainer.Error));
            }
            IsBusy = false;
            for(int i = 0; i < TrainingSet.Count; i++)
            {
               resultsArray[i] = _network.Classify(TrainingSet[i].Input);
            }
            TrainingErrorValue = _network.CalculateError(TrainingSet);
            Stage = Stage.Trained;
        }
开发者ID:JGrzybowski,项目名称:NeuralNetworksSmallProject,代码行数:25,代码来源:MainWindowViewModel.cs


注:本文中的Encog.Neural.Networks.BasicNetwork.CalculateError方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。