Beispiel #1
0
        /// <summary>
        /// Creates and returns a new instance of Multi Layer Perceptron </summary>
        /// <param name="layersStr"> space separated number of neurons in layers </param>
        /// <param name="transferFunctionType"> transfer function type for neurons </param>
        /// <returns> instance of Multi Layer Perceptron </returns>
        public static MultiLayerPerceptron createMLPerceptron(string layersStr, TransferFunctionType transferFunctionType)
        {
            List <int>           layerSizes = VectorParser.parseInteger(layersStr);
            MultiLayerPerceptron nnet       = new MultiLayerPerceptron(layerSizes, transferFunctionType);

            return(nnet);
        }
Beispiel #2
0
        /// <summary>
        /// Creates and returns a new instance of Multi Layer Perceptron </summary>
        /// <param name="layersStr"> space separated number of neurons in layers </param>
        /// <param name="transferFunctionType"> transfer function type for neurons </param>
        /// <returns> instance of Multi Layer Perceptron </returns>
        public static MultiLayerPerceptron createMLPerceptron(string layersStr, TransferFunctionType transferFunctionType, Type learningRule, bool useBias, bool connectIO)
        {
            List <int>           layerSizes       = VectorParser.parseInteger(layersStr);
            NeuronProperties     neuronProperties = new NeuronProperties(transferFunctionType, useBias);
            MultiLayerPerceptron nnet             = new MultiLayerPerceptron(layerSizes, neuronProperties);

            // set learning rule - TODO: use reflection here
//JAVA TO C# CONVERTER WARNING: The .NET Type.FullName property will not always yield results identical to the Java Class.getName method:
            if (learningRule.FullName.Equals(typeof(BackPropagation).FullName))
            {
                nnet.LearningRule = new BackPropagation();
            }
//JAVA TO C# CONVERTER WARNING: The .NET Type.FullName property will not always yield results identical to the Java Class.getName method:
            else if (learningRule.FullName.Equals(typeof(MomentumBackpropagation).FullName))
            {
                nnet.LearningRule = new MomentumBackpropagation();
            }
//JAVA TO C# CONVERTER WARNING: The .NET Type.FullName property will not always yield results identical to the Java Class.getName method:
            else if (learningRule.FullName.Equals(typeof(DynamicBackPropagation).FullName))
            {
                nnet.LearningRule = new DynamicBackPropagation();
            }
//JAVA TO C# CONVERTER WARNING: The .NET Type.FullName property will not always yield results identical to the Java Class.getName method:
            else if (learningRule.FullName.Equals(typeof(ResilientPropagation).FullName))
            {
                nnet.LearningRule = new ResilientPropagation();
            }

            // connect io
            if (connectIO)
            {
                nnet.connectInputsToOutputs();
            }

            return(nnet);
        }