Encog.Neural.Networks.Training.Competitive.CompetitiveTraining.CompetitiveTraining C# (CSharp) Method

CompetitiveTraining() public method

Create an instance of competitive training.
public CompetitiveTraining ( BasicNetwork network, double learningRate, INeuralDataSet training, INeighborhoodFunction neighborhood ) : log4net
network BasicNetwork The network to train.
learningRate double The learning rate, how much to apply per iteration.
training INeuralDataSet The training set (unsupervised).
neighborhood INeighborhoodFunction The neighborhood function to use.
return log4net
        public CompetitiveTraining(BasicNetwork network,
                 double learningRate, INeuralDataSet training,
                 INeighborhoodFunction neighborhood)
        {
            this.neighborhood = neighborhood;
            Training = training;
            this.LearningRate = learningRate;
            this.network = network;
            this.inputLayer = network.GetLayer(BasicNetwork.TAG_INPUT);
            this.outputLayer = network.GetLayer(BasicNetwork.TAG_OUTPUT);
            this.synapses = network.Structure.GetPreviousSynapses(
                    this.outputLayer);
            this.inputNeuronCount = this.inputLayer.NeuronCount;
            this.outputNeuronCount = this.outputLayer.NeuronCount;
            this.ForceWinner = false;
            Error = 0;

            // setup the correction matrix
            foreach (ISynapse synapse in this.synapses)
            {
                Matrix matrix = new Matrix(synapse.WeightMatrix.Rows,
                       synapse.WeightMatrix.Cols);
                this.correctionMatrix[synapse] = matrix;
            }

            // create the BMU class
            this.bmuUtil = new BestMatchingUnit(this);
        }