-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathindex.html
235 lines (222 loc) · 13 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
<!doctype html>
<html lang="en">
<head>
<!-- Required meta tags -->
<meta charset="utf-8">
<meta name="viewport" content="width=device-width, initial-scale=1, shrink-to-fit=no">
<META HTTP-EQUIV="CACHE-CONTROL" CONTENT="NO-CACHE">
<!-- Bootstrap CSS -->
<link rel="stylesheet" href="https://stackpath.bootstrapcdn.com/bootstrap/4.2.1/css/bootstrap.min.css" integrity="sha384-GJzZqFGwb1QTTN6wy59ffF1BuGJpLSa9DkKMp0DgiMDm4iYMj70gZWKYbI706tWS" crossorigin="anonymous">
<link rel="icon" href="./favicon.ico">
<title>Hopfield Network</title>
<style>
#overlay {
position: fixed; /* Sit on top of the page content */
display: none; /* Hidden by default */
width: 100%; /* Full width (cover the whole page) */
height: 100%; /* Full height (cover the whole page) */
top: 0;
left: 0;
right: 0;
bottom: 0;
background-color: rgba(0,0,0,0.5); /* Black background with opacity */
z-index: 2; /* Specify a stack order in case you're using a different order for other elements */
cursor: pointer; /* Add a pointer on hover */
}
#text{
position: absolute;
top: 50%;
left: 50%;
font-size: 50px;
color: white;
transform: translate(-50%,-50%);
-ms-transform: translate(-50%,-50%);
}
</style>
</head>
<body>
<nav class="navbar navbar-light bg-light">
<a class="navbar-brand">Hopfield Network</a>
<form class="form-inline">
<button type="button" class="btn btn-info" data-toggle="modal" data-target="#exampleModal">
How To
</button>
</form>
</nav>
<!-- Modal -->
<div class="modal fade" id="exampleModal" tabindex="-1" role="dialog" aria-labelledby="exampleModalLabel" aria-hidden="true">
<div class="modal-dialog" role="document">
<div class="modal-content">
<div class="modal-header">
<h5 class="modal-title" id="exampleModalLabel">How To</h5>
<button type="button" class="close" data-dismiss="modal" aria-label="Close">
<span aria-hidden="true">×</span>
</button>
</div>
<div class="modal-body">
<p>
Hopefield Network mimicks how memory works. It is an autoassociative memory which can learn (remember) one or more patterns
and given the partial (incomplete) learned pattern (some information of pattern are missing), the network can recall and recover a whole learned pattern.
<br> <br>
There are two steps in this application, train and predict.
<br>
<br>
<b>Train</b>
<ul>
<li>In this step we will train 3 patterns on the screen</li>
<li>You can draw the 3 patterns by yourself by clicking the grid</li>
<li>Or you can use the preset image provided</li>
<li>Click the <b>Train 3 Patterns</b> button to start training and updating network weights</li>
</ul>
<br>
<b>Predict</b>
<ul>
<li>In this step we the network will predict the learned pattern once you click the <b>Predict</b> button</li>
<li>You can draw incomplete pattern similar with the learned pattern in the training phase</li>
<li>Or you can use the preset image + noise provided</li>
</ul>
</p>
</div>
<div class="modal-footer">
</div>
</div>
</div>
</div>
<div class="container-fluid">
<div class="row justify-content-md-center" style="margin-top: 40px;">
<div role="alert" aria-live="assertive" aria-atomic="true" class="toast" id="weight-update" data-autohide="true">
<div class="toast-body">
Weight Updated!
</div>
</div>
</div>
<div class="row justify-content-md-center" style="margin-bottom: 10px;">
<h3>Train</h3>
</div>
<div class="row justify-content-md-center">
<div class="col-md">
<div class="row justify-content-md-center">
<canvas id="canvas-1" width="450" height="450" style="border:1px solid #000000;"/>
</div>
<div class="row justify-content-md-center" style="margin:5px;">
<div class="btn-group" role="group">
<button id="btnGroupDrop1" type="button" class="btn btn-secondary dropdown-toggle" data-toggle="dropdown" aria-haspopup="true" aria-expanded="false">
Load Preset Image
</button>
<div class="dropdown-menu" aria-labelledby="btnGroupDrop1">
<a class="dropdown-item" id="dropdown-preset-random-1" href="#">Random</a>
<a class="dropdown-item" id="dropdown-preset-a-1" href="#">A</a>
<a class="dropdown-item" id="dropdown-preset-c-1" href="#">C</a>
<a class="dropdown-item" id="dropdown-preset-z-1" href="#">Z</a>
<a class="dropdown-item" id="dropdown-preset-batman-1" href="#">Batman</a>
</div>
</div>
</div>
</div>
<div class="col-md">
<div class="row justify-content-md-center">
<canvas id="canvas-2" width="450" height="450" style="border:1px solid #000000;"/>
</div>
<div class="row justify-content-md-center" style="margin:5px;">
<div class="btn-group" role="group">
<button id="btnGroupDrop2" type="button" class="btn btn-secondary dropdown-toggle" data-toggle="dropdown" aria-haspopup="true" aria-expanded="false">
Load Preset Image
</button>
<div class="dropdown-menu" aria-labelledby="btnGroupDrop2">
<a class="dropdown-item" id="dropdown-preset-random-2" href="#">Random</a>
<a class="dropdown-item" id="dropdown-preset-a-2" href="#">A</a>
<a class="dropdown-item" id="dropdown-preset-c-2" href="#">C</a>
<a class="dropdown-item" id="dropdown-preset-z-2" href="#">Z</a>
<a class="dropdown-item" id="dropdown-preset-batman-2" href="#">Batman</a>
</div>
</div>
</div>
</div>
<div class="col-md">
<div class="row justify-content-md-center">
<canvas id="canvas-3" width="450" height="450" style="border:1px solid #000000;"/>
</div>
<div class="row justify-content-md-center" style="margin:5px;">
<div class="btn-group" role="group">
<button id="btnGroupDrop3" type="button" class="btn btn-secondary dropdown-toggle" data-toggle="dropdown" aria-haspopup="true" aria-expanded="false">
Load Preset Image
</button>
<div class="dropdown-menu" aria-labelledby="btnGroupDrop3">
<a class="dropdown-item" id="dropdown-preset-random-3" href="#">Random</a>
<a class="dropdown-item" id="dropdown-preset-a-3" href="#">A</a>
<a class="dropdown-item" id="dropdown-preset-c-3" href="#">C</a>
<a class="dropdown-item" id="dropdown-preset-z-3" href="#">Z</a>
<a class="dropdown-item" id="dropdown-preset-batman-3" href="#">Batman</a>
</div>
</div>
</div>
</div>
</div>
<div class="row justify-content-md-center">
<button id="button-train" class="btn btn-outline-secondary" type="button">Train 3 Patterns</button>
</div>
<hr>
<div class="row justify-content-md-center">
<h3>Predict</h3>
</div>
<div class="row justify-content-md-center">
<div class="col-md"></div>
<div class="col-md">
<div class="row justify-content-md-center">
<div class="progress" style="height: 30px; width: 450px;">
<div id="progress-predict" class="progress-bar" role="progressbar" style="width: 0%;" aria-valuenow="0" aria-valuemin="0" aria-valuemax="100"></div>
</div>
</div>
<div class="row justify-content-md-center" style="margin: 5px;">
<canvas id="canvas-res" width="450" height="450" style="border:1px solid #000000;"/>
</div>
<div class="row justify-content-md-center" style="margin:5px;">
<div class="btn-group" role="group">
<button id="btnGroupDropRes" type="button" class="btn btn-secondary dropdown-toggle" data-toggle="dropdown" aria-haspopup="true" aria-expanded="false">
Load Preset Image + Noise
</button>
<div class="dropdown-menu" aria-labelledby="btnGroupDropRes">
<a class="dropdown-item" id="dropdown-preset-a-noise" href="#">A + Noise</a>
<a class="dropdown-item" id="dropdown-preset-c-noise" href="#">C + Noise</a>
<a class="dropdown-item" id="dropdown-preset-z-noise" href="#">Z + Noise</a>
<a class="dropdown-item" id="dropdown-preset-batman-noise" href="#">Batman + Noise</a>
</div>
</div>
</div>
<div class="row justify-content-md-center">
<button id="button-process" class="btn btn-outline-secondary" type="button">Predict</button>
</div>
</div>
<div class="col-md"></div>
</div>
<hr>
</div>
<!--<div class="row justify-content-md-center">
<div class="col-sm">
</div>
<div class="col-sm">
<div class="progress">
</div>
<div class="col-sm">
</div>
</div>-->
<!-- Footer -->
<h4 style="margin-left: 30px;"><i>*Delay is added in prediction to observe how the network recover the information</i></h4>
<footer class="page-footer font-small blue pt-4">
<div class="footer-copyright text-center py-3">
<style>.bmc-button img{width: 35px !important;margin-bottom: 1px !important;box-shadow: none !important;border: none !important;vertical-align: middle !important;}.bmc-button{padding: 7px 10px 7px 10px !important;line-height: 35px !important;height:51px !important;min-width:217px !important;text-decoration: none !important;display:inline-flex !important;color:#ffffff !important;background-color:#FF813F !important;border-radius: 5px !important;border: 1px solid transparent !important;padding: 7px 10px 7px 10px !important;font-size: 20px !important;letter-spacing:-0.08px !important;box-shadow: 0px 1px 2px rgba(190, 190, 190, 0.5) !important;-webkit-box-shadow: 0px 1px 2px 2px rgba(190, 190, 190, 0.5) !important;margin: 0 auto !important;font-family:'Lato', sans-serif !important;-webkit-box-sizing: border-box !important;box-sizing: border-box !important;-o-transition: 0.3s all linear !important;-webkit-transition: 0.3s all linear !important;-moz-transition: 0.3s all linear !important;-ms-transition: 0.3s all linear !important;transition: 0.3s all linear !important;}.bmc-button:hover, .bmc-button:active, .bmc-button:focus {-webkit-box-shadow: 0px 1px 2px 2px rgba(190, 190, 190, 0.5) !important;text-decoration: none !important;box-shadow: 0px 1px 2px 2px rgba(190, 190, 190, 0.5) !important;opacity: 0.85 !important;color:#ffffff !important;}</style><link href="https://fonts.googleapis.com/css?family=Lato&subset=latin,latin-ext" rel="stylesheet"><a class="bmc-button" target="_blank" href="https://www.buymeacoffee.com/mabdh"><img src="https://cdn.buymeacoffee.com/buttons/bmc-new-btn-logo.svg" alt="Buy me a coffee"><span style="margin-left:15px;font-size:19px !important;">Buy me a coffee</span></a>
</div>
<!-- Copyright -->
<div class="footer-copyright text-center py-3">© 2019
<a href="http://mabdh.github.io/"> Muhammad Abduh</a>
</div>
<!-- Copyright -->
</footer>
<!-- Footer -->
<!-- Optional JavaScript -->
<!-- jQuery first, then Popper.js, then Bootstrap JS -->
<script src="https://code.jquery.com/jquery-3.3.1.slim.min.js" integrity="sha384-q8i/X+965DzO0rT7abK41JStQIAqVgRVzpbzo5smXKp4YfRvH+8abtTE1Pi6jizo" crossorigin="anonymous"></script>
<script src="https://cdnjs.cloudflare.com/ajax/libs/popper.js/1.14.6/umd/popper.min.js" integrity="sha384-wHAiFfRlMFy6i5SRaxvfOCifBUQy1xHdJ/yoi7FRNXMRBu5WHdZYu1hA6ZOblgut" crossorigin="anonymous"></script>
<script src="https://stackpath.bootstrapcdn.com/bootstrap/4.2.1/js/bootstrap.min.js" integrity="sha384-B0UglyR+jN6CkvvICOB2joaf5I4l3gm9GU6Hc1og6Ls7i6U/mkkaduKaBhlAXv9k" crossorigin="anonymous"></script>
<script type="text/javascript" src="dist/bundle.js"></script>
</body>