Neural Network Cars and Genetic Algorithms (1/2)

Поделиться
HTML-код
  • Опубликовано: 3 окт 2024
  • First attempt on teaching neural networks to drive a car. The architecture of each neural network consists on three layers with five, six and four neurons respectively and the evolution is done using uniform cross-breeding and random mutation.
    Part 2:
    • Neural Network Cars an...
    Background Music by Trevor Lentz:
    opengameart.or...

Комментарии • 98

  • @kehtabpeg
    @kehtabpeg 3 года назад +30

    I wish cars could speed up at the cost of turning radius and lap time would be counted instead of just progress

    • @seven_chords
      @seven_chords 3 года назад +1

      i mean, he shared the source code, i want to make something similar to this but am too lazy to code the base game, so i'll prob. use his base game and create my own ai for said base game, including average speed and lap time for the fitness, and probably some basic form of speed/turningradius factor to the gameplay

    • @seven_chords
      @seven_chords 3 года назад +1

      and you can do it yourself as well if you know the basics of python and machine learning

    • @readysetpython
      @readysetpython  3 года назад +1

      @@seven_chords I would like to see this in action lol so let me know when you finish it or if you need a hand with the code (it's a little bit messy, sorry).

    • @seven_chords
      @seven_chords 3 года назад

      @@readysetpython well, i got your code running (and fixed the 130+ coding style errors pycharm was showing me to make the code a bit cleaner), but i'll probably do my own game and use yours only as a rough proof of concept, since converting your system to tensorflow (which is what i want to use, see my comment on the second part) would be about as much work as designing a new one specifically made for tensorflow, also will add a different system for score calculation for the individual cars that's going to be based on checkpoints that are spread evenly around the track to make the cars actually go forward, try to complete the track and try to improve track time as well, and i might use this as a chance to develop my own mobile game and offer the ML trained car ai as a forth difficulty to race against called "impossible", we'll see how far i get before i run out of coffee 😉

    • @seven_chords
      @seven_chords 3 года назад

      @@readysetpython also if you want to check out the changes i made to your code (e.g. the automatic breeding stuff based on the score which worked decently well as well as setting a minimum speed for turning to avoid cars spinning in place and force a minimum velocity so cars don't stand still in the middle of the track) i have forked your repo to my github, you should be able to access it when looking at the forks of your repo

  • @MaximeFAYEMaxouMask
    @MaximeFAYEMaxouMask 3 года назад +2

    I'm actually impress how well it does. Normally for this kind of situation you'd use reinforcement learning with "q learning" but your method of mix of nn + genetic algorithm seems to work very well

  • @CardZoneMax
    @CardZoneMax 3 года назад +4

    Big fan of using neural networks! You should try adding a competitive element like racing to see how that impacts their risk taking

  • @sportingpatria5143
    @sportingpatria5143 3 года назад +6

    Great performance, interesting game, keep it up bro!

  • @MrSquareart
    @MrSquareart 3 года назад +1

    Very very nice video!!! Found your video on reddit post

  • @theredditextract7297
    @theredditextract7297 3 года назад +2

    Keep the vids coming!

  • @halihammer
    @halihammer Год назад

    Nice work!

  • @EnglishRain
    @EnglishRain 3 года назад +1

    Amazing presentation! Love it!

  • @bonniewhy
    @bonniewhy 3 года назад +1

    This is so amazing. Those cars are so cuuute. Haha. Go cars go!

  • @chirag2005
    @chirag2005 3 года назад +1

    This can be even more amazing if the game engine can be configured to make the cars collide each other. The neural network can soon learn not only to stay on track but to also avoid other cars

  • @lordty9488
    @lordty9488 3 года назад

    Honestly this is so amazing, well explained concept !

  • @artbyact
    @artbyact 3 года назад +1

    Woah very interesting experimental game you have here. Thumbs up!

  • @nikolanemanja3487
    @nikolanemanja3487 3 года назад +1

    Great video

  • @RodolpheBelouin
    @RodolpheBelouin 3 года назад

    This is a really great experiment!

  • @khalidogilbee1540
    @khalidogilbee1540 3 года назад

    Very interesting concept, explained very well

  • @A6GYT
    @A6GYT 3 года назад

    Cool video and concept

  • @TittuStudyClass
    @TittuStudyClass 3 года назад

    great video

  • @dartme18
    @dartme18 3 года назад

    Wow, there are so many ways to improve this! 1: Instead of the lines keeping their orientation with the car, maybe like 15 lines coming out from all directions and they stay north, east, south, etc. (not rotate with the car) and one line that comes out the front of the car. Also, of course, try to get the fastest time. Maybe you will find cars doing proper chicane after a while! Also, they tend to prefer right turns (and staying by the right side of the track) I think because the first turn in the course is a right turn, so that was over-trained.
    Excellent idea, great execution, and compelling video!

  • @realbobphilips
    @realbobphilips 3 года назад

    Awesome work!!

  • @shaks_17
    @shaks_17 3 года назад

    This is some very interesting stuff, keep it up

  • @colucas4562
    @colucas4562 3 года назад

    Great vid I can’t wait for more

  • @ravinchowdhury5215
    @ravinchowdhury5215 3 года назад +2

    Awesome! Are you planning on making the code public?

  • @cameronygriffony.5731
    @cameronygriffony.5731 3 года назад

    Interesting stuff man

  • @n00bieplays2
    @n00bieplays2 3 года назад +1

    seems promising 👍

  • @LFAceBoogie
    @LFAceBoogie 3 года назад +1

    fireeeee

  • @jest31tv
    @jest31tv 3 года назад +1

    Great game

  • @allisons617
    @allisons617 3 года назад +1

    Keep it up

  • @lelsonmclel1207
    @lelsonmclel1207 3 года назад

    Nice stuff

  • @naveenbandarage
    @naveenbandarage 3 года назад

    This is soo good.

  • @francescobertini5044
    @francescobertini5044 3 года назад +1

    This is really beautiful if you could share the code I would love to try more complex cases... Congrats

  • @maliktv21
    @maliktv21 3 года назад

    Nice video, i am from reddit

  • @Omnicia17
    @Omnicia17 3 года назад +2

    Why not just do selection based on track distance traveled (rather than manually)

    • @Omnicia17
      @Omnicia17 3 года назад +2

      @checker fascinating, I never thought of that, I suppose I would need to better understand the inputs to understand why. However it is an interesting commentary on the role of randomness in natural selection (sometimes the weak do survive).
      Perhaps there could be a random selection process that gives an increasing bias towards those who have the longest track distance (note: not travel distance)

  • @supergreen5855
    @supergreen5855 3 года назад

    GOOD VIDEO

  • @SherwoodBotsford
    @SherwoodBotsford 3 года назад

    Interesting. Next step. Avoid other cars.
    Get them to the point they can complete an arbitrary track.
    Now select for two things: Speed in doing the track (You will have to add some physics to car motion) And Collision avoidance with other cars. Breed a set of avoiders, and a set of speeders, then hybridize them. This is how real genetics work. Select for one trait at a time then hybridize.

  • @tjdamelio1894
    @tjdamelio1894 3 года назад

    This is cool!

  • @10seclifequotes
    @10seclifequotes 3 года назад

    interesting stuff keep it up👍

  • @rs9130
    @rs9130 Месяц назад

    How about reinforcement learning

  • @Jera-dq6ey
    @Jera-dq6ey 3 года назад +1

    Hi, excellent implementation I love it.
    What game or virtual ambient is that ?
    Where can I find more information about your NN architecture? I would like try and do some experiments ¿can you share the code please ?

    • @readysetpython
      @readysetpython  3 года назад

      Hey, thank you.!
      It's all written in python using pygame module.
      The nn is a fixed 5, 6 and 4 neurons respectively sized network, i'm working on the code to make it more nice looking lol
      Hope this helped

    • @Jera-dq6ey
      @Jera-dq6ey 3 года назад

      @@readysetpython hi thanks for reply.
      I know that you use 5x6x4 NN but What framework o library did you used tu build that ? Keras ? Fastai? Pytorch? Tflearn? Tensorflow?
      And about the genetic algorithm, did code by yourself ? Or used a another python library?

  • @zyenapz
    @zyenapz 3 года назад

    Awesome!

  • @jacobnapkins1155
    @jacobnapkins1155 3 года назад +1

    Whoa

  • @recklezzreacts4062
    @recklezzreacts4062 3 года назад

    Wowzers your brilliant ‼️‼️‼️‼️

  • @steve101968
    @steve101968 3 года назад +1

    Code bullet has something similar

  • @vincevo1520
    @vincevo1520 3 года назад

    good videoo

  • @FatherWhoGames
    @FatherWhoGames 3 года назад

    Reminds .e of another RUclipsr I watch that knows coding. Keep it up

  • @jeaywilson2168
    @jeaywilson2168 3 года назад

    This is cool

  • @bernadettewinder
    @bernadettewinder 3 года назад

    Awesome

  • @lewisalbertwilliams
    @lewisalbertwilliams 3 года назад

    Nice!

  • @DanielAjoy
    @DanielAjoy 3 года назад +2

    Pretty cool. Great explanations and graphics. That's not deep learning though.

  • @komodo1132
    @komodo1132 Год назад

    How did you track how far they have come?

    • @readysetpython
      @readysetpython  Год назад

      Hey, I didn't. Best cars are selected by hand.

  • @DizzleDProductions
    @DizzleDProductions 3 года назад

    Cool

  • @TahirGluttony
    @TahirGluttony 3 года назад +2

    do you plan to open the source code?

    • @readysetpython
      @readysetpython  3 года назад +1

      Yeah! i'm working on the comments right now :)

    • @kossboss
      @kossboss 3 года назад

      ​@@readysetpython you are amazing! thank you!
      when did you start studying nn?

  • @themind6273
    @themind6273 3 года назад

    do some wee content

  • @kirild5638
    @kirild5638 3 года назад +1

    Do you mind to make the code public?

    • @readysetpython
      @readysetpython  3 года назад

      I'm working on some improvements and will upload it to github as soon as i finish :)

    • @kirild5638
      @kirild5638 3 года назад +1

      @@readysetpython thanks for the quick answer. I am excited to see it :)

    • @kirild5638
      @kirild5638 3 года назад +1

      @@readysetpython whats is your git?

    • @readysetpython
      @readysetpython  3 года назад

      @@kirild5638 I haven't created one for the channel yet but as soon as i finish upgrading the game i will and upload the code. I promise you will be the first one to know when i do lol, it shouldn't take more than a few days

    • @kirild5638
      @kirild5638 3 года назад +2

      @@readysetpython Mr. Repost - seems like you never gonna create a github, since you just use others code. Maybe you can give credits to the one who wrote that stuff?

  • @mijimelon
    @mijimelon 3 года назад +1

    pog

  • @KeirzyFPS
    @KeirzyFPS 3 года назад +1

    Ayy

  • @DespacitoCON
    @DespacitoCON 3 года назад

    holy shit!

  • @meezivanhoutendijk3591
    @meezivanhoutendijk3591 3 года назад

    +1 sub

  • @dubiouscode4802
    @dubiouscode4802 3 года назад

    Thanks for making this ! I watched this several times while working on a similar self driving car video. I used a racetrack shaped pretty much like yours for my video here ruclips.net/video/fpYRSOesJHw/видео.html I hope you don't mind. (I'm not actually done with the self driving yet, this is just showing off the radar and the human driving)
    Thanks!
    Dubious Insights

  • @theradicalno1
    @theradicalno1 3 года назад

    Wait who made this?

    • @theradicalno1
      @theradicalno1 3 года назад

      @SyntaxSandbox bruh I meant did he/she make this on their own

  • @anonymousguy1056
    @anonymousguy1056 3 года назад

    noice

  • @ankithaldar
    @ankithaldar 3 года назад

    Can we have the code for the same?

    • @ankithaldar
      @ankithaldar 3 года назад

      @SyntaxSandbox ok. So "the same" here refers the the instrumentation done in the video "Neural network Cars and Genetic Algorithm". Hopefully now the ambiguity of your respected comment has been removed.

  • @HomeBurger
    @HomeBurger 3 года назад +9

    >"deep learning is incredible!"
    >1 hidden layer

    • @readysetpython
      @readysetpython  3 года назад +4

      I'm sorry, still new at this :(

    • @default632
      @default632 3 года назад

      Good to know that you don't need a lot of layers. Just well trained layers.

    • @pietvandongen5783
      @pietvandongen5783 3 года назад +1

      Way to encourage someone to become more of an expert Adam :( If you want people to learn about this stuff, be nice to them. What you're doing is unwelcoming and unkind.

    • @SirCobraXI
      @SirCobraXI 3 года назад

      @@readysetpython No need to be sorry. Each problem is assumed to have it's own complexity class. If one layer completes the task, then there is no need to make it more complicated.

  • @ByteSizeBiz
    @ByteSizeBiz 3 года назад

    Hahahahaha awesome game😂

  • @gastonservetto222
    @gastonservetto222 3 года назад

    se hizo biral xd