Toy-Neural-Network-JS
Toy-Neural-Network-JS copied to clipboard
More tests!
Neural Network class needs tests?
- [ ] test feed forward?
- [ ] test backprop?
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.
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;
}
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)
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 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 :)
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 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)
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
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.