From c116d4b6c589e1a134c433728f6470b86625e0fe Mon Sep 17 00:00:00 2001 From: kwichmann Date: Wed, 28 Feb 2018 01:34:46 +0100 Subject: [PATCH] =?UTF-8?q?ReLU=20-=20ze=20french=20activation=20f=C3=BCnc?= =?UTF-8?q?tion=20-=20added?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- lib/nn.js | 4 ++++ 1 file changed, 4 insertions(+) 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) {