Category : C++ Source Code
Archive   : NEURCSP.ZIP
Filename : CONNECTI.CPP
Output of file : CONNECTI.CPP contained in archive : NEURCSP.ZIP
#include
#include
void Connection::adjust(void)
{
//If samad Coefficient == 0 this is "classic" backprop
//If samad Coefficient == 1 this is original "fast backprop"
//If samad Coefficient is something else, you will usually get significant
//changes in learning rate. The range 0.5 - 2.0 seems to work well
delta = learningConstant * n2->error * (n1->output + samadCoefficient * n1->error) + delta * momentum;
weight += delta;
}
void Connection::displaySelf(void)
{
cout<<"Connection delta: "<
void Connection::feedForward(void)
{
n2->input += n1->output * weight;
}
void Connection::set(Neuron* nLow, Neuron* nHigh)
{
n1 = nLow;
n2 = nHigh;
}
void Connection::setRandom(float lC, float m, float sC)
{
weight = (((float)rand()/RAND_MAX) - 0.5) / 5;
delta = 0;
learningConstant = lC;
momentum = m;
samadCoefficient = sC;
}
int Connection::firstNeuronIs(Neuron* n)
{
if(n == n1)
return 1;
else
return 0;
}
int Connection::secondNeuronIs(Neuron* n)
{
if(n == n2)
return 1;
else
return 0;
}
Very nice! Thank you for this wonderful archive. I wonder why I found it only now. Long live the BBS file archives!
This is so awesome! 😀 I’d be cool if you could download an entire archive of this at once, though.
But one thing that puzzles me is the “mtswslnkmcjklsdlsbdmMICROSOFT” string. There is an article about it here. It is definitely worth a read: http://www.os2museum.com/wp/mtswslnk/