Python Pong AI Tutorial - Using NEAT

preview_player
Показать описание
Welcome back to another video! At the beginning of this video you'll see an AI teaching itself how to play the game of Pong. It's doing it by using an algorithm called NEAT which stands for Neuro Evolution of Augmented Topologies. Now in this video I'm going to explain how this works and implement into this game! While it is focused on Pong, you can take what you learn and implement it into other projects, so I hope you enjoy and learn from this video!

📄 Resources 📄

⭐️ Timestamps ⭐️
00:00:00 | Pong AI Demo
00:02:02 | Setup & Installation
00:05:32 | Pong Game Walkthrough
00:09:44 | Playing Pong
00:18:35 | NEAT Explanation
00:32:38 | NEAT Config File
00:36:54 | NEAT Setup
00:42:35 | NEAT Training Methodologies
01:05:24 | Training Our AI
01:09:03 | Testing Our AI

◼️◼️◼️◼️◼️◼️◼️◼️◼️◼️◼️◼️◼️◼️

◼️◼️◼️◼️◼️◼️◼️◼️◼️◼️◼️◼️◼️◼️

⭐️ Tags ⭐️
-Tech With Tim
-Python Pong
-AI Tutorial
-Python AI Tutorial
-NEAT
-NEAT Explanation

⭐️ Hashtags ⭐️
#TechWithTim #Python #Pong
Рекомендации по теме
Комментарии
Автор

Happy to support Tim's videos - keep up the great work! :)

Apify
Автор

Im addicted to your tutorials, keep it up Tim!

krit
Автор

To those implementing this: you will need the x and y velocity of the ball too if you use a ball speedup-mechanic (like i do) where the ball moves faster than the paddles. then it's not enough to simply keep the paddle y the same as the ball y, you need the velocity so it can predict where the ball will go.

Djellowman
Автор

Thank you so much! I've never done anything with AI before, so even if this is hard for me it'll probably be very educational.

astrovation
Автор

Amazing video thank you! Had an issue with the data printing but then realised I was just being impatient and needed to wait lol. I can't tell you how useful this was as an introduction to neural networks for me 😁

jamieharper
Автор

Your tutorials have really helped me improve my programming skills Tim in a way I can't put in words. Thank you so much!

fhtagn
Автор

Liked and subscribed. Thank u so much for the knowledge, kind sir.

ezb_ai
Автор

Just finished the video. I can't wait to actually start writing some code. Firstly on pong and next on some random game i'll find. The cool part about neural networks is that they do all of the hard work for you by optimizing the output without knowing what it is going to be used for. They just adjust weights and biases waiting for a treat 😂. Unfortunally for genetic algorithms they are going to die without being rewarded 😢😂. Thank you for the video.

lorenzofiore
Автор

Love your videos! I'm going to use what I've learned from this and your Flappy Birds series to build an AI for a 2D fighting game.... taking me one step closer to Skynet

samurai-capybara
Автор

Bro I was looking some tutorial to make a pong ai using python at 2 days later ur video is here love it and don't know how you know what the views want thnx alot

ShubhAgarwal__
Автор

Hey Tim, thanks for the great video. Would love to see more cool things with AI and NEAT

eitanshpigler
Автор

love ur videos tim . i have been Following u for a long time ( probably 3 years ). i love how u're explaining various concepts clearly and smoothly and i would love to see u creating a ray casting engine or ray tracing engine in pygame . a lot of fun math ( linear algebra, geometry ... ) and some cool physics concepts to discover while coding it

kiat
Автор

Awesome video,
Could you please make a series of DeepFakes technology using Python from beginner to Advanced with all concepts and it's mechanism.
Thanks alot, I follow all your videos and really appreciate your hard work. 加油 ❤️

namashaggarwal
Автор

Maybe you could do part to and analyze how those NNs evolve. The key point for me was that some randomly generated set of connections will produce some output (three numbers) . We CHOOSE to interpret these numbers as movement of the paddles - order of stay/up/down is arbitrary. Once we chose some interpretation we apply it to paddle movements and we asses if given NN (given genome) actually makes good decisions (is more fit). What is completely elusive for me is how they make a decision to merge network topologies - without some actual analysis what changes in structure could be responsible for performance improvement - how do you pick up what to merge? Either way very good tutorial - thanks!

PS. If your generation runs slow definitely turn of screen rendition during training - program runs ~30 times faster. Also I found out that limiting exchanges (hits) to less than a suggested 100 speeds up hitting the target fitness. With 70 limit I hit 430 fitness in 18 generations.

jantonisito
Автор

Thank you so much Tim, this is so valuable, could you make another one on AI plays Snake game that would so helpful.

abdell_rb
Автор

This was an awesome tutorial and a great way to dip my toes into learning machine learning. Thanks for the video!

mindofpaul
Автор

Tim is such an amazing teacher, how can i support this channel financially??
love from syria

Tafawaq
Автор

If I am correct in around 49:50 you lower later genomes fitness. Lets say we have 3 genomes. We set genome1 fitness to 0 in first for loop then in second for loop test it against genome2 and genome3. After this genome1 has fitness 10, genome2 fitness 4 and genome3 fitness 6. The we go to genome2 and set it fitness to 0 but due to second for loop " in genomes[i+1:]" genome2 wont play against genome1 now only against genome3 so it will have lower fitness.

Nimnimpac
Автор

Thanks for the tutorial, I have been waiting for this...

gidartsproduction
Автор

thank you so much!, was hard to find a cool & easily understandable tutorial.

xGino_n