Created
December 25, 2018 15:32
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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