Skip to content

Instantly share code, notes, and snippets.

@liashchynskyi
Created December 25, 2018 15:32
import {NeuralNetwork} from './nn'
import {matrix} from 'mathjs'
const input = matrix([[0,0], [0,1], [1,0], [1,1]]);
const target = matrix([[0], [1], [1], [0]]);
const nn = new NeuralNetwork(2, 4, 1); //
nn.train(input, target);
console.log(nn.predict(input));
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment