@l33z3r The output from a brain.js neural network is not binary, and is an array of continuous values from 0 to 1. I see for your input you are using discrete values (like 2, 3, etc.), those need to be continuous as well, scaled from 0 to 1 as an example (like 0.6).

I was just playing around with the libraby trying to get a better understanding. I wanted to simply model a linear function y = 2*x

but I think the problem in my example is I am using integers that are not scaled!

thanks for the reply, great work on the library!

I am going to use it to run an AI air hockey agent.

written with box2d

If you have any advice on this, any help would be appreciated!

Actually, when I use the following training data, the network still will not learn the mapping:

net.train([{input: [.01], output: [.02]},

{input: [.02], output: [.04]},

{input: [.03], output: [.06]},

{input: [.04], output: [.08]}]);

{input: [.02], output: [.04]},

{input: [.03], output: [.06]},

{input: [.04], output: [.08]}]);