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

More tests!

Open shiffman opened this issue 7 years ago • 9 comments

Neural Network class needs tests?

  • [ ] test feed forward?
  • [ ] test backprop?

shiffman avatar Feb 10 '18 15:02 shiffman

One problem with that is that node needs to import the matrix lib into nn and i haven't found a way to bypass the browser error with the require statement.. otherwise i would be happy to do some tests.

AR-234 avatar Feb 11 '18 19:02 AR-234

Well I guess this should eventually move to a more proper build system, but for now would a solution like I'm doing here work, but with require instead?

if (typeof module !== 'undefined') {
  module.exports = Matrix;
}

shiffman avatar Feb 11 '18 19:02 shiffman

There is also still the solution by me in #13 to rely on ES6 which plays fine with browsers. It would remove the if completly (but has as stated in that PR other side effects)

MTRNord avatar Feb 11 '18 19:02 MTRNord

Thank you for this reminder @MTRNord, apologies I haven't had the time yet to learn more about ES6 modules and review in more detail.

shiffman avatar Feb 11 '18 19:02 shiffman

@shiffman no problem :) take your time to learn it 👍 It isn't urgent to have it but it is a "Nice to have" from my perspective :)

MTRNord avatar Feb 11 '18 19:02 MTRNord

ah ok, awesome, and the typeof approach doesn't work, because Matrix is defined but i guess i will try the ES6 thing

AR-234 avatar Feb 11 '18 19:02 AR-234

@AR-234 keep in mind what I wrote in my PR the ES6 way doesn't work "out of the box" until the PR is merged. (thats the side effect)

MTRNord avatar Feb 11 '18 20:02 MTRNord

but maybe there should be a building process: if the lib keeps expanding and stuff like a class for training methods get added, or even more advanced stuff, it could get really bad with the readability of the file

AR-234 avatar Feb 11 '18 20:02 AR-234

I remember something being mentioned about the Neural network library being expanded to include a flexible number of hidden layers. If that's true, it would help to know what that looks like before tests are written. There are a few ways it could be implemented.

Adil-Iqbal avatar Feb 13 '18 16:02 Adil-Iqbal