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);
}