test neural network library

0

I was testing the library link , this is my code

var synaptic = require('synaptic'); // this line is not needed in the browser
var A = synaptic.Neuron();
var B = synaptic.Neuron();
A.project(B);
A.activate(0.5); // 0.5
B.activate(); // 0.3244554645

copy it from the git

but he tells me

  

Can not read property 'project' of undefined

install it like this: npm install synaptic --save

and so is my project tree:

    
asked by hubman 23.11.2016 в 15:12
source

1 answer

2

You have forgotten to use new .

var A = new synaptic.Neuron();
var B = new synaptic.Neuron();

Look for the documentation .

    
answered by 23.11.2016 / 15:34
source