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


C# BasicNetwork.Reset方法代码示例

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


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

示例1: Main

        static void Main(string[] args)
        {
            //create a neural network withtout using a factory
            var network = new BasicNetwork();
            network.AddLayer(new BasicLayer(null, true, 2));
            network.AddLayer(new BasicLayer(new ActivationSigmoid(), true, 2));
            network.AddLayer(new BasicLayer(new ActivationSigmoid(), false, 1));

            network.Structure.FinalizeStructure();
            network.Reset();

            IMLDataSet trainingSet = new BasicMLDataSet(XORInput, XORIdeal);
            IMLTrain train = new ResilientPropagation(network, trainingSet);

            int epoch = 1;
            do
            {
                train.Iteration();
                Console.WriteLine($"Epoch #{epoch} Error: {train.Error}");
                epoch++;
            } while (train.Error > 0.01);
            train.FinishTraining();

            Console.WriteLine("Neural Network Results:");
            foreach (IMLDataPair iPair in trainingSet)
            {
                IMLData output = network.Compute(iPair.Input);
                Console.WriteLine($"{iPair.Input[0]}, {iPair.Input[0]}, actual={output[0]}, ideal={iPair.Ideal[0]}");
            }

            EncogFramework.Instance.Shutdown();

            Console.ReadKey();
        }
开发者ID:zerazobz,项目名称:TestEncog,代码行数:34,代码来源:Program.cs

示例2: Main

        static void Main(string[] args)
        {
            var network = new BasicNetwork();
            network.AddLayer(new BasicLayer(null, true, 2));
            network.AddLayer(new BasicLayer(new ActivationSigmoid(), true, 3));
            network.AddLayer(new BasicLayer(new ActivationSigmoid(), false, 1));
            network.Structure.FinalizeStructure();
            network.Reset();

            var trainingSet = new BasicMLDataSet(XORInput, XORIdeal);
            var train = new ResilientPropagation(network, trainingSet);
            var epoch = 1;
            do
            {
                train.Iteration();

            } while (train.Error > 0.01);

            train.FinishTraining();

            foreach (var pair in trainingSet)
            {
                var output = network.Compute(pair.Input);
                Console.WriteLine(pair.Input[0] + @", " + pair.Input[1] + @" , actual=" + output[0] + @", ideal=" + pair.Ideal[0]);
            }

            EncogFramework.Instance.Shutdown();
            Console.ReadLine();
        }
开发者ID:akucherk,项目名称:HelloSystem,代码行数:29,代码来源:Program.cs

示例3: BenchmarkEncog

        public static long BenchmarkEncog(double[][] input, double[][] output)
        {
            BasicNetwork network = new BasicNetwork();
            network.AddLayer(new BasicLayer(null, true,
                    input[0].Length));
            network.AddLayer(new BasicLayer(new ActivationSigmoid(), true,
                    HIDDEN_COUNT));
            network.AddLayer(new BasicLayer(new ActivationSigmoid(), false,
                    output[0].Length));
            network.Structure.FinalizeStructure();
            network.Reset();

            IMLDataSet trainingSet = new BasicMLDataSet(input, output);

            // train the neural network
            IMLTrain train = new Backpropagation(network, trainingSet, 0.7, 0.7);

            Stopwatch sw = new Stopwatch();
            sw.Start();
            // run epoch of learning procedure
            for (int i = 0; i < ITERATIONS; i++)
            {
                train.Iteration();
            }
            sw.Stop();

            return sw.ElapsedMilliseconds;
        }
开发者ID:OperatorOverload,项目名称:encog-cs,代码行数:28,代码来源:SimpleBenchmark.cs

示例4: Execute

        /// <summary>
        /// Program entry point.
        /// </summary>
        /// <param name="app">Holds arguments and other info.</param>
        public void Execute(IExampleInterface app)
        {
            // create a neural network, without using a factory
            var network = new BasicNetwork();
            network.AddLayer(new BasicLayer(null, true, 2));
            network.AddLayer(new BasicLayer(new ActivationSigmoid(), true, 3));
            network.AddLayer(new BasicLayer(new ActivationSigmoid(), false, 1));
            network.Structure.FinalizeStructure();
            network.Reset();

            // create training data
            IMLDataSet trainingSet = new BasicMLDataSet(XORInput, XORIdeal);

            // train the neural network
            IMLTrain train = new ResilientPropagation(network, trainingSet);

            int epoch = 1;

            do
            {
                train.Iteration();
                Console.WriteLine(@"Epoch #" + epoch + @" Error:" + train.Error);
                epoch++;
            } while (train.Error > 0.01);

            // test the neural network
            Console.WriteLine(@"Neural Network Results:");
            foreach (IMLDataPair pair in trainingSet)
            {
                IMLData output = network.Compute(pair.Input);
                Console.WriteLine(pair.Input[0] + @"," + pair.Input[1]
                                  + @", actual=" + output[0] + @",ideal=" + pair.Ideal[0]);
            }
        }
