-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathindex.html
More file actions
529 lines (449 loc) · 21.4 KB
/
index.html
File metadata and controls
529 lines (449 loc) · 21.4 KB
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
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
<!DOCTYPE html>
<html lang="en">
<head>
<!-- Google Analytics -->
<script async src="https://www.google-analytics.com/analytics.js"></script>
<script async src="assets/plugins/autotrack.js"></script>
<script>
window.ga = window.ga || function () {
(ga.q = ga.q || []).push(arguments)
};
ga.l = +new Date;
ga('create', 'UA-108549242-1', 'auto');
// Replace the following lines with the plugins you want to use.
// ga('require', 'eventTracker');
// ga('require', 'outboundLinkTracker');
// ga('require', 'urlChangeTracker');
// ...
ga('send', 'pageview');
</script>
<!-- End Google Analytics -->
<!-- Meta -->
<title>Ueval -- Evaluate sample qualities of GANs in browser</title>
<meta charset="utf-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<link rel="shortcut icon" href="favicon.ico">
<link href='https://fonts.googleapis.com/css?family=Roboto:400,500,400italic,300italic,300,500italic,700,700italic,900,900italic'
rel='stylesheet' type='text/css'>
<!-- Global CSS -->
<link rel="stylesheet" href="assets/plugins/bootstrap/css/bootstrap.min.css">
<!-- Plugins CSS -->
<link rel="stylesheet" href="assets/plugins/font-awesome/css/font-awesome.css">
<!-- Theme CSS -->
<link id="theme-style" rel="stylesheet" href="assets/css/styles.css">
<script src="https://cdnjs.cloudflare.com/ajax/libs/Chart.js/2.4.0/Chart.bundle.min.js"></script>
</head>
<style>
.main-wrapper {
background: #fff;
padding: 30px;
padding-right: 270px;
}
@media (max-width: 767px) {
.wrapper {
max-width: 95%;
}
.main-wrapper {
padding: 20px;
}
.main-wrapper .time {
position: static;
display: block;
margin-top: 10px;
}
}
.box {
/* width: 99%; */
background: rgb(255, 255, 255);
padding: 5%;
margin-top: 10px;
text-align: center;
}
.effect8 {
/* position: relative; */
-webkit-box-shadow: 2px 2px 5px 1px #ccc;
/* Safari 3-4, iOS 4.0.2 - 4.2, Android 2.3+ */
-moz-box-shadow: 2px 2px 5px 1px #ccc;
/* Firefox 3.5 - 3.6 */
box-shadow: 2px 2px 5px 1px #ccc;
/* Opera 10.5, IE 9, Firefox 4+, Chrome 6+, iOS 5 */
}
.title {
align-items: center;
/* color: #545E6C; */
font-size: 18px;
font-weight: bold;
padding-bottom: 10px;
text-transform: uppercase;
}
.subtitle {
font-size: 15px;
margin-bottom: 5px;
}
.inference-example {
margin-bottom: 0px;
margin-left: 1px
}
.image-container {
line-height: 1;
min-width: 155px;
min-height: 155px;
}
/* ----------------------------*/
.ndarray-image-visualizer {
flex-basis: 100px;
}
.nav-pills>li>a {
color: #545E6C
}
.nav-pills>li.active>a,
.nav-pills>li.active>a:hover,
.nav-pills>li.active>a:focus {
color: #fff;
background-color: rgba(75, 192, 192, 1) !important;
}
</style>
<body onload="start()">
<!--Navigation bar-->
<div id="nav-placeholder">
</div>
<!--end of Navigation bar-->
<div class="wrapper" id="wrap">
<div class="sidebar-wrapper">
<div class="contact-container container-block">
<div class="jumbotron">
<h2>
Ueval</h2>
<p style='font-size:1.2em'>This demo is a practice of using deeplearnjs. It is refactored from
<a href="https://github.com/reiinakano/gan-playground">gan-playground</a> which is based on the
<a href="https://deeplearnjs.org/demos/model-builder/">model-builder demo</a>.
</p>
</div>
<p>Last Update: 2017-11-29</p>
<p>
<a href="https://github.com/hma02/Ueval/blob/master/LICENSE">Ueval's MIT License</a>
</p>
<p>
<a href="https://github.com/PAIR-code/deeplearnjs/blob/master/LICENSE">DeeplearnJS's Apache License</a>
</p>
</div>
</div>
<div class="main-wrapper">
<a href="https://github.com/hma02/Ueval" class="github-corner" aria-label="View source on Github">
<svg width="80" height="80" viewBox="0 0 250 250" style="fill:#151513; color:#fff; position: absolute; top: 0; border: 0; right: 0;"
aria-hidden="true">
<path d="M0,0 L115,115 L130,115 L142,142 L250,250 L250,0 Z"></path>
<path d="M128.3,109.0 C113.8,99.7 119.0,89.6 119.0,89.6 C122.0,82.7 120.5,78.6 120.5,78.6 C119.2,72.0 123.4,76.3 123.4,76.3 C127.3,80.9 125.5,87.3 125.5,87.3 C122.9,97.6 130.6,101.9 134.4,103.2"
fill="currentColor" style="transform-origin: 130px 106px;" class="octo-arm"></path>
<path d="M115.0,115.0 C114.9,115.1 118.7,116.5 119.8,115.4 L133.7,101.6 C136.9,99.2 139.9,98.4 142.2,98.6 C133.8,88.0 127.5,74.4 143.8,58.0 C148.5,53.4 154.0,51.2 159.7,51.0 C160.3,49.4 163.2,43.6 171.4,40.1 C171.4,40.1 176.1,42.5 178.8,56.2 C183.1,58.6 187.2,61.8 190.9,65.4 C194.5,69.0 197.7,73.2 200.1,77.6 C213.8,80.2 216.3,84.9 216.3,84.9 C212.7,93.1 206.9,96.0 205.4,96.6 C205.1,102.4 203.0,107.8 198.3,112.5 C181.9,128.9 168.3,122.5 157.7,114.1 C157.9,116.9 156.7,120.9 152.7,124.9 L141.0,136.5 C139.8,137.7 141.6,141.9 141.8,141.8 Z"
fill="currentColor" class="octo-body"></path>
</svg>
</a>
<style>
.github-corner:hover .octo-arm {
animation: octocat-wave 560ms ease-in-out
}
@keyframes octocat-wave {
0%,
100% {
transform: rotate(0)
}
20%,
60% {
transform: rotate(-25deg)
}
40%,
80% {
transform: rotate(10deg)
}
}
@media (max-width:500px) {
.github-corner:hover .octo-arm {
animation: none
}
.github-corner .octo-arm {
animation: octocat-wave 560ms ease-in-out
}
}
</style>
<div class="item row" style="text-align: center;">
<h4>Evaluate sample qualities of GANs in browser</h4>
<br>
<br>
<div class="col-md-6 col-sm-12 col-xs-12">
<p>This is the demo of evaluation metric from “
<a href="https://openreview.net/forum?id=SJQHjzZ0-">Quantitatively Evaluating GANs with Divergences proposed for Training</a>”. This paper shows how
to measure the similarity between the data distribution and model distribution by constructing a
critic network based on certain divergence or distance metrics used in training GANs, e.g., least
square divergence, Jenson-Shannon divergence, Wasserstein distance, etc. Therefore the evaluation
process does not need external model and data labels.
</p>
<p>
<b>Instructions:</b>
</p>
<ul class="nav nav-pills nav-justified">
<li class="active">
<a data-toggle="tab" href="#inferall">Show Image</a>
</li>
<li>
<a data-toggle="tab" href="#evaluate">Evaluate</a>
</li>
<li>
<a data-toggle="tab" href="#uploadsample">Upload Sample</a>
</li>
<li>
<a data-toggle="tab" href="#uploadweights">Upload Weights</a>
</li>
</ul>
<br>
<br>
<div class='tab-content'>
<div id='inferall' class='tab-pane fade in active'>
<p>Click "
<b>Show Image</b>" to inference samples from data distribution and model distribution.</p>
</div>
<div id='evaluate' class='tab-pane fade'>
<p>Click "
<b>Evaluate</b>" on each card to evaluate sample qualities.</p>
<p>Real data distribution, as a baseline, has the best quality.</p>
</div>
<div id='uploadsample' class='tab-pane fade'>
<p>Click "
<b>Upload Sample</b>" to upload sample data. To generate one, follow the python code
<a href="https://github.com/PAIR-code/deeplearnjs/blob/master/demos/rune_recognition/generate_rune_data_for_model_builder.py">here</a>, reshape a batch of sample images of shape (batchSize, 28,28,1) to (batchSize,28*28,1)
and save it to a gray scale png image of shape (batchSize, 28*28).</p>
<p>Example sample Images:
<a href="https://www.dropbox.com/s/5bzjdf9wh2v0lqf/7-5-63322-LSGAN-40000.png?dl=0">LSGAN</a>
</p>
</div>
<div id='uploadweights' class='tab-pane fade'>
<p>Click "
<b>Upload Weights</b>" to upload generator weights. You can download trained generator weights
from the
<a href="https://hma02.github.io/deeplearnjs-practice/deeplearn_gan.html">GAN demo</a>.</p>
<p>Example weight file:
<a href="https://www.dropbox.com/s/y46tf6zkw75ulfx/700s_gen_weights.json?dl=0">700s</a>
</p>
</div>
</div>
<hr class="divider hidden-lg hidden-md visible-sm" />
</div>
<div class="col-md-6 col-sm-12 col-xs-12">
<div id="targetEvalAmount"></div>
<br>
<br>
<div class="form-group">
<label for="metric-dropdown">Metric</label>
<select class="form-control" id="metric-dropdown">
<option value="js">Jensen-Shannon Divergence</option>
<option value="ls">Least Square Divergence</option>
</select>
</div>
<div class="item row">
<div class="col-md-4 col-sm-4 col-xs-4">
<input class="btn btn-default btn-md" id="buttoninfer" type="submit" value="Show Image" />
</div>
<div class="col-md-4 col-sm-4 col-xs-4">
<label class="btn btn-default btn-file" id="weights-file1-label">
<i class="fa fa-upload" aria-hidden="true"></i> Weights
<input class="upload" type="file" id="weights-file" name="weights-file1" style="display: none;" />
</label>
<div id="loadedWeightsFileName"></div>
</div>
<div class="col-md-4 col-sm-4 col-xs-4">
<label class="btn btn-default btn-file" id="sample-file-label">
<i class="fa fa-upload" aria-hidden="true"></i> Sample
<input class="upload" type="file" id="sample-file" name="sample-file" style="display: none;" />
</label>
<br>
<div id="loadedSampleImageFileName"></div>
<img id="sampleImage" src="#" alt="" height=30 width=30 style="visibility:hidden;">
</div>
</div>
</div>
</div>
<br>
<br>
<!-- <hr class="divider" /> -->
<div class="item row" id="eval">
<div class="col-md-6 col-sm-12 col-xs-12" id="eval0">
<div class="box effect8">
<h6 class="title" id="title0">Real Data</h6>
<div class="subtitle" id="in_subtitle0">Real Data Distribution:</div>
<div class="image-container" id="image-container0"></div>
<hr class="divider" />
<div class="item row">
<div class="col-md-6 col-sm-6 col-xs-12">
<div id="evalExamplesPerSec0">Eval Examples/sec: </div>
<div id="examplesEvaluated0">Examples evaluated:</div>
</div>
<div class="col-md-6 col-sm-6 col-xs-12">
<input class="btn btn-default btn-md paper" id="buttoneval0" type="submit" value="Evaluate" data-toggle="tooltip" title="evaluate real data distribution against itself as a baseline"
/>
</div>
</div>
<div id="evalBarBackground0" style="width:100%; background-color: #ddd;">
<div id="evalBar0" style="width: 1%; height: 10px; background-color: #4CAF50;"></div>
</div>
<hr class="divider" />
<div class="subtitle" id="out_subtitle0">Real Data Eval Result:</div>
<canvas id="losschart0" width="155" height="160">chart0</canvas>
<div id="final-score0" style="min-height:20px"></div>
</div>
</div>
<div class="col-md-6 col-sm-12 col-xs-12" id="eval1">
<div class="box effect8">
<h6 class="title" id="title1">Generator of a GAN</h6>
<div class="subtitle" id="in_subtitle1">Generated Data Distribution:</div>
<div class="image-container" id="image-container1"></div>
<hr class="divider" />
<div class="item row">
<div class="col-md-6 col-sm-6 col-xs-12">
<div id="evalExamplesPerSec1">Eval Examples/sec: </div>
<div id="examplesEvaluated1">Examples evaluated:</div>
</div>
<div class="col-md-6 col-sm-6 col-xs-12">
<input class="btn btn-default btn-md paper" id="buttoneval1" type="submit" value="Evaluate" data-toggle="tooltip" title="evaluate generated image distribution against data distribution"
/>
</div>
</div>
<div id="evalBarBackground1" style="width:100%; background-color: #ddd;">
<div id="evalBar1" style="width: 1%; height: 10px; background-color: #4CAF50;"></div>
</div>
<hr class="divider" />
<div class="subtitle" id="out_subtitle1">Generated Data Eval Result:</div>
<canvas id="losschart1" width="155" height="160">chart1</canvas>
<div id="final-score1" style="min-height:20px"></div>
</div>
</div>
</div>
</div>
<div class="main-wrapper">
<h4>Example Evaluation Results:</h4>
<div class="table-responsive">
<table class="table">
<thead>
<tr>
<th>Sample Name</th>
<th>Sample Type</th>
<th>JS score</th>
<th>LS score</th>
</tr>
</thead>
<tbody>
<tr>
<td>data-images</td>
<td>Dataset-MNIST</td>
<td>1.4006</td>
<td>0.2584</td>
</tr>
<tr>
<td>10s-gen-weight</td>
<td>GAN-MNIST</td>
<td>0.00007</td>
<td>0.0032</td>
</tr>
<tr>
<td>700s-gen-weight</td>
<td>GAN-MNIST</td>
<td>0.321</td>
<td>0.0785</td>
</tr>
<tr>
<td>4300s-gen-weight</td>
<td>GAN-MNIST</td>
<td>0.598</td>
<td>0.1213</td>
</tr>
<tr>
<td>runes-sample-28x28</td>
<td>Sample-Runes</td>
<td>0.011</td>
<td>0.0217</td>
</tr>
<tr>
<td>LS-sample-28x28</td>
<td>Sample-MNIST</td>
<td>0.0754</td>
<td>0.0514</td>
</tr>
</tbody>
</table>
</div>
</div>
</div>
<br>
<br>
<hr class="divider" />
<br>
<br>
<div style="margin: 0 auto;max-width:70%">
<h4>Credits:</h4>
<ul>
<li>Collabrators on the project (Hidden for now for the blind review process of the paper)</li>
<li>Authors of
<a href="https://deeplearnjs.org/index.html">Deeplearnjs</a>
</li>
<li>Author of
<a href="https://github.com/reiinakano/gan-playground">gan-playground</a>:
<a href="https://github.com/reiinakano">Reiichiro Nakano</a>
</li>
</ul>
</div>
<br>
<br>
<hr class="divider" />
<br>
<br>
<br>
<br>
<div class="item row" style="margin: 0 auto;max-width:70%">
<div id="disqus_thread"></div>
<noscript>Please enable JavaScript to view the
<a href="https://disqus.com/?ref_noscript">comments powered by Disqus.</a>
</noscript>
</div>
<footer class="footer">
<div class="text-center">
<!--/* This template is released under the Creative Commons Attribution 3.0 License. Please keep the attribution link below when using for your own project. Thank you for your support. :) If you'd like to use the template without the attribution, you can check out other license options via our website: themes.3rdwavemedia.com */-->
<small class="copyright">© 2017 Allan H. Ma</small>
</div>
<!--//container-->
</footer>
<!-- Javascript -->
<script type="text/javascript" src="assets/plugins/jquery-1.11.3.min.js"></script>
<script type="text/javascript" src="assets/plugins/bootstrap/js/bootstrap.min.js"></script>
<!-- custom js -->
<script type="text/javascript" src="assets/js/nav.js"></script>
<script>
$(document).ready(function () {
$('[data-toggle="tooltip"]').tooltip();
});
</script>
<script>
/**
* RECOMMENDED CONFIGURATION VARIABLES: EDIT AND UNCOMMENT THE SECTION BELOW TO INSERT DYNAMIC VALUES FROM YOUR PLATFORM OR CMS.
* LEARN WHY DEFINING THESE VARIABLES IS IMPORTANT: https://disqus.com/admin/universalcode/#configuration-variables*/
var disqus_config = function () {
this.page.url = 'https://hma02.github.io/Ueval/'; // Replace PAGE_URL with your page's canonical URL variable
this.page.identifier = 'Ueval'; // Replace PAGE_IDENTIFIER with your page's unique identifier variable
};
(function () { // DON'T EDIT BELOW THIS LINE
var d = document,
s = d.createElement('script');
s.src = 'https://allanma.disqus.com/embed.js';
s.setAttribute('data-timestamp', +new Date());
(d.head || d.body).appendChild(s);
})();
</script>
<script src="https://unpkg.com/deeplearn@0.3.12"></script>
<!-- detect browser support -->
<script src="src/support.js"></script>
<script src="src/utils.js"></script>
<script src="src/model_layer.js"></script>
<script src="src/eval_sample_model.js"></script>
<script src="src/my_graph_runner.js"></script>
<script type="text/javascript" src="src/main.js"></script>
</body>
</html>