-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathindex.html
95 lines (82 loc) · 2.69 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
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>Vanilla JS Neural Network</title>
<style>
.flex {
display: flex;
}
#cy, #myChart {
width: 500px;
height: 500px;
margin: 0 auto;
position: relative;
}
.chart-container {
margin-bottom: 20px;
}
.cy-container {
position: relative;
}
.container {
position: relative;
width: 1024px;
max-width: 100%;
margin: 0 auto;
}
.source {
text-align: center;
margin-top: 10px;
}
@media (max-width: 1023px) {
.flex {
flex-direction: column;
}
#cy, #myChart {
width: calc(90vw);
height: calc(90vw);
margin: 0 auto;
position: relative;
}
}
</style>
</head>
<body>
<div class="container">
<div>
<button onclick="runEpochs(1000)">Run 1000 epochs</button>
<h2>Epochs: <span id="epochs">0</span></h2>
<h2>Cost/Loss: <span id="loss">-</span></h2>
<button onclick="window.location.reload()">Restart</button>
<select id="select" onchange="setActivationFunction()">
<option value="softplus" selected>Softplus</option>
<option value="relu">ReLu</option>
<option value="sigmoid">Sigmoid</option>
<option value="tanh">Tanh</option>
</select>
</div>
<div class="flex">
<div class="chart-container">
<h2>Neural Network Outputs</h2>
<div class="graph">
<canvas id="myChart" width="350" height="350"></canvas>
</div>
</div>
<div class="cy-container">
<h2>Neural Network Graph</h2>
<div id="cy"></div>
</div>
</div>
<p class="source">
<a href="https://github.com/matheusR42/vanilla-js-neural-network" target="_blank">Source Code and References</a>
</p>
</div>
<script src="https://cdn.jsdelivr.net/npm/[email protected]/dist/chart.min.js"
integrity="sha256-bC3LCZCwKeehY6T4fFi9VfOU0gztUa+S4cnkIhVPZ5E=" crossorigin="anonymous"></script>
<script src="https://cdn.jsdelivr.net/npm/[email protected]/dist/cytoscape.min.js"></script>
<script src="main.js"></script>
</body>
</html>