Although I must agree the topic discussed here is not beginner friendly, the way you explained a lot of the details and even went back one point to reiterate what you wrote for the train ai script was extremely well done. Thank you for the tutorial!
@krit68472 жыл бұрын
Im addicted to your tutorials, keep it up Tim!
@kamakura9722 Жыл бұрын
Sammeee
@Djellowman Жыл бұрын
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 Жыл бұрын
Coming back to this, it turns out genetic algorithms get stuck in a local minimum, with absolutely no way to get out of it. This minimum means that the model only learns to keep the paddle at the same height as the ball... So it's seemingly impossible to train a competent AI for Pong using a genetic algorithm if the above strategy stops working once the ball speeds up. Perhaps reinforcement learning would work, but i don't see how that would get out of the same local minimum.
@Seedx Жыл бұрын
@@Djellowmanweird, genetic algorithms are supposed to avoid local minimums. Is the speciation implemented correctly?
@Apify2 жыл бұрын
Happy to support Tim's videos - keep up the great work! :)
@astrovation32812 жыл бұрын
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.
@jamieharper5665 Жыл бұрын
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 😁
@fhtagn202 жыл бұрын
Your tutorials have really helped me improve my programming skills Tim in a way I can't put in words. Thank you so much!
@ShubhAgarwal__2 жыл бұрын
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
@TomDoesTech2 жыл бұрын
This is so cool! Awesome tutorial
@kiat47972 жыл бұрын
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
@Nimnimpac2 жыл бұрын
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.
@HcmfWice2 жыл бұрын
Yeah, I’ve noticed this as well. Also, genome1 only plays on the left side (and the last genome only plays on the right), while all the other genomes play on both side. A simple fix would be to iterate over the whole range in both the outer and inner loop, and in the inner loop make sure that the two IDs are different (if you don’t want the genomes to play against themselves). It really says something about the robustness of evolutionary genetic algorythms that it still produced a genome that plays well.
@ezb_ai2 жыл бұрын
Liked and subscribed. Thank u so much for the knowledge, kind sir.
@samurai-capybara2 жыл бұрын
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
@eitanshpigler80722 жыл бұрын
Hey Tim, thanks for the great video. Would love to see more cool things with AI and NEAT
@lorenzofiore74384 ай бұрын
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.
@mindofpaul9543 Жыл бұрын
This was an awesome tutorial and a great way to dip my toes into learning machine learning. Thanks for the video!
@xucr05162 жыл бұрын
Love ur vids. Because of you i am getting better and better in python. I just started like 5 days ago and i made an own made command prompt!
@krishnakeshari48582 жыл бұрын
Rly
@xucr05162 жыл бұрын
@Shinero Oh man
@gidartsproduction54392 жыл бұрын
Thanks for the tutorial, I have been waiting for this...
@Tafawaq2 жыл бұрын
Tim is such an amazing teacher , how can i support this channel financially?? love from syria
@goranjosic2 жыл бұрын
I'm working on my first NEAT AI project, and this tutorial is very helpful because the documentation is quite scarce. Before this video, I watched a NEAT AI video by sentdex channel, and it's quite bad compared to this one - his video is literally a copied example from the documentation, without any new explanations - it's just not worth watching, it's better to read the documentation, than to watch his video - my experience. Overall, good tutorial!
@xGino_n2 жыл бұрын
thank you so much!, was hard to find a cool & easily understandable tutorial.
@namashaggarwal74302 жыл бұрын
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. 加油 ❤️
@heelercs2 жыл бұрын
I have a feeling that he won't due to the ethical concerns.
@namashaggarwal74302 жыл бұрын
@@heelercs don't know man, but this technology is kinda cool and futuristic. If we could master it and combine with the 3D modelling and printing to create human looking AI robots, then the world could turn into a Terminator
@heelercs2 жыл бұрын
@@namashaggarwal7430 Agreed, it is really cool technology. Unfortunately it's almost always seen as a harmful technology (for now). I doubt Tech With Tim would want to publicly associate with something that's almost always associated with pornography.
@namashaggarwal74302 жыл бұрын
@@heelercs every technology in the world has 2 sides , one is positive and second is negative. To exemplify, nuclear technology can be used for destruction of a nation using nuclear bomb but on the other side, the same thing can be used as an excellent carbonless energy source for the construction of the humankind. We must need to make certain rules and protocols for each and everything to keep a positive balance. It all depends on us, how we make use of it.
@heelercs2 жыл бұрын
@@namashaggarwal7430 I never disagreed with that. However, just because two sides exist doesn't mean they hold equal weight. To use your own example, surely you don't think that the positives and negatives of nuclear bomb technology is equal? There's definitely much more potential negative harm than positive harm. Since we're going to extremes, gas chambers are another example. Surely you don't think the positive and negative are equivalent, right? So my point still stands.
@jantonisito10 ай бұрын
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.
@Global_Reality-bcn Жыл бұрын
Thank you a lot Tim, I really appreciate your work, the way you explain is phenomenal, I am a fan of your programming videos please keep them coming. kind regards,
@HypnosisBear2 жыл бұрын
Great tutorial Tim.
@karlbooklover2 жыл бұрын
Saw this coming on your GitHub so I activated notifications here 🌚
@Ghazalli2 жыл бұрын
Thank you, it was great, please continue the same path and take more NEAT videos for us 👌🏽🙏🏽
@anthonydawson9700 Жыл бұрын
Very good and a lot of hard work! Thanks 🙂
@maspot77182 жыл бұрын
Love the way you explain things
@jeremyheng85732 жыл бұрын
good explanation! wish to watch more video about reinforcement leaning in python
@filippostazi45022 жыл бұрын
you are the number one, fantastic video
@teaqllabs61742 жыл бұрын
Hi Tim! My name is Ian and I am a 16 year old developer, right now I am working on a compiled multipurpose programming language from scratch in C and I was wondering if you could maybe check it out. That would really make my whole day. But if not, I totally understand. -Ian
@Ta_3-k8n2 жыл бұрын
Thank you so much Tim, this is so valuable, could you make another one on AI plays Snake game that would so helpful.
@Djellowman Жыл бұрын
Protip for viewers: use multiprocessing to train the model use all your cores in parallel
@Djellowman Жыл бұрын
Using
@guillaumerousseau9549 Жыл бұрын
Impressive work, thanks a lot for sharing this
@samuelbouhanik10045 ай бұрын
this is an awesome video, thank man
@AlexDevQa2 жыл бұрын
Tim - the best!
@nobertwekesa89232 жыл бұрын
Nice vid. Had to stop everything to watch this👍
@drydenstewartenterprises2 жыл бұрын
Hey Tim, Thanks for the video! I was wondering though, because you used NEAT with flappy bird, and now with pong, is neat used just for games? I've been learning Python through you and Sentex and neuralnines videos for the past 2 years and I have learned a lot but I still have a long way to go, I am interested in building some of my own small robots and I am wondering if you would ever work on a series about incorporating computer vision with a voice assistant and some form of AI (maybe neat?) so my little robots can recognize objects and people, and tell you that it has recognized those objects or people?
@ravenblackspike2 жыл бұрын
NEAT would probably not be useful in that particular use case. You would be better served by a couple of discrete models with code that passes your inputs to the models. Something like the below. 1) Computer Vision model for object recognition. 2) Speach recognition model, TTS model for the voice commands and output. 3) Whatever code you would need to handle moving the robot/passing inputs to your models.
@hubowenstudent35992 жыл бұрын
A great CV model would be YOLOv5
@arnavgupta2400 Жыл бұрын
Thanks!
@KhazaeeTech2 жыл бұрын
The video was very useful. Please use neat more in the videos. I watch almost all of your videos, but AI is very useful. Please provide a complete neat tutorial.👏🏽
@marcusberge83782 жыл бұрын
Really good video!
@hazelNoFake2 жыл бұрын
I am not going to do some beginner coder stuff. I'm jumping right into this (like people who jump from an easy demon to an extreme demon)
@aowowow-no1xe8 ай бұрын
Note: You can turn off the pygame drawing to speed things up
@___OmerAJ___ Жыл бұрын
❤❤❤
@bellpepper_red Жыл бұрын
thanks for the epic project Tim! I had 0 knowledge of ML but I still had fun following along, and learned many things on the way. Knowledge_of_ML +=1
@lawson13102 жыл бұрын
Woww, a dream come true 😍
@manfredsteyn2 жыл бұрын
Fantastic work. Impeccable teaching abilities. Learning a lot from your videos. Thank You!
@georgenjeru96272 жыл бұрын
Daamn,. How did you become so great in programming..?.
@universecode11012 жыл бұрын
Difficult but cool 👍🏻
@Lahmeinthehouse2 жыл бұрын
The way you say VIDEO 😂😂 it’s your signature !!
@ethitlan2 жыл бұрын
Hey Tim, I have a question. Does the frame rate you train it with affect its performance? I've been training it with no frame rate cap for a long a time until I played against it and it wasn't as good as I hoped. So then I changed the frame rate and (although it was humanly impossible for me to play the game) the AI did MUCH better at receiving the ball. What do you think?
@Djellowman Жыл бұрын
good question. yes it does affect the performance, as it gets more input and actions per second if you have a higher tickrate. But i'm surprised to hear it's a big difference.
@Djellowman Жыл бұрын
actually, if your tickrate is tied to the framerate, it shouldn't matter. It means the game speeds up as your tickrate increases. So actually, no it should be identical during training and playing against you.
@ethitlan Жыл бұрын
@@Djellowman oooh then perhaps my tickrate was different. Thanks for answering Tim!
@BentleyKingToebeansOwenRhett5 ай бұрын
Pretty neat
@online.python.dersim Жыл бұрын
thanks clear explanation
@babitabarman25822 жыл бұрын
Hey Tim when does new time out with Tim podcast comming
@nicom98532 жыл бұрын
Huh, very interesting! I'm guessing this can be used on any kind of supervised learning as well?
@ChrisJames-tf8yw8 ай бұрын
Awesome video. Now can the AI be created that moves the ball x,y position. The future should be code-less apps. I want to try make a Python training that would make the AI generate the ball x,y coordinates for the game. But could this be done without coding as well? Could an AI be trained to watch a pong game and then be used to train the AI to control the ball x,y?
@Gunsi-kb2xq2 жыл бұрын
for me it creates only 1 ID per generation... is this OK? Tried your code as well but aways only 1 ID after every generation...
@FireFly9692 жыл бұрын
Thank you
@soul-igion72212 жыл бұрын
So, I am a neophyte for Pycharm & Tensorflow ,,, May i please be provided with "Tutorial videos on how to run models in "PYCHARM" which are listed on Tensorflow website. I tried to run Image Classification Model but it's running till "Visualize Training Results" in PYCHARM & after that it's not showing any result for "Overfitting, DataAugmentaion, And Code parts". I tried to search but didn't found any relevant result for issue. If this doubt is not clear to me , I can't start my Tensorflow Developer Certificate Exam.
@iancardona3719 Жыл бұрын
amazing tutorial tim! tho i'm having trouble why am I getting negative values in my population average fitness; what could be the problem?
@danilotrix2 жыл бұрын
This was amazing. Thanks so much. 1 question. What about rewards? You didn’t mention it or I missed it. How do they learn the right movement to do? Thanks
@NinjaTxGaming2 жыл бұрын
Reward is the fitness variable. Tim set the reward to the number of balls hit in total throughout all the games.
@Djellowman Жыл бұрын
it's not reinforcement learning
@visiblecode52382 жыл бұрын
Nice
@visiblecode52382 жыл бұрын
@♜ Pinned by Tech With Tim shut up bot
@ninek19022 жыл бұрын
Hey Tim, I have a question about the oscilating best fitnesses... How is it possible for best fitness to drop in comparison to last generation if there is elitism involved? In your config the elitism parameter is set to 2, which means 2 of the most fit individuals from each species will get pasted in the next generation (according to neat-python docs), thus the algorithm is not supposed to score lower than their previous score...
@mmdrlolfr26122 жыл бұрын
I think it's because if the first genome gets a mutation, his fitness can decrease and if nobody has exceeded the previous best fitness, the global fitness will just decrease. Or maybe it's because the first direction of the ball in pong in random and maybe the first genome got an extremely good luck and that didn't happen later.
@tcgvsocg14582 жыл бұрын
You hav to show how can remove ia for player to play against and generate differente type of ia (norma,l hard, easy
@frosbee63442 жыл бұрын
Hi thanks for your work. Can This also work in Jupiter notebook?
@gzbin3652 жыл бұрын
cool!
@Kennethlumor2 жыл бұрын
Please and please I request you make video on how to use multiple databases in flask
@0Clappy2 жыл бұрын
Please update the code on Github to the finalized file, I attempted to follow along step by step but too many errors occurred and I ended up with a frankenstein mashup of code.
@reyhane22666 ай бұрын
I've been trying to implement this, so far I've had 197 generations ran and the best fitness till now was 23, is this normal? is it supposed to take that long?
@SkyFly198532 жыл бұрын
How about A.I. tutorial for chess game in Python?
@TheTheuhh2 жыл бұрын
Can you teach us how to create a forum website?
@nobbytho2 жыл бұрын
your flappy bird video is taken down?
@MachineLearner-p7k3 ай бұрын
Can anybody tell me whether this will be good project that to be kept in our resume ??
@PP-tc1zp2 жыл бұрын
Hi, thank you. It is very interesting. I made simple modification wchich allow play with player and check ai in 1 game session with dynamic switch between player and ai. If you want I can put this on github. So who is better you or ai ;)
@0Clappy2 жыл бұрын
What program are you using to draw?
@leonardsmith98702 жыл бұрын
Wow, this is neat! Lol.
@karma_senpai2 жыл бұрын
Most of The People get bored when doing there favorites thing sometimes. I have a question that did you get bored doing programming sometimes.
@mayman84152 жыл бұрын
pls make a vid on burnout
@stefanlin50862 жыл бұрын
whn I run test_ai the ai dosent move at all
@stefanlin50862 жыл бұрын
@♜ Pinned by Tech With Tim dont worry got it fixed
@pravachanpatra40122 жыл бұрын
1:05:00
@rayankhan122 жыл бұрын
Thanks 😊 :) (I was wondering if it's possible to write a Python code that would automatically send birthday messages to my WhatsApp contacts?)
@ElPsyVega Жыл бұрын
17:20 hehe
@lrnzdc71992 жыл бұрын
Please make a video on licenses, no one talks about them! There isn't a decent video to watch.
@codesaif80752 жыл бұрын
Hey Tim, Can you Explain how can i make logic in programming?, like when i start wrting code i have no idea what to write in first line i get so confused, How do you do it?, how can be good in coding like you?
@BlhJ4002 жыл бұрын
Hey thanks so much for the informations, I am just wandering JavaScript or python ? Someone says python slow others says it has many libraries but I don't get it . Everything is confusing and there's no clear path to start, I really want your help, thanks 🙏 you are the best
@sintax92862 жыл бұрын
holy shitfuck, this is amazing * _ *
@karamsabbagh74652 жыл бұрын
What's the point of making an AI for ping pong for this kind of games you van just make a simple bot that's impossible to loose and it's faster, easier, no need to wait the AI to learn, You can simply make the paddle follow the y position of the ball and you can make some modernization and let it predict the ball balance of the walls and here you go easy and so simple !
@TechWithTim2 жыл бұрын
To learn how to train ais to play games and examine the behaviour!
@karamsabbagh74652 жыл бұрын
@@TechWithTim Ah yeah got it but I think working on a harder game would be good and reasonable like if I saw your AI I would think it like a simple bot. But anyways I got it you want to start easy and learn then make something reasonable. And btw I really think that making an AI for snake is really good for multiple reasons (because making a snake AI with a snake(Python) is great XD).
@MnM_rulz2 жыл бұрын
Hey Tim, can you please teach how to download dlib and face_recognitiom PLEASE. Thank you
@MnM_rulz2 жыл бұрын
Please teach how to download face recognition
@DGHere122 жыл бұрын
second
@coolguy71602 жыл бұрын
10th comment
@shalevforfor55509 ай бұрын
Just make a bot . You have a ball and make another one that go faster then him or a line that go and just when the second ball is > then the bot x so then just move to he's y no need an AI for this
@xidiffiyt79866 ай бұрын
this is just about learning how to use ai
@walney2008 Жыл бұрын
please speak IA play game chess
@PP-tc1zp2 жыл бұрын
Booster to improve performance, mutch faster: for genome_id2, genome2 in genomes[random.randrange(i+1):]:
@adityaraina7727 Жыл бұрын
Thanks!
@shalevforfor55509 ай бұрын
Just make a bot . You have a ball and make another one that go faster then him or a line that go and just when the second ball is > then the bot x so then just move to he's y no need an AI for this