-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathindex.html
357 lines (336 loc) · 15.7 KB
/
index.html
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
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
<!doctype html>
<!-- Copyright 2016 Google Inc. All Rights Reserved.
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.
==============================================================================-->
<html>
<head lang="en">
<link rel="icon" type="image/png" href="favicon.png">
<meta charset="utf-8">
<meta name="viewport" content="width=1024">
<meta name="keywords" content="neural networks,machine learning,javascript">
<meta property="og:type" content="article"/>
<meta property="og:title" content="Tensorflow — Neural Network Playground"/>
<meta property="og:description" content="Tinker with a real neural network right here in your browser.">
<meta property="og:url" content="http://playground.tensorflow.org"/>
<meta property="og:image" content="http://playground.tensorflow.org/preview.png"/>
<meta name="twitter:card" value="summary_large_image">
<meta name="twitter:title" content="Tensorflow — Neural Network Playground">
<meta name="twitter:description" content="Tinker with a real neural network right here in your browser.">
<meta name="twitter:url" content="http://playground.tensorflow.org">
<meta name="twitter:image" content="http://playground.tensorflow.org/preview.png">
<meta name="twitter:image:width" content="560">
<meta name="twitter:image:height" content="295">
<meta name="author" content="Daniel Smilkov and Shan Carter">
<title>Rules playground</title>
<link rel="stylesheet" href="bundle.css" type="text/css">
<link href="https://fonts.googleapis.com/css?family=Roboto:300,400,500|Material+Icons" rel="stylesheet" type="text/css">
<script src="lib.js"></script>
</head>
<body>
<!-- GitHub link -->
<a class="github-link" href="https://github.com/tensorflow/playground" title="Source on GitHub" target="_blank">
<svg xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" viewBox="0 0 60.5 60.5" width="60" height="60">
<polygon class="bg" points="60.5,60.5 0,0 60.5,0 "/>
<path class="icon" d="M43.1,5.8c-6.6,0-12,5.4-12,12c0,5.3,3.4,9.8,8.2,11.4c0.6,0.1,0.8-0.3,0.8-0.6c0-0.3,0-1,0-2c-3.3,0.7-4-1.6-4-1.6c-0.5-1.4-1.3-1.8-1.3-1.8c-1.1-0.7,0.1-0.7,0.1-0.7c1.2,0.1,1.8,1.2,1.8,1.2c1.1,1.8,2.8,1.3,3.5,1c0.1-0.8,0.4-1.3,0.8-1.6c-2.7-0.3-5.5-1.3-5.5-5.9c0-1.3,0.5-2.4,1.2-3.2c-0.1-0.3-0.5-1.5,0.1-3.2c0,0,1-0.3,3.3,1.2c1-0.3,2-0.4,3-0.4c1,0,2,0.1,3,0.4c2.3-1.6,3.3-1.2,3.3-1.2c0.7,1.7,0.2,2.9,0.1,3.2c0.8,0.8,1.2,1.9,1.2,3.2c0,4.6-2.8,5.6-5.5,5.9c0.4,0.4,0.8,1.1,0.8,2.2c0,1.6,0,2.9,0,3.3c0,0.3,0.2,0.7,0.8,0.6c4.8-1.6,8.2-6.1,8.2-11.4C55.1,11.2,49.7,5.8,43.1,5.8z"/>
</svg>
</a>
<!-- Header -->
<header>
<h1 class="l--page"> <img width=60% src="https://csinva.io/imodels/img/imodels_logo.svg?sanitize=True"/> <br/> Demos of rule-based models.</h1>
</header>
<!-- Top Controls -->
<div id="top-controls">
<div class="container l--page">
<div class="timeline-controls">
<button class="mdl-button mdl-js-button mdl-button--icon ui-resetButton" id="reset-button" title="Reset the network">
<i class="material-icons">replay</i>
</button>
<button class="mdl-button mdl-js-button mdl-button--fab mdl-button--colored ui-playButton" id="play-pause-button" title="Run/Pause">
<i class="material-icons">play_arrow</i>
<i class="material-icons">pause</i>
</button>
<button class="mdl-button mdl-js-button mdl-button--icon ui-stepButton" id="next-step-button" title="Step">
<i class="material-icons">skip_next</i>
</button>
</div>
<div class="control">
<span class="label">Epoch</span>
<span class="value" id="iter-number"></span>
</div>
<div class="control ui-learningRate">
<label for="learningRate">Learning rate</label>
<div class="select">
<select id="learningRate">
<option value="0.00001">0.00001</option>
<option value="0.0001">0.0001</option>
<option value="0.001">0.001</option>
<option value="0.003">0.003</option>
<option value="0.01">0.01</option>
<option value="0.03">0.03</option>
<option value="0.1">0.1</option>
<option value="0.3">0.3</option>
<option value="1">1</option>
<option value="3">3</option>
<option value="10">10</option>
</select>
</div>
</div>
<div class="control ui-activation">
<label for="activations">Activation</label>
<div class="select">
<select id="activations">
<option value="relu">ReLU</option>
<option value="tanh">Tanh</option>
<option value="sigmoid">Sigmoid</option>
<option value="linear">Linear</option>
</select>
</div>
</div>
<div class="control ui-regularization">
<label for="regularizations">Regularization</label>
<div class="select">
<select id="regularizations">
<option value="none">None</option>
<option value="L1">L1</option>
<option value="L2">L2</option>
</select>
</div>
</div>
<div class="control ui-regularizationRate">
<label for="regularRate">Regularization rate</label>
<div class="select">
<select id="regularRate">
<option value="0">0</option>
<option value="0.001">0.001</option>
<option value="0.003">0.003</option>
<option value="0.01">0.01</option>
<option value="0.03">0.03</option>
<option value="0.1">0.1</option>
<option value="0.3">0.3</option>
<option value="1">1</option>
<option value="3">3</option>
<option value="10">10</option>
</select>
</div>
</div>
<div class="control ui-problem">
<label for="problem">Problem type</label>
<div class="select">
<select id="problem">
<option value="classification">Classification</option>
<option value="regression">Regression</option>
</select>
</div>
</div>
</div>
</div>
<!-- Main Part -->
<div id="main-part" class="l--page">
<!-- Data Column-->
<div class="column data">
<h4>
<span>Data</span>
</h4>
<div class="ui-dataset">
<p>Which dataset do you want to use?</p>
<div class="dataset-list">
<div class="dataset" title="Circle">
<canvas class="data-thumbnail" data-dataset="circle"></canvas>
</div>
<div class="dataset" title="Exclusive or">
<canvas class="data-thumbnail" data-dataset="xor"></canvas>
</div>
<div class="dataset" title="Gaussian">
<canvas class="data-thumbnail" data-dataset="gauss"></canvas>
</div>
<div class="dataset" title="Spiral">
<canvas class="data-thumbnail" data-dataset="spiral"></canvas>
</div>
<div class="dataset" title="Plane">
<canvas class="data-thumbnail" data-regDataset="reg-plane"></canvas>
</div>
<div class="dataset" title="Multi gaussian">
<canvas class="data-thumbnail" data-regDataset="reg-gauss"></canvas>
</div>
</div>
</div>
<div>
<div class="ui-percTrainData">
<label for="percTrainData">Ratio of training to test data: <span class="value">XX</span>%</label>
<p class="slider">
<input class="mdl-slider mdl-js-slider" type="range" id="percTrainData" min="10" max="90" step="10">
</p>
</div>
<div class="ui-noise">
<label for="noise">Noise: <span class="value">XX</span></label>
<p class="slider">
<input class="mdl-slider mdl-js-slider" type="range" id="noise" min="0" max="50" step="5">
</p>
</div>
<button class="basic-button" id="data-regen-button" title="Regenerate data">
Regenerate
</button>
</div>
</div>
<!-- Features Column -->
<div class="column features">
<h4>Features</h4>
<p>Which properties do you want to feed in?</p>
<div id="network">
<svg id="svg" width="510" height="450">
<defs>
<marker id="markerArrow" markerWidth="7" markerHeight="13" refX="1" refY="6" orient="auto" markerUnits="userSpaceOnUse">
<path d="M2,11 L7,6 L2,2" />
</marker>
</defs>
</svg>
<!-- Hover card -->
<div id="hovercard">
<div style="font-size:10px">Click anywhere to edit.</div>
<div><span class="type">Weight/Bias</span> is <span class="value">0.2</span><span><input type="number"/></span>.</div>
</div>
<div class="callout thumbnail">
<svg viewBox="0 0 30 30">
<defs>
<marker id="arrow" markerWidth="5" markerHeight="5" refx="5" refy="2.5" orient="auto" markerUnits="userSpaceOnUse">
<path d="M0,0 L5,2.5 L0,5 z"/>
</marker>
</defs>
<path d="M12,30C5,20 2,15 12,0" marker-end="url(#arrow)">
</svg>
<div class="label">
This is the output from one <b>neuron</b>. Hover to see it larger.
</div>
</div>
<div class="callout weights">
<svg viewBox="0 0 30 30">
<defs>
<marker id="arrow" markerWidth="5" markerHeight="5" refx="5" refy="2.5" orient="auto" markerUnits="userSpaceOnUse">
<path d="M0,0 L5,2.5 L0,5 z"/>
</marker>
</defs>
<path d="M12,30C5,20 2,15 12,0" marker-end="url(#arrow)">
</svg>
<div class="label">
The outputs are mixed with varying <b>weights</b>, shown by the thickness of the lines.
</div>
</div>
</div>
</div>
<!-- Hidden Layers Column -->
<div class="column hidden-layers">
<h4>
<div class="ui-numHiddenLayers">
<button id="add-layers" class="mdl-button mdl-js-button mdl-button--icon">
<i class="material-icons">add</i>
</button>
<button id="remove-layers" class="mdl-button mdl-js-button mdl-button--icon">
<i class="material-icons">remove</i>
</button>
</div>
<span id="num-layers"></span>
<span id="layers-label"></span>
</h4>
<div class="bracket"></div>
</div>
<!-- Output Column -->
<div class="column output">
<h4>Output</h4>
<div class="metrics">
<div class="output-stats ui-percTrainData">
<span>Test loss</span>
<div class="value" id="loss-test"></div>
</div>
<div class="output-stats train">
<span>Training loss</span>
<div class="value" id="loss-train"></div>
</div>
<div id="linechart"></div>
</div>
<div id="heatmap"></div>
<div style="float:left;margin-top:20px">
<div style="display:flex; align-items:center;">
<!-- Gradient color scale -->
<div class="label" style="width:105px; margin-right: 10px">
Colors shows data, neuron and weight values.
</div>
<svg width="150" height="30" id="colormap">
<defs>
<linearGradient id="gradient" x1="0%" y1="100%" x2="100%" y2="100%">
<stop offset="0%" stop-color="#f59322" stop-opacity="1"></stop>
<stop offset="50%" stop-color="#e8eaeb" stop-opacity="1"></stop>
<stop offset="100%" stop-color="#0877bd" stop-opacity="1"></stop>
</linearGradient>
</defs>
<g class="core" transform="translate(3, 0)">
<rect width="144" height="10" style="fill: url('#gradient');"></rect>
</g>
</svg>
</div>
<br/>
<div style="display:flex;">
<label class="ui-showTestData mdl-checkbox mdl-js-checkbox mdl-js-ripple-effect" for="show-test-data">
<input type="checkbox" id="show-test-data" class="mdl-checkbox__input" checked>
<span class="mdl-checkbox__label label">Show test data</span>
</label>
<label class="ui-discretize mdl-checkbox mdl-js-checkbox mdl-js-ripple-effect" for="discretize">
<input type="checkbox" id="discretize" class="mdl-checkbox__input" checked>
<span class="mdl-checkbox__label label">Discretize output</span>
</label>
</div>
</div>
</div>
</div>
<!-- More -->
<div class="more">
<!-- <button class="mdl-button mdl-js-button mdl-button--icon"><i class="material-icons">keyboard_arrow_down</i></button> -->
<button class="mdl-button mdl-js-button mdl-button--fab">
<i class="material-icons">keyboard_arrow_down</i>
</button>
</div>
<!-- Article -->
<article id="article-text">
<div class="l--body">
<h2>What is this doing?</h2>
<p>Right now, this makes axis-aligned splits much like a decision-tree would do. Each split is followed by an activation that isn't quite hard. The first layer calculates splits and the final layer calculates combinations of these splits using weights which are either 1 or -1.</p>
<h2>What Do All the Colors Mean?</h2>
<p>Orange and blue are used throughout the visualization in slightly different ways, but in general orange shows negative values while blue shows positive values.</p>
<p>The data points (represented by small circles) are initially colored orange or blue, which correspond to positive one and negative one.</p>
<p>In the hidden layers, the lines are colored by the weights of the connections between neurons. Blue shows a positive weight, which means the network is using that output of the neuron as given. An orange line shows that the network is assiging a negative weight.</p>
<p>In the output layer, the dots are colored orange or blue depending on their original values. The background color shows what the network is predicting for a particular area. The intensity of the color shows how confident that prediction is.</p>
</div>
<div class="l--body">
<h2>Credits</h2>
<p>
This was created by Daniel Smilkov and Shan Carter.
This is a continuation of many people’s previous work — most notably Andrej Karpathy’s <a href="http://cs.stanford.edu/people/karpathy/convnetjs/demo/classify2d.html">convnet.js demo</a>
and Chris Olah’s <a href="http://colah.github.io/posts/2014-03-NN-Manifolds-Topology/">articles</a> about neural networks.
Many thanks also to D. Sculley for help with the original idea and to Fernanda Viégas and Martin Wattenberg and the rest of the
<a href="https://research.google.com/bigpicture/">Big Picture</a> and <a href="https://research.google.com/teams/brain/">Google Brain</a> teams for feedback and guidance.
</p>
</div>
</article>
<!-- Footer -->
<footer>
<div class="l--body">
<a href="https://www.tensorflow.org/" class="logo">
<img width=20% src="https://csinva.io/imodels/img/imodels_logo.svg?sanitize=True"/>
</a>
<div class="links">
<a href="https://github.com/csinva/imodels">Source on GitHub</a>
</div>
</div>
</footer>
<script src="bundle.js"></script>
<!-- Google analytics -->
<script src="analytics.js"></script>
</body>
</html>