diff --git a/lib/nn.js b/lib/nn.js index 5cce746..327a4eb 100644 --- a/lib/nn.js +++ b/lib/nn.js @@ -17,6 +17,10 @@ let tanh = new ActivationFunction( y => 1-(y*y) ); +let ReLU = new ActivationFunction( + x => Math.max(0, x), + y => Math.sign(y) +); class NeuralNetwork { constructor(input_nodes, hidden_nodes, output_nodes) {