-
Notifications
You must be signed in to change notification settings - Fork 23
/
Copy pathindex.html
160 lines (148 loc) · 6.92 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
<!DOCTYPE html>
<html>
<head>
<title>VisualML | Autoencoder</title>
<link rel="shortcut icon" href="../img/favicon.ico" type="image/x-icon">
<meta charset="utf-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<style>
html{
line-height: 200%;
font-family:Georgia;
}
button{
border-radius: 20px;
border-color:#00FFFF;
background-color: #CCFFFF;
font-size:2vh;
}
#train {
margin-top: 10px;
}
label {
display: inline-block;
width: 90%;
padding: 6px 0 6px 0;
}
.canvases {
display: inline-block;
}
.prediction-canvas {
width: 100px;
}
.pred {
font-size: 20px;
line-height: 25px;
width: 100px;
}
.pred-correct {
background-color: #00cf00;
}
.pred-incorrect {
background-color: red;
}
.pred-container {
display: inline-block;
width: 100px;
margin: 10px;
}
</style>
</head>
<body style="text-align:center;background-color:white;font-size:3vh;top:0%; font-family:Georgia;margin-top:0%;margin-left:0%;">
<p style="background-color:#111111E9;font-size:3vw;top:0%;font-family:Times;margin-top:0%;padding-bottom:1%;padding-top:1%;position:fixed;width:100%;color:#EEEEFF;">TensorFlow.js: MNIST Autoencoder</p>
<p style="background-color:#7777AA;font-size:3vw;top:0%;font-family:Times;margin-top:0%;padding-bottom:1%;padding-top:1%;visibility: hidden;width:100%;margin-bottom:0%;">TensorFlow.js: MNIST Autoencoder</p>
<div id="body" style="text-align:center;height:100%;width:55%;margin-left:22%;background-color:white;padding-left:1vw;padding-top:1vh;">
<br>
<section class='title-area' >
<p style="text-align:left;color:#111111;margin-top:0%;">
This examples lets you train a MNIST Autoencoder using a Fully Connected Neural Network (also known as a DenseNet) in written in Tfjs<br><br>
You can select the structure for the DenseNet and see the performance of the model.
<br>The MNIST dataset is used as training data.
<br>
<br>
Set latent space dimension to 2 for 2d Exploration of the latent space. Otherwise set it high for accurate autoencoding
<br>
Visualization scale determines the scale of 2d pane
</p>
</section>
<div style="width:100%;height:5px;background-color:#EFEFEF;"></div>
<section style="text-align:center;">
<p class='section-head' >
<h1 style="background-color:#EFEFFF;padding-top:0.5%;padding-bottom:1%;">Training Parameters</h1>
</p>
<div style="font-family:Times;width:20vw;background-color:#EFEFEF;text-align:left;padding-left:3%;padding-top:3%;padding-bottom:2%;display:inline-block;">
<div>
<label>N hidden layers in encoder and decoder</label>
<input id="n_layers" value="3">
</div>
<div>
<label>Output dimension of each layer</label>
<input id="n_units" value="500">
</div>
<div>
<label>Hidden code dimension (Set it to 2 for graph visualization)</label>
<input id="hidden" value="2">
</div>
<button id="Create">Create model</button>
</div>
<div style="font-family:Times;width:20vw;background-color:#EFEFEF;text-align:left;padding-left:3%;padding-top:1.3%;padding-bottom:2%;display:inline-block;">
<div>
<label># Batch size:</label>
<input id="batchsize" value="300">
</div>
<div>
<label># LearnRate:</label>
<input id="lr" value="0.1">
</div>
<div>
<label># Training epochs:</label>
<input id="train-epochs" value="1">
</div>
<div>
<label># Visualization scale</label>
<input id="vis" value="0.1">
</div>
<button id="train">Train Model</button>
</div>
</section>
<br>
<div style="width:100%;height:5px;background-color:#EFEFEF;"></div>
</div>
<br><br>
<div style="text-align:center;margin-left:10%;font-family:Times;background-color:#EFEFFF66;width:80%;padding-top:1%;font-family:sans-serif;">
<div style="text-align:center; ">
<h2>This will show the examples of autoencoder once it its trained</h2>
<div id="new" style="text-align:center;"></div>
<div id="barc" style='background-color:#BBBBBB;height:30px;width:60%;margin-left:20%;display:none;'>
<div id="bar" style='background-color:#3333FF;height:30px;width:0%;color:white;'>0%</div>
</div>
</div>
<br><br><br>
<div style="width:100%;background-color:white;height:15px;"></div>
<div style="text-align:center;">
<h2>This is for 2d plot visualization of latent space of autoencoder.<br> Drag in the 2d Pane below slowly<br></h2>
<div id="cn" style="display:none;margin-left:35%;text-align:center;">
<canvas id="mot" style="height:80px;width:80px;display:block;margin-left:20%;border:solid 3px black;"></canvas>
<br>
<canvas id="celeba-scene" style="height:400px; width:400px;display:block;"></canvas>
</div>
</div>
<br><br>
<div style="width:100%;background-color:white;height:15px;"></div>
<div style="text-align:center;">
<h2>This is for autoencoding your drawing on the canvas<br></h2>
<canvas id="canv" style="height:400px; width:400px;display:inline;"></canvas>
<canvas id="outcanv" style="height:400px; width:400px;display:inline;"></canvas>
<span style="display:block;"></span>
<button id="save" style="display:inline;">Autoencode</button>
<button id="clear" style="display:inline;">Clear</button>
</div>
</div>
<script src="https://cdn.jsdelivr.net/npm/@tensorflow/[email protected]/dist/tf.min.js"></script>
<script src="https://cdn.jsdelivr.net/npm/@tensorflow/[email protected]/dist/tfjs-vis.umd.min.js"></script>
<script src='https://cdnjs.cloudflare.com/ajax/libs/tensorflow/1.2.7/tf.min.js'></script>
<script src="index.js" type="module"></script>
</div>
</body>
</html>