-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathindex.html
106 lines (88 loc) · 4.75 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
<!DOCTYPE html>
<html>
<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>TensorFlow.js Linear Regression</title>
<link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/materialize/1.0.0/css/materialize.min.css">
<link href="https://fonts.googleapis.com/icon?family=Material+Icons" rel="stylesheet">
<script src="https://cdn.jsdelivr.net/npm/@tensorflow/[email protected]/dist/tf.min.js"></script>
<script src="https://cdn.jsdelivr.net/npm/@tensorflow/tfjs-vis"></script>
<script src="./tensorflow.js"></script>
</head>
<body>
<!-- Header -->
<div class="section no-pad-bot" id="index-banner">
<div class="container">
<h5 class="header center blue-text small">Linear regression with TensorFlow.js</h5>
<div class="row center">
<h6 class="header col s12 light">Train a model to predict house price from living space.</h6>
</div>
</div>
</div>
<!-- Misc buttons -->
<div class="section no-pad-bot light-blue lighten-4">
<div class="container">
<div class="row center">
<button id="toggle-button" class="waves-effect waves-light light-blue btn-small"
onclick="toggleVisor()">Toggle Visor</button>
<br /><br />
</div>
</div>
</div>
<!-- Main functionality -->
<div class="container">
<div class="section">
<div class="row">
<!-- Training -->
<div class="col s12 m6">
<div class="icon-block">
<h3 class="center light-blue-text"><i class="material-icons"
style="font-size: 2em">build</i></h3>
<h5 class="center">Train & Test</h5>
<p class="light"></p>
<div>
<p><label>Training status:</label></p>
<pre class="grey lighten-4"
style="overflow-x: auto"><em id="model-status">Loading data...</em></pre>
<p><label>Testing status:</label></p>
<pre class="grey lighten-4"
style="overflow-x: auto"><em id="testing-status">Not yet tested</em></pre>
<button autocomplete="off" id="train-button"
class="waves-effect light-blue waves-light btn" disabled onclick="train()">Train New
Model</button>
<button autocomplete="off" id="test-button"
class="waves-effect light-blue waves-light btn" disabled onclick="test()">Test
Model</button>
</div>
<br />
<div>
<button autocomplete="off" id="load-button"
class="waves-effect light-blue waves-light btn-small" disabled onclick="load()">Load
Model</button>
<button autocomplete="off" id="save-button"
class="waves-effect light-blue waves-light btn-small" disabled onclick="save()">Save
Model</button>
</div>
</div>
</div>
<!-- Prediction -->
<div class="col s12 m6">
<div class="icon-block">
<h3 class="center light-blue-text"><i class="material-icons"
style="font-size: 2em">timeline</i></h3>
<h5 class="center">Predict</h5>
<label>Square feet of living space: <input type="number" id="prediction-input"
placeholder="2000" /></label>
<button autocomplete="off" id="predict-button"
class="waves-effect light-blue waves-light btn" disabled onclick="predict()">Predict
house price</button>
<p><strong id="prediction-output"></strong></p>
</div>
</div>
</div>
</div>
</div>
</body>
</html>