You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Below is the JavaScript translation. To make it a bit more readable I extracted the sigmoid function and its derivative, which can be mapped to the elements of a matrix using matrix.map(fn).
The code in this post is functionally equivalent to A Neural Network in 11 lines of Python. The JavaScript translation was originally written by @lucidrains.
Vectorious is an open-source linear algebra library which I am currently maintaining. We'll use it as a replacement for Python's numpy.
This is the source presented at the top of the Python article:
Below is the JavaScript translation. To make it a bit more readable I extracted the sigmoid function and its derivative, which can be mapped to the elements of a matrix using
matrix.map(fn)
.Almost the same and above code can be used both in Node.js and the browser! The final prediction is in the
l2
variable and should be close toy
.Here is the full example with comments.
The text was updated successfully, but these errors were encountered: