Пример #1
0
        /// <summary>
        /// Creates  and returns a new instance of Perceptron network
        /// </summary>
        /// <param name="inputNeuronsCount">number of neurons in input layer</param>
        /// <param name="outputNeuronsCount">number of neurons in output layer</param>
        /// <param name="transferFunctionType">type of transfer function to use</param>
        /// <param name="learningRule">learning rule class</param>
        /// <returns>instance of Perceptron network</returns>
        public static Perceptron CreatePerceptron(int inputNeuronsCount, int outputNeuronsCount, TransferFunctionType transferFunctionType, Type learningRule)
        {
            Perceptron nnet = new Perceptron(inputNeuronsCount, outputNeuronsCount, transferFunctionType);

            if (learningRule.Name.Equals(typeof(PerceptronLearning).Name))
            {
                nnet.LearningRule = new PerceptronLearning();
            }
            else if (learningRule.Name.Equals(typeof(BinaryDeltaRule).Name))
            {
                nnet.LearningRule = new BinaryDeltaRule();
            }

            return nnet;
        }
Пример #2
0
 /// <summary>
 /// Creates  and returns a new instance of Perceptron network
 /// </summary>
 /// <param name="inputNeuronsCount">number of neurons in input layer</param>
 /// <param name="outputNeuronsCount">number of neurons in output layer</param>
 /// <param name="transferFunctionType">type of transfer function to use</param>
 /// <returns>instance of Perceptron network</returns>
 public static Perceptron CreatePerceptron(int inputNeuronsCount, int outputNeuronsCount, TransferFunctionType transferFunctionType)
 {
     Perceptron nnet = new Perceptron(inputNeuronsCount, outputNeuronsCount, transferFunctionType);
     return nnet;
 }