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


C# IExampleInterface.WriteLine方法代码示例

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


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

示例1: Execute

        public void Execute(IExampleInterface app)
        {
            this.app = app;

            // Create the neural network.
            BasicLayer hopfield;
            var network = new HopfieldNetwork(4);

            // This pattern will be trained
            bool[] pattern1 = {true, true, false, false};
            // This pattern will be presented
            bool[] pattern2 = {true, false, false, false};
            IMLData result;

            var data1 = new BiPolarMLData(pattern1);
            var data2 = new BiPolarMLData(pattern2);
            var set = new BasicMLDataSet();
            set.Add(data1);

            // train the neural network with pattern1
            app.WriteLine("Training Hopfield network with: "
                          + FormatBoolean(data1));

            network.AddPattern(data1);
            // present pattern1 and see it recognized
            result = network.Compute(data1);
            app.WriteLine("Presenting pattern:" + FormatBoolean(data1)
                          + ", and got " + FormatBoolean(result));
            // Present pattern2, which is similar to pattern 1. Pattern 1
            // should be recalled.
            result = network.Compute(data2);
            app.WriteLine("Presenting pattern:" + FormatBoolean(data2)
                          + ", and got " + FormatBoolean(result));
        }
开发者ID:JDFagan,项目名称:encog-dotnet-core,代码行数:34,代码来源:HopfieldSimple.cs

示例2: Execute

 public void Execute(IExampleInterface app)
 {
     this.app = app;
     IMLDataSet trainingSet = new BasicMLDataSet(XOR_INPUT, XOR_IDEAL);
     BasicNetwork network = EncogUtility.SimpleFeedForward(2, 6, 0, 1, false);
     EncogUtility.TrainToError(network, trainingSet, 0.01);
     double error = network.CalculateError(trainingSet);
     EncogDirectoryPersistence.SaveObject(new FileInfo(FILENAME), network);
     double error2 = network.CalculateError(trainingSet);
     app.WriteLine("Error before save to EG: " + Format.FormatPercent(error));
     app.WriteLine("Error before after to EG: " + Format.FormatPercent(error2));
 }
开发者ID:JDFagan,项目名称:encog-dotnet-core,代码行数:12,代码来源:PersistEncog.cs

示例3: Execute

 public void Execute(IExampleInterface app)
 {
     this.app = app;
     this.app = app;
     IMLDataSet trainingSet = new BasicMLDataSet(XOR_INPUT, XOR_IDEAL);
     BasicNetwork network = EncogUtility.SimpleFeedForward(2, 6, 0, 1, false);
     EncogUtility.TrainToError(network, trainingSet, 0.01);
     double error = network.CalculateError(trainingSet);
     SerializeObject.Save("encog.ser", network);
     network = (BasicNetwork) SerializeObject.Load("encog.ser");
     double error2 = network.CalculateError(trainingSet);
     app.WriteLine("Error before save to ser: " + Format.FormatPercent(error));
     app.WriteLine("Error before after to ser: " + Format.FormatPercent(error2));
 }
开发者ID:johannsutherland,项目名称:encog-dotnet-core,代码行数:14,代码来源:PersistSerial.cs

示例4: Execute

        public void Execute(IExampleInterface app)
        {
            this.app = app;

            var temp = new TemporalXOR();
            IMLDataSet trainingSet = temp.Generate(100);

            var jordanNetwork = (BasicNetwork) CreateJordanNetwork();
            var feedforwardNetwork = (BasicNetwork) CreateFeedforwardNetwork();

            double elmanError = TrainNetwork("Jordan", jordanNetwork, trainingSet);
            double feedforwardError = TrainNetwork("Feedforward", feedforwardNetwork, trainingSet);

            app.WriteLine("Best error rate with Jordan Network: " + elmanError);
            app.WriteLine("Best error rate with Feedforward Network: " + feedforwardError);
            app.WriteLine("Jordan will perform only marginally better than feedforward.\nThe more output neurons, the better performance a Jordan will give.");
        }
开发者ID:JDFagan,项目名称:encog-dotnet-core,代码行数:17,代码来源:JordanExample.cs

示例5: Execute

        public void Execute(IExampleInterface app)
        {
            this.app = app;

            var temp = new TemporalXOR();
            IMLDataSet trainingSet = temp.Generate(100);

            var elmanNetwork = (BasicNetwork) CreateElmanNetwork();
            var feedforwardNetwork = (BasicNetwork) CreateFeedforwardNetwork();

            double elmanError = TrainNetwork("Elman", elmanNetwork, trainingSet);
            double feedforwardError = TrainNetwork("Feedforward", feedforwardNetwork, trainingSet);

            app.WriteLine("Best error rate with Elman Network: " + elmanError);
            app.WriteLine("Best error rate with Feedforward Network: " + feedforwardError);
            app.WriteLine("(Elman should outperform feed forward)");
            app.WriteLine("If your results are not as good, try rerunning, or perhaps training longer.");
        }
