Skip to content

Instantly share code, notes, and snippets.

@DaveBben
Created July 1, 2017 23:59
Show Gist options
  • Save DaveBben/c701958eaa50d3173befa2a5711d8d06 to your computer and use it in GitHub Desktop.
Save DaveBben/c701958eaa50d3173befa2a5711d8d06 to your computer and use it in GitHub Desktop.
const brain = require('brain.js');
var net = new brain.NeuralNetwork();
let ops = [
{ input: [.7], output: [.5] },
{ input: [.71], output: [.5] },
{ input: [.708], output: [.5] },
{ input: [.704], output: [.53] },
{ input: [.708], output: [.53] },
{ input: [.68], output: [.55] },
{ input: [.58], output: [.46] },
{ input: [.7], output: [.55] },
]
net.train(ops, { log: true, errorThresh: 0.0001, iterations: 50});
console.log(net.run([.62])); // 3.1 miles -- 30.6 minutes
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment