You can install Novabrain with npm
$ npm install novabrain --save
var Novabrain = ;var Neuron = NovabrainNeuron;var Layer = NovabrainLayer;var Network = NovabrainNetwork;var Trainer = NovabrainTrainer;var Transfer = NovabrainTransfer;var Samples = NovabrainSamples;
In the browser
You can also use the minified version to increase your web page loading
Create a network
Constructor expected an intergers suite. The first value is the input size The last value is the output size Between this values you can set many hidden size (2, 3, ..., 1)
Novabrain samples contains training and config for basics functions
Back Propagation Training
This example shows how the neural network is trained to learn XOR
var network = 21;var trainer = network;trainer;console; // [~0.05]console; // [~0.93]console; // [~0.93]console; // [~0.09]networktransfer = NovabrainTransferBOOLEAN;console; // [false]console; // [true]console; // [true]console; // [false]
The transfer functions are used to change the value of the outputs. By default, neurons uses a Logistic Sigmoid transfer. You can change those properties the following way.
networktransfer = NovabrainTransferBOOLEAN;console; // [false]console; // [true]console; // [true]console; // [false]
Return logistic sigmoid values
Return 0 or 1 values
Return boolean values like HARDLIMIT
Return sum values without transfer
Return values between -1 and 1
Export and import data
var n1 = 21;var n2 = 21;n2;// orn2;var results = n2);
Create a standalone function
By default the transfer function used is LOGISITC but you can change this by two ways. Define your custom transfer before the standalone function export or set the transfer param when you use the standalone function.
var standalone = network;var booleanResults = );
var standalone = network;var booleanResults = );var tanhResults = );
Mocha is used for unit testing
$ npm test
$ make tests
$ npm install mocha -g $ mocha
Novabrain is an Open Source project started in France by François Mathey. Anybody is welcome to contribute to the development of this project.
If you want to contribute feel free to send PR's, just make sure to run the make before submiting it. This way you'll run all the test specs and build the web distribution files.
Thank you <3