private INeuronWeights GenerateWeights(uint passedNumberOfWeights) { IList <INeuronWeight> WeightsList = new List <INeuronWeight>((int)passedNumberOfWeights); for (int i = 0; i < passedNumberOfWeights; i++) { WeightsList.Add(CreateRandomNeuronWeight()); } INeuronWeights result = new NeuronWeights(WeightsList); return(result); }
public void Teach(bool result) { if (result == false) { for (var y = 0; y <= NeuronWeights.GetUpperBound(1); y++) { for (var x = 0; x <= NeuronWeights.GetUpperBound(0); x++) { NeuronWeights[x, y] += InputData[x, y]; } } } else { for (var y = 0; y <= NeuronWeights.GetUpperBound(1); y++) { for (var x = 0; x <= NeuronWeights.GetUpperBound(0); x++) { NeuronWeights[x, y] -= InputData[x, y]; } } } }