forked from odysseyiitr/VisualML
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathindex.html
315 lines (267 loc) · 10.8 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
<!--
Copyright 2018 Google LLC. 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>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1">
<link rel="stylesheet" href="./tfjs-examples.css" />
<title>VisualML | ANN</title>
<link rel="shortcut icon" href="../img/favicon.ico" type="image/x-icon">
<script type="text/javascript" src="http://code.jquery.com/jquery.min.js"></script>
<style>
#wrapper {
position: relative;
width: 300px;
height: 150px;
}
#tip {
background-color: white;
border: 1px solid blue;
position: absolute;
left: -200px;
top: 100px;
}
</style>
</head>
<body>
<style>
input {
width: 75px;
}
.input-div {
padding: 5px;
font-family: monospace;
font-size: 16px;
}
.input-label {
display: inline-block;
width: 160px;
}
td {
padding-left: 5px;
padding-right: 5px;
padding-bottom: 5px;
}
#predict-header {
font-weight: bold;
}
.output-div {
padding: 5px;
padding-top: 20px;
font-family: monospace;
font-weight: bold;
}
#evaluate-table {
display: inline-block;
}
#evaluate-table td,
#evaluate-table th {
font-family: monospace;
border: 1px solid #ddd;
padding: 8px;
}
#evaluate-table th {
padding-top: 12px;
padding-bottom: 12px;
text-align: left;
background-color: #4CAF50;
color: white;
}
.region {
border-left: 1px dashed #ccc;
margin-bottom: 5px;
padding-left: 24px;
margin-left: -24px;
}
.load-save-section {
padding-top: 3px;
padding-bottom: 3px;
}
.logit-span {
padding-right: 1em;
}
.correct-prediction {
background-color: greenyellow
}
.wrong-prediction {
background-color: red;
}
.button2 {
background-color: #008CBA;
}
/* Blue */
</style>
<body>
<div class='tfjs-example-container'>
<section class='title-area'>
<h1>TensorFlow.js Layers: Iris Demo</h1>
<p class='subtitle'>Classify structured (tabular) data with a neural network.</p>
</section>
<section>
<p class='section-head'>Description</p>
<p>
This example uses a neural network to classify tabular data representing different flowers. The data used for each flower are the petal length and width as well as the sepal length and width. The goal is to predict what kind of flower it is based on those
features of each data point. The data comes from the famous <a href="https://en.wikipedia.org/wiki/Iris_flower_data_set">Iris flower</a> data set.
</p>
</section>
<section>
<p class='section-head'>Instructions</p>
<p>
</p>
<p>
Change the hyperparameters as you would like them to be.
</p>
<p>
Add the number of neurons for the the number of layers you want to have in the required neural network.
</p>
<p>
Train the model.<br><br>A Model Summery Tab will appear you can maximise it or hide it.
</p>
<p>
You can visualize the architecture by clicking on the NN Structure button.<br><br> If you want to visualize the coloured edges(coloured according to their weight sign),you can click on the checkbox and click on NN Structure again,
the edges will appear coloured and varied in width and color intensity on the basis of the weight magnitude.
</p>
<p>
You can edit the properties in first row of "Test Examples" to generate a prediction for those data points.
</p>
</section>
<section>
<p class='section-head'>Data Visualization</p>
</section>
<section>
<p class='section-head'>Controls</p>
<div class="region">
<h3>Train Model</h3>
<div class="create-model">
<div class="input-div">
<label class="input-label">Train Epochs:</label>
<input id="train-epochs" type="number" value="10"></input>
</div>
<div class="input-div">
<label class="input-label">Optimizer:</label>
<select id="optimizer">
<option>Adam</option>
<option>RMSprop</option>
<option>SGD</option>
</select>
</div>
<div class="input-div">
<span class="input-label">Learning Rate:</span>
<input id="learning-rate" type="number" value="0.01"></input>
</div>
<div class="input-div">
<span class="input-label">Batch Size:</span>
<input id="batch-size" type="number" value="32"></input>
</div>
<div class="input-div">
<span class="input-label">Hidden layer no.:</span>
<input id="pos" type="number" value="1"></input>
<span class="input-label">Number of neurons:</span>
<input id="#ofneuron" type="number" value="0"></input>
<button id="button1">Add</button>
</div>
<button id="train-from-scratch">Train model </button>
</div>
</div>
</section>
<section>
<p class='section-head'>Status</p>
<div>
<span id="demo-status">Standing by.</span>
</div>
</section>
<section>
<p class='section-head'>Training Progress</p>
<div class='with-cols'>
<div>
<h4>Loss</h4>
<div class="canvases" id="lossCanvas"></div>
</div>
<div>
<h4>Accuracy</h4>
<div class="canvases" id="accuracyCanvas"></div>
</div>
<div>
<h4>Confusion Matrix (on validation set)</h4>
<div id="confusion-matrix"></div>
</div>
</div>
</section>
<section>
<p class='section-head'>Visualization of Neural Network</p>
<div>
<button id="structure">NN Structure</button>
</div>
<div>
<label class="input-label">Coloured Edges:</label>
<input type="checkbox" id="myCheck">
</div>
<div>
<canvas id="graph" width=0 height=0></canvas>
<canvas id="tip" width=200 height=80></canvas>
</div>
</section>
<section>
<p class='section-head'>Test Examples</p>
<div id="evaluate">
<table id="evaluate-table">
<tr>
<th>Petal length</th>
<th>Petal width</th>
<th>Sepal length</th>
<th>Sepal width</th>
<th>True class</th>
<th>Predicted class</th>
<th>Class Probabilities</th>
</tr>
<tbody id="evaluate-tbody">
<tr>
<td>
<input id="petal-length" value="5.1"></input>
<button id="petal-length-inc">+</button>
<button id="petal-length-dec">-</button>
</td>
<td>
<input id="petal-width" value="3.5"></input>
<button id="petal-width-inc">+</button>
<button id="petal-width-dec">-</button>
</td>
<td>
<input id="sepal-length" value="1.4"></input>
<button id="sepal-length-inc">+</button>
<button id="sepal-length-dec">-</button>
</td>
<td>
<input id="sepal-width" value="0.2"></input>
<button id="sepal-width-inc">+</button>
<button id="sepal-width-dec">-</button>
</td>
<td></td>
<td id="winner"></td>
<td id="logits"></td>
</tr>
</tbody>
</table>
</div>
</section>
<div>
<div class="horizontal-section">
<div id="horizontal-section">
</div>
</div>
</div>
</div>
<script src="index.js"></script>
</body>
</html>