diff options
| author | schneefux <schneefux+commit@schneefux.xyz> | 2016-04-03 17:16:03 +0200 |
|---|---|---|
| committer | schneefux <schneefux+commit@schneefux.xyz> | 2016-04-03 17:16:03 +0200 |
| commit | 6f70c1a4e47b0bc96ed0ebcca0eb384a5dfdc2f4 (patch) | |
| tree | a34b4cc2100346f727199a3e7133c0cbbca3a68a /index.html | |
| parent | c285b7bea0301fea4694484cdbeeca6a2565d72c (diff) | |
| download | vortrag-knn-6f70c1a4e47b0bc96ed0ebcca0eb384a5dfdc2f4.tar.gz vortrag-knn-6f70c1a4e47b0bc96ed0ebcca0eb384a5dfdc2f4.zip | |
calculate and visualize network activation
Diffstat (limited to 'index.html')
| -rw-r--r-- | index.html | 33 |
1 files changed, 20 insertions, 13 deletions
@@ -120,7 +120,7 @@ var mocker = new WeightVisWrapper(); new VisIntegrater(function(c) { mocker.mock([3, 2, 1], function() { - mocker.openIn(c); + mocker.openIn(c, false); }); }, function(c) { mocker.remove(c); @@ -134,19 +134,26 @@ </div> <div class="visContainer"></div> + <p style="text-align: center; margin-top: 1.5em;">Berechneter MEDV-Wert: <span id="bsCalculated">lade…</span> - Erwarteter MEDV-Wert: <span id="bsExpected">lade…</span></p> <script type="text/javascript"> new VisIntegrater(function(c) { weightsWrapper.afterLoad(function() { - weightsWrapper.openIn(c); - var testRows = [400, 175, 454, 481, 476, 364, 377, 75, 103, 84, 458, 483]; - for(c=0; c<10; c++){ - //var row = testRows[Math.floor(Math.random()*testRows.length)]; - var row = Math.floor(Math.random()*bostonset.length()); - var inputs = bostonset.inputs(row); - console.log("calculated", bostonset.asOutput(weightsWrapper.activate(inputs)[0])); - console.log("real", bostonset.expectedOutput(row)); - } + weightsWrapper.jumpTo(weightsWrapper.steps()-1); + weightsWrapper.openIn(c, false); + var testRows = [400, 175, 454, 481, 476, 364, 377, 75, 103, 84, 458, 483]; // from original test data + var row = 0, + inputs =[]; + var calculated, expected; + do { + row = Math.floor(Math.random()*bostonset.length()); + inputs = bostonset.inputs(row); + calculated = bostonset.asOutput(weightsWrapper.calculate(inputs)[0]); + expected = bostonset.expectedOutput(row); + } while(Math.abs(calculated - expected) > 5); + d3.select("#bsCalculated").text(calculated.toString()); + d3.select("#bsExpected").text(expected.toString()); + weightsWrapper.activate(inputs); }); }, function(c) { weightsWrapper.remove(c); @@ -164,7 +171,7 @@ <script type="text/javascript"> new VisIntegrater(function(c) { errorVis.afterLoad(function() { - errorVis.openIn(c); + errorVis.openIn(c, true); errorVis.showMarker(203); }); }, function(c) { @@ -183,7 +190,7 @@ <script type="text/javascript"> new VisIntegrater(function(c) { weightsWrapper.afterLoad(function() { - weightsWrapper.openIn(c); + weightsWrapper.openIn(c, true); weightsWrapper.animate(10, 10); }); }, function(c) { @@ -202,7 +209,7 @@ <script type="text/javascript"> new VisIntegrater(function(c) { weightsWrapper.afterLoad(function() { - weightsWrapper.openIn(c); + weightsWrapper.openIn(c, true); weightsWrapper.animate(10, 10); }); }, function(c) { |
