harthur / brain

Simple feed-forward neural network in JavaScript
MIT License
8.01k stars 857 forks source link

I don't know why but this line doesn't work var sizes = _([inputSize, hiddenSizes, outputSize]).flatten(); #54

Open bitplanets opened 9 years ago

bitplanets commented 9 years ago

this

 var sizes = _([inputSize, hiddenSizes, outputSize]).flatten();

returns a lodash wrapper instance instead of an array. Please do this instead:

var sizes = _.flatten([inputSize, hiddenSizes, outputSize]);

If not your lib is not usable with lodash

https://github.com/harthur/brain/blob/6b58dc24d151f7d57b9c370a7ace4a0f883907d6/lib/neuralnetwork.js#L99

also at line 527.