Toy-Neural-Network-JS icon indicating copy to clipboard operation
Toy-Neural-Network-JS copied to clipboard

Unexpected behavior on adding multiple hidden layers

Open renansd opened this issue 6 years ago • 1 comments

I've modified the NeuralNetwork code so the class constructor receives the number of hidden layers and the number of nodes per hidden layer, also modifying the guess and training functions to work with multiple hidden layers. It seems to work but, in the XOR example, as I create NNs with increasing number of hidden layers, the results come back wrong more and more frequently, to the point of at 5 hidden layers I always get wrong answers. Is it something I should expect or maybe there's something wrong with my implementation? My code: https://pastebin.com/iF8UVhSU

renansd avatar Jul 31 '19 16:07 renansd

I have not looked at your code so there could be something wrong there but I have experienced with my own from-scratch NN that for simple tasks like XOR having lots of hidden layers makes it worse.

GypsyDangerous avatar Jul 31 '19 16:07 GypsyDangerous