summaryrefslogtreecommitdiff
path: root/index.html
blob: 7bc74747ee4fe3735794b9e91e622a6d1394a808 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
<!DOCTYPE html>
<html lang="de">
<head>
    <meta charset="UTF-8">
    <title></title>
    <link rel="stylesheet" href="index.css">
    <link rel="stylesheet" href="dep/material-icons.css">
    <link rel="stylesheet" href="dep/material.deep_purple-blue.min.css">
</head>
<body>
    <script src="dep/d3.js" type="text/javascript"></script>
    <script src="dep/material.min.js"></script>
    <script src="dep/impress.js"></script>

    <script src="code/weightvis.js" type="text/javascript"></script>
    <script src="code/weightviswrapper.js" type="text/javascript"></script>
    <script src="code/errorvis.js" type="text/javascript"></script>
    <script src="code/bostonset.js" type="text/javascript"></script>

    <script type="text/javascript">
        var weightsWrapper = new WeightVisWrapper();
        var errorVis = new ErrorVis();
        var bostonset = new Bostonset();

        document.addEventListener("DOMContentLoaded", function() {
            impress().init();

            d3.selectAll(".visContainer")[0].forEach(function(el) {
                weightsWrapper.addPlaceholder(el.parentNode);
            });
            weightsWrapper.load("data/weights.json", function() {
                weightsWrapper.reposition();
            });

            d3.selectAll(".errorContainer")[0].forEach(function(el) {
                errorVis.addPlaceholder(el.parentNode);
            });
            errorVis.load("data/error.json", function() {});

            bostonset.load("data/boston.csv");

            sizeSlides();
        }, false);

        /* responsive deck */
        function sizeSlides() {
            d3.selectAll(".slide")
                .style("width", parseInt(window.innerWidth) * 0.9 + "px")
                .style("height", parseInt(window.innerHeight) * 0.9 + "px");
        };
        window.addEventListener("resize", sizeSlides);

        document.addEventListener("impress:innerstep", function(e) {
            d3.selectAll(".lastInnerstep")[0].forEach(function(ist) { ist.classList.remove("lastInnerstep"); });
            var stepped = d3.select(e.target).selectAll(".stepped")[0];
            stepped[stepped.length-1].classList.add("lastInnerstep");
        });
    </script>

    <div id="impress">
        <div class="mdl-layout mdl-js-layout step slide" data-x="0" data-y="0" data-z="5000">
            <h1 class="mdl-layout__header">Künstliche neuronale Netze</h1>
            <h2>38 Gewichte in 20 Minuten</h2>
        </div>

        <div class="mdl-layout mdl-js-layout step slide" data-x="-1000" data-y="0" data-z="1000">
            <h1 class="mdl-layout__header">Biologie</h1>
            <div class="innerStep stepped lastInnerstep center">
                <h3>Der Mensch und die Maschine.</h3>
                <p style="font-size: 2500%">
                    <i style="font-size: 100%;" class="material-icons">accessibility</i>
                    šŸ–„
                </p>
            </div>
            <div class="innerStep center">
                <h3>Wahrnehmung</h3>
                <p>
                    <i style="font-size: 800%;" class="material-icons">remove_red_eye</i>
                </p>
                <p>
                    <span style="font-size: 500%;">Rezeptor</span>
                </p>
            </div>
            <div class="innerStep center">
                <h3>Reaktion.</h3>
                <p>
                    <i style="font-size: 2500%;" class="material-icons">directions_walk</i>
                </p>
                <p>
                    <span style="font-size: 500%;">Effektor</span>
                </p>
            </div>
        </div>

        <div class="mdl-layout mdl-js-layout step slide" data-x="0" data-y="0" data-z="1000">
            <h1 class="mdl-layout__header">Abstraktion eines Individuums</h1>
            <p class="innerStep stepped lastInnerstep center" style="font-size: 500%;">
                Wahrnehmung &#x279e; 
                <i style="font-size: 100%;" class="material-icons">help_outline</i>
                &#x279e; Reaktion
            </p>
            <p class="innerStep center" style="font-size: 500%;">
                Eingabe &#x279e; &#x2728; &#x279e; Ausgabe
            </p>
        </div>

        <!-- TODO x' besser verteilen -->
        <div class="mdl-layout mdl-js-layout step slide" data-x="1000" data-y="0" data-z="1000">
            <h1 class="mdl-layout__header">Abstraktion der Ein- und Ausgabe</h1>
        </div>

        <div class="step slide mdl-layout mdl-js-layout" data-x="9500" data-y="0" data-z="1000">
            <div class="mdl-layout__header">
                <h2>Ein leeres Netz</h2>
            </div>

            <div class="visContainer"></div>

            <script type="text/javascript">
                var mocker = new WeightVisWrapper();
                new VisIntegrater(function(c) {
                    mocker.mock([3, 2, 1], function() {
                        mocker.openIn(c, false);
                    });
                }, function(c) {
                    mocker.remove(c);
                }, ".visContainer");
            </script>
        </div>

        <div class="step slide mdl-layout mdl-js-layout" data-x="3000" data-y="0" data-z="1000">
            <div class="mdl-layout__header">
                <h2>Aktivierungstest</h2>
            </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.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);
                }, ".visContainer");
            </script>
        </div>

        <div class="step slide mdl-layout mdl-js-layout" data-x="2000" data-y="0" data-z="1000">
            <div class="mdl-layout__header">
                <h2>Der Fehler im Verlauf</h2>
            </div>

            <div class="errorContainer"></div>

            <script type="text/javascript">
                new VisIntegrater(function(c) {
                    errorVis.afterLoad(function() {
                        errorVis.openIn(c, true);
                        errorVis.showMarker(203);
                    });
                }, function(c) {
                    errorVis.remove(c);
                }, ".errorContainer");
            </script>
        </div>

        <div class="step slide mdl-layout mdl-js-layout" data-x="0" data-y="1000">
            <div class="mdl-layout__header">
                <h2>Die Gewichte im Verlauf</h2>
            </div>

            <div class="visContainer"></div>

            <script type="text/javascript">
                new VisIntegrater(function(c) {
                    weightsWrapper.afterLoad(function() {
                        weightsWrapper.openIn(c, true);
                        weightsWrapper.animate(10, 10);
                    });
                }, function(c) {
                    weightsWrapper.remove(c);
                }, ".visContainer");
            </script>
        </div>

        <div class="step slide mdl-layout mdl-js-layout" data-x="2000" data-y="1000">
            <div class="mdl-layout__header">
                <h2>Gewichte und Fehler</h2>
            </div>

            <div class="visContainer"></div>

            <script type="text/javascript">
                new VisIntegrater(function(c) {
                    weightsWrapper.afterLoad(function() {
                        weightsWrapper.openIn(c, true);
                        weightsWrapper.animate(10, 10);
                    });
                }, function(c) {
                    weightsWrapper.remove(c);
                }, ".visContainer");
            </script>
        </div>
    </div>
</body>
</html>