fanntom

1.1.0 • Public • Published

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

  1. Make sure you have glib2, pkg-config, node-gyp and nan installed GLOBALLY, as well as a suitable C++ compiler.

  2. You will need FANN version >= 2.2.0 (libfann2).

Install

  1. Download this package into your “node_modules” folder and rename to just ‘fanntom’.

  2. CD into the directory.

  3. 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]));

Package Sidebar

Install

npm i fanntom

Weekly Downloads

8

Version

1.1.0

License

none

Last publish

Collaborators

  • stat1c14