开发者ID:tonyc2a,项目名称:encog-dotnet-core,代码行数:18,代码来源:ElmanExample.cs

示例6: Execute

        public void Execute(IExampleInterface app)
        {
            this.app = app;
            var pattern = new BoltzmannPattern();
            pattern.InputNeurons = NEURON_COUNT;
            var network = (BoltzmannMachine) pattern.Generate();

            CreateCities();
            CalculateWeights(network);

            network.Temperature = 100;
            do
            {
                network.EstablishEquilibrium();
                app.WriteLine(network.Temperature + " : " + DisplayTour(network.CurrentState));
                network.DecreaseTemperature(0.99);
            } while (!IsValidTour(network.CurrentState));

            app.WriteLine("Final Length: " + LengthOfTour(network.CurrentState));
        }
开发者ID:johannsutherland,项目名称:encog-dotnet-core,代码行数:20,代码来源:BoltzTSP.cs

示例7: Execute

        public void Execute(IExampleInterface app)
        {
            this.app = app;
            var pattern = new BAMPattern();
            pattern.F1Neurons = INPUT_NEURONS;
            pattern.F2Neurons = OUTPUT_NEURONS;
            var network = (BAMNetwork) pattern.Generate();

            // train
            for (int i = 0; i < NAMES.Length; i++)
            {
                network.AddPattern(
                    StringToBipolar(NAMES[i]),
                    StringToBipolar(PHONES[i]));
            }

            // test
            for (int i = 0; i < NAMES.Length; i++)
            {
                var data = new NeuralDataMapping(
                    StringToBipolar(NAMES[i]),
                    RandomBiPolar(OUT_CHARS*BITS_PER_CHAR));
                RunBAM(network, data);
            }

            app.WriteLine();

            for (int i = 0; i < PHONES.Length; i++)
            {
                var data = new NeuralDataMapping(
                    StringToBipolar(PHONES[i]),
                    RandomBiPolar(IN_CHARS*BITS_PER_CHAR));
                RunBAM(network, data);
            }

            app.WriteLine();

            for (int i = 0; i < NAMES.Length; i++)
            {
                var data = new NeuralDataMapping(
                    StringToBipolar(NAMES2[i]),
                    RandomBiPolar(OUT_CHARS*BITS_PER_CHAR));
                RunBAM(network, data);
            }
        }
开发者ID:johannsutherland,项目名称:encog-dotnet-core,代码行数:45,代码来源:BidirectionalAssociativeMemory.cs

示例8: Execute

        public void Execute(IExampleInterface app)
        {
            int inputNeurons = CHAR_WIDTH*CHAR_HEIGHT;
            int outputNeurons = DIGITS.Length;

            var pattern = new ADALINEPattern();
            pattern.InputNeurons = inputNeurons;
            pattern.OutputNeurons = outputNeurons;
            var network = (BasicNetwork) pattern.Generate();

            (new RangeRandomizer(-0.5, 0.5)).Randomize(network);

            // train it
            IMLDataSet training = GenerateTraining();
            IMLTrain train = new TrainAdaline(network, training, 0.01);

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

            //
            app.WriteLine("Error:" + network.CalculateError(training));

            // test it
            for (int i = 0; i < DIGITS.Length; i++)
            {
                int output = network.Winner(Image2data(DIGITS[i]));

                for (int j = 0; j < CHAR_HEIGHT; j++)
                {
                    if (j == CHAR_HEIGHT - 1)
                        app.WriteLine(DIGITS[i][j] + " -> " + output);
                    else
                        app.WriteLine(DIGITS[i][j]);
                }

                app.WriteLine();
            }
        }
开发者ID:JDFagan,项目名称:encog-dotnet-core,代码行数:43,代码来源:AdalineDigits.cs

示例9: Execute

        public void Execute(IExampleInterface app)
        {
            this.app = app;
            SetupInput();
            var pattern = new ART1Pattern();
            pattern.InputNeurons = INPUT_NEURONS;
            pattern.OutputNeurons = OUTPUT_NEURONS;
            var network = (ART1) pattern.Generate();


            for (int i = 0; i < PATTERN.Length; i++)
            {
                var dataIn = new BiPolarMLData(input[i]);
                var dataOut = new BiPolarMLData(OUTPUT_NEURONS);
                network.Compute(dataIn, dataOut);
                if (network.HasWinner)
                {
                    app.WriteLine(PATTERN[i] + " - " + network.Winner);
                }
                else
                {
                    app.WriteLine(PATTERN[i] + " - new Input and all Classes exhausted");
                }
            }
        }
开发者ID:jongh0,项目名称:MTree,代码行数:25,代码来源:ClassifyART1.cs


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