jarnet

0.11.22 • Public • Published

Backpropagation Algorithm

Example of usage in architecture.js file
Configuration:
{
    epochs: 90,             
    stopOnError: 0.01,      //  break iteration when achieved error
    neuronNrHidden: 2,      //  quantity of neurons in hidden layer
    learningRate: 0.2,      
    datasets: [],           //  array with data arrays with [input, input, output]
    logging: true           //  log info to console
}
Usage:
const Net = require('./');

let net = new Net();
net.setup({
    epochs: 90,
    neuronNrHidden: 2,
    learningRate: 0.2,
    datasets: [ [1, 1, 0], [0, 0, 1], [1, 0, 1], [0, 1, 1] ],
    logging: true

});
net.train();
net.test();                 //  compare trained network with provided data for training

net.predict([1, 1]);        //  => returns 0

//  saving model
net.save('trained_network.json');
net.saveSync('trained_network.json');

//  loading model
net.load('trained_network.json');
net.loadSync('trained_network.json');

ES6.
No Babel.

Package Sidebar

Install

npm i jarnet

Weekly Downloads

2

Version

0.11.22

License

ISC

Last publish

Collaborators

  • kerajon