开发者ID:johannsutherland,项目名称:encog-dotnet-core,代码行数:38,代码来源:XORHelloWorld.cs

示例5: Preprocessing_Completed

        private void Preprocessing_Completed(object sender, RunWorkerCompletedEventArgs e)
        {
            worker.ReportProgress(0, "Creating Network...");
            BasicNetwork Network = new BasicNetwork();
            Network.AddLayer(new BasicLayer(new ActivationSigmoid(), true, DataContainer.NeuralNetwork.Data.InputSize));
            Network.AddLayer(new BasicLayer(new ActivationSigmoid(), true, 50));
            Network.AddLayer(new BasicLayer(new ActivationSigmoid(), true, DataContainer.NeuralNetwork.Data.IdealSize));
            Network.Structure.FinalizeStructure();
            Network.Reset();
            DataContainer.NeuralNetwork.Network = Network;

            ResilientPropagation training = new ResilientPropagation(DataContainer.NeuralNetwork.Network, DataContainer.NeuralNetwork.Data);
            worker.ReportProgress(0, "Running Training: Epoch 0");
            for(int i = 0; i < 200; i++)
            {
                training.Iteration();
                worker.ReportProgress(0, "Running Training: Epoch " + (i+1).ToString() + "     Current Training Error : " + training.Error.ToString());
                if(worker.CancellationPending == true)
                {
                    completed = true;
                    return;
                }

            }
            completed = true;
        }
开发者ID:ebosscha,项目名称:RailML-Neural,代码行数:26,代码来源:PerLineClassification.cs

示例6: CreateNetwork

 /// <summary>
 /// Metodo responsavel por criar a rede neural
 /// </summary>
 /// <param name="source">FileInfo com o path do network</param>
 private static void CreateNetwork(FileInfo source)
 {
     var network = new BasicNetwork();
     network.AddLayer(new BasicLayer(new ActivationLinear(), true, 4));
     network.AddLayer(new BasicLayer(new ActivationTANH(), true, 6));
     network.AddLayer(new BasicLayer(new ActivationTANH(), false, 2));
     network.Structure.FinalizeStructure();
     network.Reset();
     EncogDirectoryPersistence.SaveObject(source, (BasicNetwork)network);
 }
开发者ID:itiroinazawa,项目名称:MachineLearning,代码行数:14,代码来源:ResilientPropagationClassification.cs

示例7: generateNetwork

 public BasicNetwork generateNetwork()
 {
     BasicNetwork network = new BasicNetwork();
     network.AddLayer(new BasicLayer(MultiThreadBenchmark.INPUT_COUNT));
     network.AddLayer(new BasicLayer(MultiThreadBenchmark.HIDDEN_COUNT));
     network.AddLayer(new BasicLayer(MultiThreadBenchmark.OUTPUT_COUNT));
     network.Structure.FinalizeStructure();
     network.Reset();
     return network;
 }
开发者ID:OperatorOverload,项目名称:encog-cs,代码行数:10,代码来源:MultiThreadBenchmark.cs

示例8: Create

 public void Create(int inputnodes,int hiddennodes)
 {
     network = new BasicNetwork();
     network.AddLayer(new BasicLayer(null, true, inputnodes));
     network.AddLayer(new BasicLayer(new ActivationTANH(), true, hiddennodes));
     network.AddLayer(new BasicLayer(new ActivationLinear(), false, 1));
     network.Structure.FinalizeStructure();
     network.Reset();
     this.hiddennodes = hiddennodes;
 }
开发者ID:bp1977,项目名称:MyEncog,代码行数:10,代码来源:NNet.cs

示例9: generateNetwork

 public BasicNetwork generateNetwork()
 {
     var network = new BasicNetwork();
     network.AddLayer(new BasicLayer(INPUT_COUNT));
     network.AddLayer(new BasicLayer(HIDDEN_COUNT));
     network.AddLayer(new BasicLayer(OUTPUT_COUNT));
     network.Structure.FinalizeStructure();
     network.Reset();
     return network;
 }
