Esempio n. 1
0
        public void TrainOnce()
        {
            this.TrainCount++;
            double[][] NeuralInput      = this.GetRandomImageSection(SegmentWidth, SegmentHeight);
            int        RandomColorIndex = (int)Math.Round(this.MyDNA.RandomGenerator.NextDouble() * 2);

            MyBrain.SetCurrentInput(NeuralInput[RandomColorIndex]);
            MyBrain.PropogateOutput();
            MyBrain.SetCurrentTraining(NeuralInput[RandomColorIndex]);
            MyBrain.BackPropogateWeightTraining();

            if ((this.UseStructureAlgorithm) && (this.TrainLeftTillStruct <= 0))
            {
                this.TrainLeftTillStruct = this.TrainStructPer;
                MyBrain.BackPropogateStructureTraining();
            }

            this.TrainLeftTillStruct--;
        }