From 96744a133f3d421cdfcd9d18dd5f74981475fd5f Mon Sep 17 00:00:00 2001 From: schneefux Date: Sat, 2 Apr 2016 21:33:19 +0200 Subject: integrate boston housing dataset and test values --- code/weightvis.js | 30 ++++++++++++++++++++++++++++-- 1 file changed, 28 insertions(+), 2 deletions(-) (limited to 'code/weightvis.js') diff --git a/code/weightvis.js b/code/weightvis.js index 64d398c..e3cec42 100644 --- a/code/weightvis.js +++ b/code/weightvis.js @@ -33,9 +33,9 @@ var nodeHighlightColor = accentColor ; - /* network construction */ +// TODO make multiple bias layers at positions > 0 possible? var Network = (function() { function Network(layout) { this.layout = layout; @@ -499,9 +499,35 @@ var NetVisualizer = (function() { me.attr("data-highlight", "true"); } }); - this.reposition(); }; + 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); } + var weights = this.data[this.layout.data.batches-1][this.layout.data.epochs-1]; + var lastLayerOut = inputs; + var hasBias = false; + if (this.layout.net[0].isBias) { + for (bias=0; bias