开发者ID:johannsutherland,项目名称:encog-dotnet-core,代码行数:10,代码来源:MultiThreadBenchmark.cs

示例10: CreateNetwork

 public static void CreateNetwork(FileOps fileOps)
 {
     var network = new BasicNetwork();
     network.AddLayer(new BasicLayer(new ActivationLinear(),true,4));
     network.AddLayer(new BasicLayer(new ActivationTANH(), true, 6));
     network.AddLayer(new BasicLayer(new ActivationTANH(), true, 2));
     network.Structure.FinalizeStructure();
     network.Reset();
     EncogDirectoryPersistence.SaveObject(fileOps.TrainedNeuralNetworkFile, network);
 }
开发者ID:MacarioTala,项目名称:Learning-Machine-Learning,代码行数:10,代码来源:Program.cs

示例11: CreateNetwork

 private static BasicNetwork CreateNetwork()
 {
     var network = new BasicNetwork();
     network.AddLayer(new BasicLayer(null, true, 2));
     network.AddLayer(new BasicLayer(new ActivationSigmoid(), true, 2));
     network.AddLayer(new BasicLayer(new ActivationSigmoid(), false, 1));
     network.Structure.FinalizeStructure();
     network.Reset();
     return network;
 }
开发者ID:nmukh,项目名称:neural-networks,代码行数:10,代码来源:XOR-Demo.cs

示例12: createElliott

 public static BasicNetwork createElliott()
 {
     BasicNetwork network = new BasicNetwork();
     network.AddLayer(new BasicLayer(null, true, INPUT_OUTPUT));
     network.AddLayer(new BasicLayer(new ActivationElliottSymmetric(), true, HIDDEN));
     network.AddLayer(new BasicLayer(new ActivationElliottSymmetric(), false, INPUT_OUTPUT));
     network.Structure.FinalizeStructure();
     network.Reset();
     return network;
 }
开发者ID:fxmozart,项目名称:encog-dotnet-core,代码行数:10,代码来源:ElliottBenchmark.cs

示例13: PSO

        public PSO()
        {
            network = new BasicNetwork();
            network.AddLayer(new BasicLayer(5));
            network.AddLayer(new BasicLayer(1));
            network.AddLayer(new BasicLayer(1));
            network.Structure.FinalizeStructure();
            network.Reset();

            IMLDataSet dataSet = new BasicMLDataSet();
            dataSet.Add(new BasicMLData(new double[] { 1.0, 4.0, 3.0, 4.0, 5.0}) , new BasicMLData(new double[] { 2.0, 4.0, 6.0 , 8.0, 10} ));
            
            train = new NeuralPSO(network, new RangeRandomizer(0, 10), new TrainingSetScore(dataSet),5);
            
        }
开发者ID:ifzz,项目名称:QuantSys,代码行数:15,代码来源:PSO.cs

示例14: Generate

 public IMLMethod Generate()
 {
     BasicLayer layer;
     BasicLayer layer2;
     BasicNetwork network = new BasicNetwork();
     if ((0 != 0) || (0 == 0))
     {
         network.AddLayer(layer2 = new BasicLayer(this._x2a5a4034520336f3, true, this._xcfe830a7176c14e5));
     }
     network.AddLayer(layer = new BasicLayer(this._x2a5a4034520336f3, true, this._xdf89f9cf9fc3d06f));
     network.AddLayer(new BasicLayer(null, false, this._x8f581d694fca0474));
     layer2.ContextFedBy = layer;
     network.Structure.FinalizeStructure();
     network.Reset();
     return network;
 }
开发者ID:neismit,项目名称:emds,代码行数:16,代码来源:ElmanPattern.cs

示例15: Experiment

        public static void Experiment()
        {
            BasicNetwork net = new BasicNetwork();

            net.AddLayer(
                new BasicLayer(new ActivationLinear(), false, 3));

            net.AddLayer(
                new BasicLayer(new ActivationTANH(), true, 3));

            net.AddLayer(
                new BasicLayer(new ActivationLinear(), false, 2));

            net.Structure.FinalizeStructure();
            //Задание случайных весов?
            net.Reset();
        }
开发者ID:neismit,项目名称:emds,代码行数:17,代码来源:Program.cs


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