jarnet
v0.11.22
Published
Back propagation neural net.
Downloads
15
Maintainers
Readme
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');