r/javascript 15d ago

Browser based AI algorithm

https://github.com/joshuadam/NEAT-JavaScript

I recreated an AI algorithm that visually learns in the browser:) It's based on the NEAT algorithm:
https://github.com/joshuadam/neat-javascript
https://neat-javascript.org/

1 Upvotes

21 comments sorted by

View all comments

Show parent comments

2

u/joshuaamdamian 14d ago

Cool that you are so excited about the algorithm! It's really interesting for sure.

u/lonelycprogrammer already explained it well but for some extra info:
I highly recommend reading the original paper called "Evolving Neural Networks through Augmenting Topologies" by Kenneth O. Stanley and Risto Miikkulainen.

It is a beautiful algorithm that is quite easy to follow and understand, it is based on evolution. Like already mentioned, the algorithm starts of with tiny networks, and slowly adjusts and grows these networks. Adds nodes, connections, "mutate" weights etc.
It's very interesting to see this happening in real time.

The algorithm basically consists of:

  1. Generate AIs
  2. Evaluate the AIs and see how well they perform against a given problem
  3. Generate new AIs by "evolving" the best (expand upon, combine and make changes to them hoping they get better) and copy these into a new "generation"
  4. Go back to step 2 and repeat until a satisfactory solution has been found.

There is of course more to it but this is what it comes down to!

It is a very interesting and cool algorithm to me. Evolution has been a core aspect of our own development, it would only make sense to prove useful for Artificial Intelligence as well. It's awesome to see others feel the same!

And like u/ufukty mentioned I highly recommend watching the MarI/O video from SethBling too, it's awesome!

Thanks!

1

u/kigory2 14d ago

Thanks alot bro am new to neural network and am looking into somthing called lc0 it's popular you definitely know about it and am even considering contributing to this project.. Well if I actually learn hey give me time its my first day of learning bymyself and thx for everybody including you for explaining everything and Claude helped me alot navigate the repos

2

u/joshuaamdamian 14d ago

That's awesome man:)! And lc0 as in leelachess? That's too cool! Chess engines are really interesting!
Best of luck! If you need any help in the future feel free to e-mail me anytime at [[email protected]](mailto:[email protected])
(I learned most of my machine learning knowledge myself aswell, so I know what it feels like to learn everything yourself!)

1

u/kigory2 14d ago

Thanks man, yes LeelaChess. BTW I always hated machine learning because of chat bots and I always scroll through machine learning courses free trail ads bs and i always thought it was chat bots which ate shitty and I already know how they work but know I dived into it it's way better than the regular consumer market which is just oh this is better than chatgpt and Claude is the best and preplexty and this bs but now I've realized that I can't talk trash about somthing I don't know about. Thanks for the support :)