28
loading...
This website collects cookies to deliver better user experience
A neural network is a series of algorithms that endeavors to recognize underlying relationships in a set of data through a process that mimics the way the human brain operates. In this sense, neural networks refer to systems of neurons, either organic or artificial in nature.
// provide optional config object (or undefined). Defaults shown.
const config = {
binaryThresh: 0.5,
hiddenLayers: [3],
activation: 'sigmoid',
};
const net = new brain.NeuralNetwork(config);
net.train([
{
input: [0, 0],
output: [0],
},
{
input: [0, 1],
output: [1],
},
{
input: [1, 0],
output: [1],
},
{
input: [1, 1],
output: [0],
},
]);
const output = net.run([1, 0]); // [0.987]