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

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