html
html
1
2
3
4
5
6
7
8
9
10
<!DOCTYPE html>
<html>
<head>
<title>Page Title</title>
<script src="https://cdnjs.cloudflare.com/ajax/libs/brain/0.6.3/brain.min.js"></script>
</head>
<body>
</body>
</html>
Enter to Rename, Shift+Enter to Preview
css
css
1
2
3
body {
}
Enter to Rename, Shift+Enter to Preview
js
js
1
2
3
4
5
6
7
8
9
10
11
12
const net = new brain.NeuralNetwork({hiddenLayers:[3]});
const trainingData = [
{input: [0,0], output: [0]},
{input:[0,1], output: [1]},
{input: [1,0], output: [1]},
{input:[1,1], output: [0]}
]
net.train(trainingData);
alert(net.run([0,0]));
Enter to Rename, Shift+Enter to Preview
BROWSER
Console
Run