Published
Edited
Apr 13, 2022
Insert cell
# Brain.js Issue #348
Insert cell
{
const net = new brain.NeuralNetwork({
inputSize: 1,
hiddenLayers: [1],
outputSize: 1
});
net.initialize();
const json = net.toJSON();
const newNet = new brain.NeuralNetwork();
newNet.fromJSON(json);
newNet.train([
{ input: [1], output: [1] },
{ input: [1], output: [1] }
]);
return newNet.toJSON();
}
Insert cell
Insert cell

Purpose-built for displays of data

Observable is your go-to platform for exploring data and creating expressive data visualizations. Use reactive JavaScript notebooks for prototyping and a collaborative canvas for visual data exploration and dashboard creation.
Learn more