55 enum weightInitMethod { W_ZEROS = 0, W_ONES = 1, W_RANDOM = 2, W_ONES_NORM = 3, W_RANDOM_NORM = 5, };
62 enum actMethod {Act_Sigmoid = 1, Act_Tanh = 2, Act_ReLU = 3, Act_NONE = 0};
69 enum whichError {onBackwardError = 0, onMidError = 1, onForwardError = 2};
80 void initNeuron(
int _neuronIndex,
int _layerIndex, weightInitMethod _wim, biasInitMethod _bim, actMethod _am);
85 void setLearningRate(
double _learningRate,
double _b_learningRate);
92 void setInput(
int _index,
double _value);
99 void propInputs(
int _index,
double _value);
106 int calcOutput(
int _layerHasReported);
112 void setError(
double _value);
123 void updateWeights();
133 return (1/(1+(exp(-sum)))) - 0.5;
137 if (sum > 0)
return sum;
else return 0;
152 return 1 * (0.5 + doActivation(input)) * (0.5 - doActivation(input));
154 return 1 - pow (tanh(input), 2);
156 if (sum > 0)
return 1;
else return 0;
168 error = doActivationPrime(getSumOutput()) * upstreamDeltaErrorSum;
192 double getWeights(
int _inputIndex);
199 double getInitWeights(
int _inputIndex);
205 double getWeightChange();
235 double getWeightDistance();
259 assert((_index >= 0) && (_index < nInputs));
260 weights[_index] = _weight;
266 int myLayerIndex = 0;
267 int myNeuronIndex = 0;
268 double *initialWeights = 0;
270 double w_learningRate = 0;
271 double b_learningRate = 0;
273 int iHaveReported = 0;
280 double backwardsCoeff = 0;
282 double forwardCoeff = 0;
283 double globalCoeff = 0;
286 double weightSum = 0;
287 double maxWeight = 1;
288 double minWeight = 1;
289 double weightChange=0;
290 double weightsDifference = 0;