I get it, thanx Nick!
Another question:
I've got a template class:
template<unsigned int NUM_INPUTS, unsigned int NUM_HIDDEN, unsigned int NUM_OUTPUTS>class nnet{public: nnet(); // mutates the network void mutate(float rate); // backpropagates one case through the network and returns the average output error float backprop(float inputs[NUM_INPUTS], float correctinput[NUM_INPUTS], float learningrate); // forward propagates one case through the network. void forwardprop(); // holds the inputs float inputs[NUM_INPUTS]; // holds the output values float outputs[NUM_OUTPUTS];private: // holds the values of the hidden neurons float hidden[NUM_HIDDEN]; // sigmoid function float sigmoid(float x); // deridative of sigmoid function float dsigmoid(float x); // holds the connection weights from input- to hidden neurons float icon[NUM_INPUTS][NUM_HIDDEN]; // holds the connection weights from hidden- to output neurons float hcon[NUM_HIDDEN][NUM_OUTPUTS]; // generates random float between -1 and 1 float myrandom();};
Somewhere else i have this code:
typedef nnet<65, 6, 3> T_MAINNET;// and somewhere elseT_MAINNET mainnet;mainnet.feedforward();
I get an error saying:
... .objs\martybot.o:martybot.cpp:(.text+0x7e): undefined reference to `nnet<65u, 6u, 3u>::forwardprop()'collect2: ld returned 1 exit status
I have no clue what's wrong... Can anyone help out?
Thanx!
Marty