Here is my code (for a neuron in a MLP network):
double summation = 0;for (int i = 0; i < weights.length; i++) { summation += inputs[i] * weights[i];}double normalized = Math.tanh(summation);if (normalized > 0.9 || normalized < -0.9) { activated = 1;} else { activated = 0;}
I think it is incorrect. Is the output supposed to be the normalized value, or is it always limited to 0 or 1?