From e1e13fcc21c126e4434cbdbc1ca979e5f35ea5dd Mon Sep 17 00:00:00 2001 From: "Martin M. S. Pedersen" Date: Mon, 10 Jun 2019 19:57:07 +0200 Subject: [PATCH] Add relu activation function --- lib/nn.js | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/lib/nn.js b/lib/nn.js index 0cb4527..4e61c92 100644 --- a/lib/nn.js +++ b/lib/nn.js @@ -17,6 +17,11 @@ let tanh = new ActivationFunction( y => 1 - (y * y) ); +let tanh = new ActivationFunction( + x => (x<0)?0:x, + y => (x<0)?0:1 +); + class NeuralNetwork { /*