Published
Edited
Apr 13, 2022
Insert cell
Insert cell
{
const net = new brain.recurrent.LSTM();
const data = [
{ input: "zero", output: "0" },
{ input: "one", output: "1" },
{ input: "two", output: "2" },
{ input: "three", output: "3" },
];
const config = {
iterations: 5000,
log: true,
errorThresh: 0.013,
};
await net.train(data, config);
return [
net.run('zero'),
net.run('one'),
net.run('two'),
net.run('three'),
];
}
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