-
Notifications
You must be signed in to change notification settings - Fork 1
/
index.html
170 lines (150 loc) · 4.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
161
162
163
164
165
166
167
168
169
170
<!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>Real time predictions</title>
<!-- CSS -->
<link rel="stylesheet" href="./css/estilos.css" />
<!-- Importar TensorFlow.js -->
<script src="https://cdn.jsdelivr.net/npm/@tensorflow/tfjs@1.7.4/dist/tf.min.js"></script>
<!-- Importar tfjs-vis Visualizacion-->
<script src="https://cdn.jsdelivr.net/npm/@tensorflow/tfjs-vis@1.0.2/dist/tfjs-vis.umd.min.js"></script>
</head>
<body>
<header>
<nav class="navbar">
<div class="container-nav">
<img class="logo" src="./img/stats.png" />
<h1>Linear regression using Neural Networks</h1>
</div>
</nav>
</header>
<main class="container">
<section class="section-container">
<h2>Real time predictions</h2>
<p>
This is a linear regression based on a neural network model.
<br />
For this demo I am using one hidden layer for predict the cost of a
<br />
house given a number of rooms.
</p>
</section>
<section class="section-container half-container">
<h2>How does it works:</h2>
<div class="input-container">
<label for="visor">1. Open the visor to see the data:</label>
<input
type="button"
class="btn-action"
value="Open visor"
name="visor"
onclick="showData();"
/>
</div>
<div class="input-container">
<label for="train">2. Train the model:</label>
<input
type="button"
name="train"
class="btn-action"
id="train"
value="Train"
onclick="trainModel();disableButton(this)"
/>
</div>
<div class="input-container">
<label for="stop">3. Stop the training:</label>
<input
type="button"
name="stop"
class="btn-action"
id="stop"
value="Stop"
onclick="stopTraining=true;disableButton(this)"
/>
</div>
<div class="input-container">
<label for="show">4. Show the predictions:</label>
<input
type="button"
name="show"
class="btn-action"
id="show"
value="Show"
onclick="verCurvaInferencia();disableButton(this)"
/>
</div>
<!--When you click on Train the model, the training loop will start <br>
and on the right side you will see how the learning process is evolving,<br>
if you feel satisfied with the loss and mse values, then Stop the training <br>
go to the Visor tab and Show the predictions!-->
</section>
<section class="section-container">
<div class="important-note">
<h2>📌 Important</h2>
<p>
The model can improve its performance by increasing
<!-- <br /> -->
the iteration number during the training stage.
<!-- <br /> -->
So if you want, you can restart the training
<!-- <br /> -->
and let the model train a little bit more.
</p>
</div>
<input
class="btn-restart"
type="button"
value="Restart"
onclick="restart();"
/>
</section>
<section class="section-container">
<h2>Did you like the results?</h2>
<div class="save-container">
<label for="save">Then Save the model so you can use it later.</label>
<input
type="button"
name="save"
class="btn-save"
value="Save model"
onclick="guardarModelo();"
/>
</div>
<h3>Or if you want, you can also evaluate your own model</h3>
<div class="input-loader">
<label for="json">JSON File</label>
<input type="file" name="json" class="btn-loader" id="upload-json" />
</div>
<div class="input-loader">
<label for="binary">Binary File</label>
<input
type="file"
name="binary"
class="btn-loader"
id="upload-weights"
/>
</div>
<input
type="button"
class="btn-upload"
value="Upload model"
onclick="cargarModelo();"
/>
</section>
</main>
<footer>
<div class="container-nav-footer">
<h4>
Made with ❤️ by María José Medina as a part of the
TensorFlow.js Platzi course
</h4>
</div>
</footer>
<!-- Script que hace que todo valga la pena xD -->
<script src="script.js"></script>
</body>
</html>