-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathGRU_recurrent_neural_network .html
executable file
·78 lines (51 loc) · 1.28 KB
/
GRU_recurrent_neural_network .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
<!DOCTYPE html>
<html>
<head>
<title>GRU</title>
<meta name="description" content="">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<!-- D3.js -->
<script src="https://cdnjs.cloudflare.com/ajax/libs/d3/3.5.6/d3.min.js"></script>
<!-- jQuery -->
<script type="text/javascript" src="jquery.js"></script>
<!-- Plotly.js -->
<script src="https://cdn.plot.ly/plotly-latest.min.js"></script>
<script type="text/javascript" src="matrix.js"></script>
<script type="text/javascript" src="GRU.js"></script>
</head>
<body>
<h1>recurrent neural network</h1>
<p id = "input" >input =[[0,1,1,1,0,1,0,1,0,1]]</p>
<p id = "result" ></p>
<div id="myDiv1" style="width:600px;height:400px;"></div>
<script type="text/javascript">
var input = [[0,1,1,1,0,1,0,1,0,1]];
var iter = 0;
var trace2 = {
x: [],
y: [],
mode: "lines+markers",
type: "scatter"
};
var layout = {
title: "Loss",
};
var data1 = [trace2];
Plotly.plot("myDiv1", data1,layout);
var point = 0;
var cal;
function plot1(){
trace2.y.push(F[1]);
trace2.x.push(iter);
point++;
Plotly.redraw("myDiv1");
iter += 1;
}
function plot(){
F = GRU(input);
plot1();
}
var ssss = setInterval(function(){ plot()}, 250);
</script>
</body>
</html>