home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
World of Shareware - Software Farm 2
/
wosw_2.zip
/
wosw_2
/
CPROG
/
AI-90-10.ZIP
/
NEURON.CPP
< prev
next >
Wrap
Text File
|
1990-10-01
|
404b
|
24 lines
#include "neural.hpp"
#include <math.h>
Neuron::Neuron(void)
{
input = 0;
output = 0;
error = 0;
}
void Neuron::transfer(void)
{
//This is the "classic" transfer function.
output = 1 / (1 + exp(-1 * M_FACTOR * input));
}
float Neuron::derivTransfer(float weightedSumOfErrors)
{
error = output * (1 - output) * weightedSumOfErrors;
return error;
}