Skip to content

derektmueller/NN.js

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

16 Commits
 
 
 
 
 
 
 
 

Repository files navigation

NN.js

A feedforward neural network class

Installation

npm install

Usage

// train an XNOR network
var nn = new NN ([2, 2, 1]); 
nn.enableGradientChecking = false;
nn.trainingSet = [
    [[0, 0], 1],
    [[0, 1], 0],
    [[1, 0], 0],
    [[1, 1], 1],
];
var Theta = nn.gradientDescent (10000, 10);
var h = nn.getH (Theta);
assert (h ([0, 0])[0] >= 0.5);
assert (h ([0, 1])[0] < 0.5);
assert (h ([1, 0])[0] < 0.5);
assert (h ([1, 1])[0] >= 0.5);

About

A feedforward neural network class

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors