I have defined the following class:
public class PerceptronNetwork : NetworkBase
{
Neuron perceptron { get; set; }
public PerceptronTrainer trainingMethod;
public PerceptronNetwork(Neuron aNeuron)
{
this.perceptron = aNeuron;
}
public double train(TrainingTemplate trainingTemplate, int extMaxGenerations)
{
// This is simple but the ideea is suposed to be that in larger networks here
// I do a foreach over the neurons
double error = this.trainingMethod.trainNetwork(trainingTemplate, perceptron,
extMaxGenerations);
return error;
}
}
Whenever I try to use the train method from my main function I get the error
Object reference not set to an instance of an object.
pointing to the perceptron
object.
Despite that when I hover over every object in the function call trainingTemplate, perceptron and extMaxGenerations they all seem to be pointing to proper values.
Did I declare or instantiate them wrong in some way ?