Teach AI To Play Snake – Reinforcement Learning Tutorial With PyTorch And Pygame (Part 4)

In this Python Reinforcement Learning Tutorial series we teach an AI to play Snake! We build everything from scratch using Pygame and PyTorch. In this fourth and final part we implement the neural network to predict the moves and train it.

🪁 Code faster with Kite, AI-powered autocomplete that integrates into VS Code:
https://www.kite.com/get-kite/?utm_medium=referral&utm_source=youtube&utm_campaign=pythonengineer&utm_content=description-only *

✅ Write cleaner code with Sourcery, instant refactoring suggestions in VS Code & PyCharm: https://sourcery.ai/?utm_source=youtube&utm_campaign=pythonengineer *

🚀🚀 Get monthly Python and ML Tips:
https://www.python-engineer.com/newsletter/

🚀🚀 SUPPORT ME ON PATREON:
https://www.patreon.com/patrickloeber

If you enjoyed this video, please subscribe to the channel!

Other helpful tutorials:
Part 1: https://youtu.be/PJl4iabBEz0
Anaconda Tutorial: https://youtu.be/9nEh-OXVaNI
PyTorch Course: https://youtube.com/playlist?list=PLqnslRFeH2UrcDBWF5mfPGpqQDSta6VK4
Snake Pygame: https://youtu.be/–nsd2ZeYvs

Code:
https://github.com/python-engineer/snake-ai-pytorch

More Resources about Deep Q Learning:
https://www.freecodecamp.org/news/diving-deeper-into-reinforcement-learning-with-q-learning-c18d0db58efe/
https://www.freecodecamp.org/news/an-introduction-to-deep-q-learning-lets-play-doom-54d02d8017d8/
https://towardsdatascience.com/how-to-teach-an-ai-to-play-games-deep-reinforcement-learning-28f9b920440a

You can find me here:
Website: https://www.python-engineer.com
Twitter: https://twitter.com/python_engineer
GitHub: https://github.com/python-engineer

Music: https://www.bensound.com/

#Python

———————————————————————————————————-
* This is a sponsored or an affiliate link. By clicking on it you will not have any additional costs, instead you will support me and my project. Thank you so much for the support! 🙏

Source of this Python/AI Video

AI video(s) you might be interested in …