karpathy / convnetjs

Deep Learning in Javascript. Train Convolutional Neural Networks (or ordinary ones) in your browser.
MIT License
10.86k stars 2.04k forks source link

Prevent Regression Layer from being NaN #93

Open thomaswmanion opened 6 years ago

thomaswmanion commented 6 years ago

Since x.w[i] or yi can yet be defined, if it is invalid math, we should set the change in y to 0.

This caused a lot of NaN's in brain otherwise.