コード例 #1
0
        protected void Application_Start()
        {
            GlobalConfiguration.Configure(WebApiConfig.Register);
            BasicFeedForwardNeuralNetwork neuralNetwork = new BasicFeedForwardNeuralNetwork(2, 5, 1);

            // Target values are initially set to represent the AND operator
            Double[,] targetValues = new Double[4, 1]
            {
                { 0.0 },
                { 0.0 },
                { 0.0 },
                { 1.0 }
            };
            Application.Add("NeuralNetwork", neuralNetwork);
            Application.Add("TargetValues", targetValues);
        }
        /// <include file='InterfaceDocumentationComments.xml' path='doc/members/member[@name="M:BackPropagationVisualization.Models.IFeedForwardNeuralNetwork.Train(System.Double[0:,0:],System.Double[0:,0:],System.Double,System.Int32,System.Int32,System.Boolean)"]/*'/>
        public void Train(double[,] trainingData, double[,] targetValues, double learningRate, int batchSize, int numberOfEpochs, bool keepCostHistory)
        {
            BasicFeedForwardNeuralNetwork neuralNetwork = GetNeuralNetworkFromApplication();

            neuralNetwork.Train(trainingData, targetValues, learningRate, batchSize, numberOfEpochs, keepCostHistory);
        }