Esempio n. 1
0
        protected const int MAX_EPOCHS = 1000;          //Limiting the number of iterations in the process.


        /*
         * CONSTRUCTORS
         */
        public NeuralNetwork(DataSetReader dataSet, double[] target, double bias, double eta)
        {
            this.target      = target;
            this.data        = dataSet.data;
            this.featureMask = VectorTools.sequence(dataSet.features);
            this.classMask   = VectorTools.sequence(dataSet.classes);
            this.weight      = VectorTools.ones(this.featureMask.Length + 1);        //+1 for bias.
            this.samples     = dataSet.samples;
            this.eta         = eta;
            this.bias        = bias;
        }
Esempio n. 2
0
        public NeuralNetwork(DataSetReader dataSet, double[] target, double eta, double bias, double[] featureMask, double[] classMask)
        {
            if (featureMask.Length > dataSet.features || featureMask.Length < 1)
            {
                throw new ArgumentOutOfRangeException("Number of features specified is not applicable");
            }

            this.target      = target;
            this.data        = dataSet.data;
            this.featureMask = featureMask;
            this.classMask   = classMask;
            this.weight      = VectorTools.ones(this.featureMask.Length + 1);        //+1 for bias.
            this.samples     = dataSet.samples;
            this.eta         = eta;
            this.bias        = bias;
        }