fanntom
v1.1.0
Published
FANN (Fast Artificial Neural Network) bindings for Node.js that use MongoDB to store information
Downloads
15
Maintainers
Readme
fanntom
FANN (Fast Artificial Neural Network Library) bindings for Node.js that use MongoDB to store information.
FANN is a free open source neural network library, which implements multilayer artificial neural networks with support for both fully connected and sparsely connected networks.
This project is based off of the node-fann and the node-simple-fann projects.
Installation
Requirements
Make sure you have
glib2
,pkg-config
,node-gyp
andnan
installed GLOBALLY, as well as a suitable C++ compiler.You will need FANN version >= 2.2.0 (libfann2).
Install
Download this package into your “node_modules” folder and rename to just ‘fanntom’.
CD into the directory.
Run “node-gyp configure” and “node-gyp build”.
Implementation example
var fanntom = require('fanntom/build/Release/fanntom');
var net = new fanntom.standard(2,3,1);
var data = [
[[0, 0], [0]],
[[0, 1], [1]],
[[1, 0], [1]],
[[1, 1], [0]],
];
net.train(data, {error: 0.00001});
console.log("xor test (0,0) -> ", net.run([0, 0]));
console.log("xor test (1,0) -> ", net.run([1, 0]));
console.log("xor test (0,1) -> ", net.run([0, 1]));
console.log("xor test (1,1) -> ", net.run([1, 1]));