Published
Edited
Jan 15, 2021
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
{
const net = new brain.NeuralNetwork();
net.train(normalizedTrainingData, {
errorThresh: 0.00001,
iterations: 8000,
callback: step => console.log(step)
});
const jsonString = JSON.stringify(net.toJSON());
const newNet = new brain.NeuralNetwork();
newNet.fromJSON(JSON.parse(jsonString));
return (
[]
.concat(normalizedTrainingData.map(datum => net.run(datum.input)))
.concat(normalizedTrainingData.map(datum => newNet.run(datum.input)))
)
.map(output => denormalizeData(bounds, output));
}
Insert cell
Insert cell
Insert cell
Insert cell
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