예제 #1
0
        /// <summary>
        /// Feeds specified neural network with data from InputAdapter and writes
        /// output using OutputAdapter </summary>
        /// <param name="neuralNet"> neural network </param>
        /// <param name="in"> input data source </param>
        /// <param name="out"> output data target   </param>
        public static void process(NeuralNetwork neuralNet, InputAdapter @in, OutputAdapter @out)
        {
            double[] input;
            while ((input = @in.readInput()) != null)
            {
                neuralNet.Input = input;
                neuralNet.calculate();
                double[] output = neuralNet.Output;
                @out.writeOutput(output);
            }

            @in.close();
            @out.close();
        }