-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathindex.html
47 lines (38 loc) · 1.76 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
<!DOCTYPE html>
<html>
<head>
<script src="//treetopflyer.github.com/vcore/lib.js"></script>
<script src="lib.js"></script>
</head>
<body>
<script>
var trainingSet, observationSet;
var rbm;
trainingSet = [];
trainingSet.push([0, 0, 0, 0, 0, 1, 1, 1, 1, 1]);
trainingSet.push([0, 0, 0, 0, 0, 1, 1, 0, 1, 1]);
trainingSet.push([0, 0, 0, 0, 0, 0, 1, 1, 1, 1]);
trainingSet.push([0, 0, 0, 0, 1, 0, 1, 1, 1, 1]);
trainingSet.push([1, 1, 1, 1, 1, 0, 0, 0, 0, 0]);
trainingSet.push([1, 0, 1, 1, 1, 0, 0, 0, 0, 0]);
trainingSet.push([1, 0, 1, 0, 1, 0, 0, 0, 0, 0]);
trainingSet.push([1, 1, 1, 1, 1, 0, 0, 0, 0, 0]);
trainingSet.push([0, 0, 0, 0, 1, 1, 1, 1, 1, 0]);
trainingSet.push([0, 0, 0, 0, 0, 1, 1, 1, 1, 1]);
trainingSet.push([0, 0, 0, 0, 0, 0, 1, 0, 1, 1]);
trainingSet.push([0, 0, 0, 0, 1, 0, 1, 1, 1, 0]);
trainingSet.push([1, 1, 1, 1, 1, 0, 0, 0, 1, 0]);
trainingSet.push([1, 1, 1, 0, 1, 0, 0, 0, 0, 0]);
trainingSet.push([1, 0, 1, 1, 1, 1, 0, 0, 0, 0]);
trainingSet.push([1, 1, 1, 1, 1, 0, 0, 0, 0, 0]);
observationSet = [];
observationSet.push([1, 1, 1, 1, 1, 0, 0, 0, 1, 0]);
observationSet.push([1, 0, 1, 1, 1, 1, 0, 0, 0, 0]);
observationSet.push([1, 1, 1, 1, 0, 1, 0, 1, 0, 0]);
observationSet.push([0, 0, 0, 0, 0, 1, 1, 0, 1, 1]);
rbm = RBM.Create(10, 2);
RBM.Train(rbm, trainingSet, 100, 1, 0.1);
console.log(RBM.Label(rbm, observationSet));
</script>
</body>
</html>