DEV Community

Cover image for Creating of neural network using JavaScript in 7 minutes!

Creating of neural network using JavaScript in 7 minutes!

Petro Liashchynskyi on January 12, 2019

Hey, what's up 😁 Today, i'm gonna tell you how to build a simple neural network with JavaScript by your own with no AI frameworks. Let's go! For g...
Collapse
 
alin_air profile image
Alin Andrei

I haven't understood most of it. I'll be back as soon as I get it folks

Collapse
 
liashchynskyi profile image
Petro Liashchynskyi

In the next article I would try to thoroughly explain how neural network works (with math examples), if you want 😉 And you will figure it out 😁

Collapse
 
jenc profile image
Jen Chan

Same boat but still fascinating

Collapse
 
liashchynskyi profile image
Petro Liashchynskyi

Hey, check out my new article about math principles of neural networks 😀dev.to/liashchynskyi/how-neural-ne...

Collapse
 
alin_air profile image
Alin Andrei

Hey, your post widened my perception. JavaScript or not, neural networks are pretty cool. I am willing to research the subject

Thanks!

Collapse
 
jenc profile image
Jen Chan

Post almost unrelated, but I was reading a tut about tensorflow.js and this video about tensors is veyr mathy but also very good youtube.com/watch?v=f5liqUk0ZTw

Collapse
 
edo9k profile image
Eduardo França • Edited

Hi, I put the code on a RunKit notebook, for anyone who wants to see it running without having to install anything on their computer: runkit.com/edo9k/tiny-rnn

For some reason I kept getting an error in the train function, the error was output_layer is not a function, so I just wrapped the output_layer variable in an arrow function. Now it's running.

Great article, thank you.

Collapse
 
nuwannnz profile image
Nuwan Karunarathna

Wow, nice article and awesome explanation!

Collapse
 
liashchynskyi profile image
Petro Liashchynskyi

Your derivative is wrong. First, check this math.stackexchange.com/questions/7...

And this simple network can solve AND, OR, XOR, whatever. It depends on the data and the labels. Bias is simple, why don't you just google for it? 😅

Luck!

Collapse
 
thegeoffstevens profile image
Geoff Stevens

This is awesome! Very easy to follow. It's always fun to try to do things without frameworks.

Collapse
 
ondrejs profile image
Ondrej

You got deserved star on GitHub. Very good article, nice demonstration, thank you!

Collapse
 
liashchynskyi profile image
Petro Liashchynskyi

ohh, thank you so much!

Collapse
 
jenc profile image
Jen Chan • Edited

Understood everything til backprop but if this is the simplest I’m glad for the explanation! Thanks bro 🤪

Collapse
 
metcoder profile image
Carlos Fuentes

Amazing article and really well explained. Congratulations 🎊

And thanks for this!

Collapse
 
liashchynskyi profile image
Petro Liashchynskyi

thank you! 😉

Some comments have been hidden by the post's author - find out more