35

I was curious about how the Genetic Algorithm works, wanted to try it out.

So I've created some toy cars using Three.js and "asked" them to do the self-parking with a little bit of Genetic Algorithm help.

It was fun to see how those toy cars were evolving and actually started to be less stupid :D

Here are some more details:
https://trekhleb.dev/blog/2021/...

Comments
  • 1
    Man, I liked your "give X to the car" illustrations

    Easily the nicest blog article read in recent times 👌🙏👍❤️👏
  • 0
    @asgs Cool! I'm glad that it was easy to grasp
  • 0
    Wow. That is neat. I wonder how hard it would be to give the steering more resolution and make it work with servos for a self driving model car.

    I barely understand how this works to be honest.
  • 2
    I parked it on mobile. 👌
  • 0
    @iSwimInTheC wow, 0.1 score!
  • 0
    @irene the steering wheel limits are configurable in code, so technically it is possible to make the car more maneuverable, yes.
  • 4
    I've been running your training algorithm for 2 days now, my 7-year-old (very ADHD) son has been mesmerized by it. He begs me to see how the cars are doing every few hours. I've managed to sneak in a few lessons about "this is how genetic algorithms work" by asking him to start walking around the room, and all I say to him is "bad job" or "good job". He keeps returning to the starting point until he finally lands on the point in the room I want him to go. He's so excited about this, I may have just sparked his love of software development.

    My wife and I have been trying to convince him for weeks that being home-schooled would be better than his current public school education. We already homeschool his 12 year old brother. Watching him get drained by public education is really difficult on us as the school he is in really really sucks. Seriously, he looked at my wife today and said "I want to be homeschooled now". I think you just changed my kid's life.
  • 1
    22 generations in, and it still isn't parking. Time will tell!
  • 1
    I love watching this stuff.

    But not live.

    I'd make a video with some highlights if I were you and wanted to show it off.
  • 1
    Do you have a YT channel?
    Would love to subscribe to you.
Add Comment