-
Notifications
You must be signed in to change notification settings - Fork 0
/
buttons.js
705 lines (660 loc) · 19.2 KB
/
buttons.js
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
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
/** @author Marijus Gudiskis [email protected]*/
/**
* generates new weights and re-draws the canvas and resets the cost
* and layerNum field
*/
function redrawNodesAndWeights(){
genereateW();
draw();
$("#costNum").text("");//cost number is ""
$("#layerNum").text(nodeCount.length);//number of layers is the length of the network
}
/** After switching datasets reset the miniBatch size*/
function setMiniBatch(){
$("#miniBatch").val(inputData.length);//set mini-batch label to the length of the input data
minibatch = inputData.length;
}
/** if user is writing his own data then input and output arrays will be deleted,
* table and nodes will be redrawn and new weights will be created
*/
function customDataManipulation(){
expectedOutput = [];
inputData = [];
redrawNodesAndWeights();
inputDataTable(table);//redraws the table
shuffleInput, shuffleOut = copyArrays(inputData, expectedOutput);
}
/** this just redraw Nodes And crates new Weights and shows current nodes in a layer*/
function nodeAddAndSubCombination(){
$("#nodeNum").text(nodeCount[nodeCount.length - $('#layers').val()]);
redrawNodesAndWeights();
}
/** removes the input fields that were crated wen the user wanted to input his own data */
function removeInputs(){
if(isOwnInput){
for(var i = 0; i < nodeCount[0] + nodeCount[nodeCount.length-1]; i++){
document.getElementById(i).remove();
}
}
}
/** removes softmax option from the website and resets the softmax parameters*/
function removeSoftmax(){
isSoftmax = false;
document.getElementById('yesSoft').checked = false;
document.getElementById('noSoft').checked = true;
var softRadioButtons = document.getElementById("softhide");
softRadioButtons.style.display = "none";
}
/** common code for the AND and OR datasets*/
function AND_ORdatas(){
removeInputs();
nodeCount = [1, 2];
inputData = [[1, 1],
[1, 0],
[0, 1],
[0, 0]];
tableChange(table);
removeSoftmax();
switchingBetweenDatas();
}
/** when switching between datasets: reset mini-batch, redraw nodes and redo weights,
* redraw Google chart remove input own data fields and reset display data
*/
function switchingBetweenDatas(){
setMiniBatch();
redrawNodesAndWeights();
shuffleInput, shuffleOut = copyArrays(inputData, expectedOutput);
drawChart();
document.getElementById("hideInput").style.display = "none";//hides the "your own data" parameters
document.getElementById("addInfo").style.display = "none";
isOwnInput = false;
document.getElementById("layers").innerHTML = "";//reset the display data like how many layer there are
document.getElementById("nodeNum").innerHTML = "";
document.getElementById('norml').disabled = false;//allow to normalize data
//and it resets the learning rate
document.getElementById("lrRate").value = "0.01";
learningRate = 0.01;
}
$(document).ready(function(){
/** add a layer to the network*/
$("#layersAdd").click(function(){
if(nodeCount.length < 6) {//allows max 6 layers
nodeCount.splice(1,0, 1);//adding 1 layer near the output layer
redrawNodesAndWeights();
//adds an option to select the layer
$("#layers").append(new Option(nodeCount.length -1, nodeCount.length -1));
}
//this is for user experience, but it just displays a 1 to show that you
//can change the nodes in a layer if there are more then 2 layers
if(nodeCount.length == 3){
$("#nodeNum").text("1");
}
});
/** removes a layer from the network */
$("#layersSub").click(function(){
if(nodeCount.length > 2) {//this is so not to remove input and output layer
//removes an option to select the layer
document.getElementById("layers").remove(nodeCount.length-3);
nodeCount.splice(1, 1);
redrawNodesAndWeights();
}
if(nodeCount.length == 2) {//the same as adding the layer but it removes the number if its 2 layrs
$("#nodeNum").text("");
}
});
/** change the nodeNum label when selecting the networks layer*/
$('#layers').change(function () {
$("#nodeNum").text(nodeCount[nodeCount.length - $('#layers').val()]);
})
/** whenever you type different learning rate in lrRate it will change the learningRate*/
$('#lrRate').on('input', function() {
learningRate = parseFloat($('#lrRate').val());
});
/** set the mini batch whenever you type something different it will change minibatch, also it protects from
writing to high number*/
$('#miniBatch').on('input', function() {
if(inputData.length >= parseInt($('#miniBatch').val())){
minibatch = parseInt($('#miniBatch').val());
}else if(inputData.length < parseInt($('#miniBatch').val())){
setMiniBatch();
}
});
/** pressing "Do data normalization" normalizes the data input and displays it on the table*/
$("#norml").click(function(){
let arrayColumn = (n) => inputData.map(x => x[n]);//take a column of input array
//do the Rescaling (min-max normalization)
for(let i = 0; i < inputData[0].length; i++){
let colum = arrayColumn(i);
let max = Math.max.apply(null, colum);
let min = Math.min.apply(null, colum);
let div = max - min;
for(let j = 0; j < inputData.length; j++) {
inputData[j][i] = (inputData[j][i] - min) / div;
}
}
//copy to the shuffle arrays and remove ability to press the button, becauce you do normalization once
shuffleInput, shuffleOut = copyArrays(inputData, expectedOutput);
document.getElementById('norml').disabled = true;
//this is bad implementation, but if its 150 elements then it is Iris database, I dont
//think anyone will enter 150 elements by hand
if(inputData.length >= 150){
tableChangeIris(table);
}else {
tableChange(table);//if its less then 150 elements then use simple table population function
}
});
/** whenever you type different gradient momentum in gradMomentum it will change the momentumSpeed*/
$('#gradMomentum').on('input', function() {
momentumSpeed = parseFloat($('#gradMomentum').val());
});
/** whenever you type different number of iterations in numIta it will change the numerOfIta*/
$('#numIta').on('input', function() {
numerOfIta = $('#numIta').val();
});
/** add a node to the selected layer*/
$("#nodeAdd").click(function(){
//if not null and there are less then 6 nodes in a layer
if($('#layers').val() != null && nodeCount[nodeCount.length - $('#layers').val()] < 6) {
nodeCount[nodeCount.length - $('#layers').val()]++;//add a node
nodeAddAndSubCombination();
}
});
/** lunches backpropogation, updates line graph and updates costNum*/
$("#backProp").click(function(){
let ans = combine();
updatePredictedTable(ans, table);
if(loss.length < 6000){
drawChart();
}else{//if the chart has more then 6000 elements, remove half of it
loss = loss.slice(loss.length*0.5, loss.length+1);
drawChart();
}
draw();
$("#costNum").text(loss[loss.length-1][1]);
});
/** remove a node to the selected layer*/
$("#nodeSub").click(function(){
//if not null and there are less then 6 nodes in a layer
if($('#layers').val() != null && nodeCount[nodeCount.length - $('#layers').val()] > 1) {
nodeCount[nodeCount.length - $('#layers').val()]--;
nodeAddAndSubCombination();
}
});
/** adds info from each input field to the input and output array*/
$("#addInfo").click(function(){
let temp = [];//this holds temporary array data
for(let i = 0; i < nodeCount[nodeCount.length-1]; i++){
temp.push(parseFloat($('#' + i.toString()).val()));//add input value to the temp array
$('#' + i.toString()).val("");
}
inputData.push(temp);//push temp array to the end of the input array
//the same just for output array
temp = [];
for(let i = nodeCount[nodeCount.length-1]; i < nodeCount[0] + nodeCount[nodeCount.length-1]; i++){
temp.push(parseFloat($('#' + i.toString()).val()));
$('#' + i.toString()).val("");
}
expectedOutput.push(temp);
updateInputTable(inputData[inputData.length-1], expectedOutput[expectedOutput.length-1], expectedOutput[expectedOutput.length-1].length, table);
shuffleInput, shuffleOut = copyArrays(inputData, expectedOutput);
setMiniBatch();
});
/**make the dataset buttons change class when pressed*/
$('.chooseData').click(function(e) {
if (!$(this).hasClass("active")) {
$('.chooseData').not(this).removeClass('active');
$(this).toggleClass('active');
e.preventDefault();
}
});
/**when the user presses on "Your own data" prepares the data arrays, shows additional parameters
* and redraws the table
*/
$("#ownData").click(function(){
document.getElementById("hideInput").style.display = "block";
document.getElementById("addInfo").style.display = "block";
document.getElementById('norml').disabled = false;
nodeCount = [1,1];
customDataManipulation();
setMiniBatch();
isOwnInput = true;
removeSoftmax();
drawChart();
//and it resets the learning rate
document.getElementById("lrRate").value = "0.01";
learningRate = 0.01;
});
/** removes a node and a column from the input layer and table when you press the "-" button next to
* Number of different inputs:
*/
$("#inputMin").click(function(){
if(nodeCount[nodeCount.length-1] > 1){//if more then one input
removeInputs();
nodeCount[nodeCount.length-1]--;//remove the node
$("#inputNum").text(nodeCount[nodeCount.length - 1]);
customDataManipulation();
}
});
/** adds a node and a column from the input layer and table when you press the "+" button next to
* Number of different inputs:
*/
$("#inputAdd").click(function(){
removeInputs();
nodeCount[nodeCount.length-1]++;//adds the node
$("#inputNum").text(nodeCount[nodeCount.length - 1]);
customDataManipulation();
});
/** removes a node and a column from the output layer and table when you press the "-" button next to
* Number of different outputs:
*/
$("#outputMin").click(function(){
if(nodeCount[0] > 1){//if more then one output
removeInputs();
nodeCount[0]--;//removes a node
$("#outputNum").text(nodeCount[0]);
customDataManipulation();
}
if(nodeCount[0] < 2){//if there is less then 2 outputs softmax is not needed
removeSoftmax();
}
});
/** adds a node and a column from the output layer and table when you press the "+" button next to
* Number of different outputs:
*/
$("#outputAdd").click(function(){
removeInputs();
nodeCount[0]++;//adds a node
$("#outputNum").text(nodeCount[0]);
customDataManipulation();
if(nodeCount[0] > 1){//if there is more then 1 output you can use softmax
document.getElementById("softhide").style.display = "block";
}
});
/**when the user presses on "AND" button prepares the data arrays, weights, table and other nuances*/
$("#AND").click(function(){
expectedOutput = [[1],[0],[0],[0]];
AND_ORdatas();
});
/**when the user presses on "OR" button prepares the data arrays, weights, table and other nuances*/
$("#OR").click(function(){
expectedOutput = [[1],[1],[1],[0]];
AND_ORdatas();
});
/**when the user presses on "Iris flower dataset" button prepares the data arrays,
* weights, table, enables softmax and other nuances
*/
$("#flower").click(function(){
removeInputs();
nodeCount = [3, 4];
inputData = [[6.1, 2.8, 4.7, 1.2],
[5.7, 3.8, 1.7, 0.3],
[7.7, 2.6, 6.9, 2.3],
[6.0, 2.9, 4.5, 1.5],
[6.8, 2.8, 4.8, 1.4],
[5.4, 3.4, 1.5, 0.4],
[5.6, 2.9, 3.6, 1.3],
[6.9, 3.1, 5.1, 2.3],
[6.2, 2.2, 4.5, 1.5],
[5.8, 2.7, 3.9, 1.2],
[6.5, 3.2, 5.1, 2.0],
[4.8, 3.0, 1.4, 0.1],
[5.5, 3.5, 1.3, 0.2],
[4.9, 3.1, 1.5, 0.1],
[5.1, 3.8, 1.5, 0.3],
[6.3, 3.3, 4.7, 1.6],
[6.5, 3.0, 5.8, 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3.8, 1.6, 0.2],
[6.9, 3.1, 5.4, 2.1],
[5.9, 3.0, 4.2, 1.5],
[6.5, 3.0, 5.2, 2.0],
[5.7, 2.6, 3.5, 1.0],
[5.2, 2.7, 3.9, 1.4],
[6.1, 3.0, 4.6, 1.4],
[4.5, 2.3, 1.3, 0.3],
[6.6, 2.9, 4.6, 1.3],
[5.5, 2.6, 4.4, 1.2],
[5.3, 3.7, 1.5, 0.2],
[5.6, 3.0, 4.1, 1.3],
[7.3, 2.9, 6.3, 1.8],
[6.7, 3.3, 5.7, 2.1],
[5.1, 3.7, 1.5, 0.4],
[4.9, 2.4, 3.3, 1.0],
[6.7, 3.3, 5.7, 2.5],
[7.2, 3.0, 5.8, 1.6],
[4.9, 3.1, 1.5, 0.1],
[6.7, 3.1, 5.6, 2.4],
[4.9, 3.0, 1.4, 0.2],
[6.9, 3.1, 4.9, 1.5],
[7.4, 2.8, 6.1, 1.9],
[6.3, 2.9, 5.6, 1.8],
[5.7, 2.8, 4.1, 1.3],
[6.5, 3.0, 5.5, 1.8],
[6.3, 2.3, 4.4, 1.3],
[6.4, 2.9, 4.3, 1.3],
[5.6, 2.8, 4.9, 2.0],
[5.9, 3.0, 5.1, 1.8],
[5.4, 3.4, 1.7, 0.2],
[6.1, 2.8, 4.0, 1.3],
[4.9, 2.5, 4.5, 1.7],
[5.8, 4.0, 1.2, 0.2],
[5.8, 2.6, 4.0, 1.2],
[7.1, 3.0, 5.9, 2.1]];
expectedOutput = [[1., 0., 0.],
[0., 1., 0.],
[0., 0., 1.],
[1., 0., 0.],
[1., 0., 0.],
[0., 1., 0.],
[1., 0., 0.],
[0., 0., 1.],
[1., 0., 0.],
[1., 0., 0.],
[0., 0., 1.],
[0., 1., 0.],
[0., 1., 0.],
[0., 1., 0.],
[0., 1., 0.],
[1., 0., 0.],
[0., 0., 1.],
[1., 0., 0.],
[1., 0., 0.],
[0., 0., 1.],
[0., 1., 0.],
[0., 0., 1.],
[0., 1., 0.],
[0., 0., 1.],
[0., 0., 1.],
[0., 0., 1.],
[0., 0., 1.],
[0., 0., 1.],
[0., 1., 0.],
[0., 1., 0.],
[0., 1., 0.],
[0., 1., 0.],
[1., 0., 0.],
[0., 1., 0.],
[0., 1., 0.],
[0., 0., 1.],
[1., 0., 0.],
[0., 1., 0.],
[0., 1., 0.],
[0., 1., 0.],
[0., 0., 1.],
[1., 0., 0.],
[1., 0., 0.],
[0., 1., 0.],
[0., 1., 0.],
[1., 0., 0.],
[0., 0., 1.],
[0., 0., 1.],
[1., 0., 0.],
[0., 0., 1.],
[1., 0., 0.],
[0., 0., 1.],
[1., 0., 0.],
[0., 1., 0.],
[0., 0., 1.],
[1., 0., 0.],
[0., 1., 0.],
[0., 1., 0.],
[0., 1., 0.],
[1., 0., 0.],
[0., 0., 1.],
[0., 1., 0.],
[0., 1., 0.],
[0., 1., 0.],
[1., 0., 0.],
[0., 1., 0.],
[1., 0., 0.],
[0., 0., 1.],
[0., 1., 0.],
[1., 0., 0.],
[0., 0., 1.],
[0., 1., 0.],
[0., 0., 1.],
[0., 0., 1.],
[1., 0., 0.],
[1., 0., 0.],
[0., 0., 1.],
[1., 0., 0.],
[0., 1., 0.],
[1., 0., 0.],
[0., 0., 1.],
[0., 1., 0.],
[0., 1., 0.],
[1., 0., 0.],
[1., 0., 0.],
[0., 1., 0.],
[0., 0., 1.],
[0., 1., 0.],
[0., 1., 0.],
[1., 0., 0.],
[1., 0., 0.],
[0., 0., 1.],
[1., 0., 0.],
[0., 0., 1.],
[0., 0., 1.],
[1., 0., 0.],
[0., 1., 0.],
[0., 1., 0.],
[0., 0., 1.],
[0., 0., 1.],
[0., 1., 0.],
[0., 1., 0.],
[0., 1., 0.],
[1., 0., 0.],
[0., 0., 1.],
[0., 1., 0.],
[0., 0., 1.],
[0., 0., 1.],
[0., 1., 0.],
[1., 0., 0.],
[1., 0., 0.],
[0., 0., 1.],
[1., 0., 0.],
[0., 0., 1.],
[0., 1., 0.],
[0., 0., 1.],
[1., 0., 0.],
[0., 0., 1.],
[1., 0., 0.],
[1., 0., 0.],
[1., 0., 0.],
[0., 1., 0.],
[1., 0., 0.],
[1., 0., 0.],
[0., 1., 0.],
[1., 0., 0.],
[0., 0., 1.],
[0., 0., 1.],
[0., 1., 0.],
[1., 0., 0.],
[0., 0., 1.],
[0., 0., 1.],
[0., 1., 0.],
[0., 0., 1.],
[0., 1., 0.],
[1., 0., 0.],
[0., 0., 1.],
[0., 0., 1.],
[1., 0., 0.],
[0., 0., 1.],
[1., 0., 0.],
[1., 0., 0.],
[0., 0., 1.],
[0., 0., 1.],
[0., 1., 0.],
[1., 0., 0.],
[0., 0., 1.],
[0., 1., 0.],
[1., 0., 0.],
[0., 0., 1.]];
tableChangeIris(table);
document.getElementById("softhide").style.display = "block";//shows softmax options
switchingBetweenDatas();
});
/** if relu is selected the make isRelu true and any other false*/
$("#relu").change(function(){
if( $(this).is(":checked") ){
isIdentity = false;
isTanh = false;
isSigmoid = false;
isRelu = true;
loss = [];
}
});
/** if Sigmoid is selected the make isSigmoid true and any other false*/
$("#Sigmoid").change(function(){
if( $(this).is(":checked") ){
isIdentity = false;
isTanh = false;
isSigmoid = true;
isRelu = false;
loss = [];
}
});
/** if identity is selected the make isIdentity true and any other false*/
$("#identity").change(function(){
if( $(this).is(":checked") ){
isIdentity = true;
isTanh = false;
isSigmoid = false;
isRelu = false;
loss = [];
}
});
/** if tanh is selected the make isTanh true and any other false*/
$("#tanh").change(function(){
if( $(this).is(":checked") ){
isIdentity = false;
isTanh = true;
isSigmoid = false;
isRelu = false;
loss = [];
}
});
/** if Softmax is not selected make isSoftmax false*/
$("#noSoft").change(function(){
if( $(this).is(":checked") ){
isSoftmax = false;
}
});
/** if Softmax is selected make isSoftmax true*/
$("#yesSoft").change(function(){
if( $(this).is(":checked") ){
isSoftmax = true;
}
});
/** if automatic learning rate picker is selected to yes then doLRoptimization true */
$("#yesAuto").change(function(){
if( $(this).is(":checked") ){
doLRoptimization = true;
genereateW();
momentumSpeed = 0.9;
}
})
/** if automatic learning rate picker is selected to no then doLRoptimization false */
$("#noAuto").change(function(){
if( $(this).is(":checked") ){
doLRoptimization = false;
genereateW();
}
})
});