From c285b7bea0301fea4694484cdbeeca6a2565d72c Mon Sep 17 00:00:00 2001 From: schneefux Date: Sun, 3 Apr 2016 16:29:07 +0200 Subject: f*ck jsperf's crappy sigmoid implementation --- code/weightvis.js | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) (limited to 'code/weightvis.js') diff --git a/code/weightvis.js b/code/weightvis.js index e3cec42..f61ec39 100644 --- a/code/weightvis.js +++ b/code/weightvis.js @@ -504,7 +504,7 @@ var NetVisualizer = (function() { NetVisualizer.prototype.activate = function(inputs) { // assumes the sigmoid function is used as activation - function activation(x) { return 0.5 + x / Math.sqrt(1 + 4 * x * x); } + function activation(x) { return 1 / (1 + Math.exp(-x)); } var weights = this.data[this.layout.data.batches-1][this.layout.data.epochs-1]; var lastLayerOut = inputs; var hasBias = false; @@ -525,6 +525,7 @@ var NetVisualizer = (function() { thisLayerOut[tar] = activation(thisLayerOut[tar]); } lastLayerOut = thisLayerOut; + //console.log("layer out", layer, lastLayerOut); } return lastLayerOut; }; -- cgit v1.3.1