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

Multi Hidden Layer Support (another proposal)

Open maksuel opened this issue 7 years ago • 2 comments

I refactoried the entire nn.js code.

NO CONFLICTS

Please, do not hesitate to improve! Reference: #61 EXAMPLE: https://maksuel.github.io/Toy-Neural-Network-JS/examples/doodle_classification/ (the example use 2 hidden layers)

/**

  • Constructor method.
  • The user can enter with parameters (integer) to create a new NeuralNetwork,
  • where: the first parameter represents the number of inputs, the second
  • (or more) parameter represents the number of hidden nodes and the last
  • parameter represents the number of outputs of the network.
  • The user can copy an instance of NeuralNetwork by passing the same as an
  • argument to the constructor.
  • @param {NeuralNetwork|...Integer} args (Rest parameters) */

maksuel avatar Mar 30 '18 22:03 maksuel

We would like to integrate something like this hopefully in the near future. Dan would like to do a little bit more in his streams with the simplified network first.

I'm curious why you chose to store the weights in a separate array instead of storing them in the layer objects.

Versatilus avatar Apr 13 '18 13:04 Versatilus

Vesatilus,

I was looking for a more semantic way to store the variables. That was the beginning of code refactoring. I just updated the project in the most semantic way I found, made it easier to read the methods and reduce the amount of loops.

maksuel avatar Apr 15 '18 10:04 maksuel