Neural Network Learns to Play Snake using Deep Reinforcement Learning

preview_player
Показать описание


SOME OF MY OTHER VIDOES:

VIDEOS MENTIONED:

#deeplearning #machinelearning #ai
Рекомендации по теме
Комментарии
Автор

I took my own weird route to playing around with this idea.. First, I wrote a more classic rules based bot to play snake, with it's own recursive function to check future choices for dead ends. It's not perfect, but it can often play the game well enough, to fill half the available space with snake before dying to more difficult to avoid dead-ends. I then used that bot to record 10, 000 of it's highest scoring games frame by frame, a couple million frames in total, also recording each action it took per frame. Then I fed all that data into a basic neural network, and ran a few hundred training epochs. So far I've gotten the neural network to play the game alright, but only about as good as my bot. heh

NikoKun
Автор

Great video! I'm trying to teach myself Neural Networks and AI, and one of my future projects will be a "snake" playing AI based on a NN. I now have experience with basic multi-layer NNs for classifying images, etc.. What would you recommend as a "next step" to go from classifiers to NN that can play snake, etc., and some learning resources for this? I realize that this video is 4 years old, but just in case you are monitoring the comments, I thought I'd ask. Thanks!

gregmarquez
Автор

What really really gets on my tits is how all reinforcement videos are about trivial stuff, trying to make it seem hard like 'oooh how do we train the network?', when the overwhelmingly hard thing is, how to get the pixel data from the screen, how to format it, how do we build the game etc.

McMurchie
Автор

Here from Lex Fridman Podcast Discord!

ozmandunn
Автор

Damn, I wanted to do something like that for my Bachelor Thesis. If your agent can actually learn to play a board of any size in theory, I may go for something else.

MrCmon
Автор

Nice snake you have there. Interesting to see what approaches that you are exporing.


I'm working on a snake ai myself, and is experimenting with having obstacles.


repo here:

simonstrandgaard
Автор

Thank you for the awesome video! I am creating my own reinforcement learning snake game, but I am able to run it on my phone. I will train my snake, while my phone is on charge, while I sleep. The grid size is quite large, so I will see what happens, over time, and eventually show my results on YouTube.

scottforbes
Автор

Really enjoyed the brief overviews of each of the algorithms used - would watch more of this type of video!

swordriffraff-green
Автор

Beautiful video, are you working in the industry?

lored
Автор

If I understand you correctly you are feeding your learning alghorithm with full enviroment data. Thats why you endup with having not enough resources very fast. In my opinion genral snake agent should not be dependant on board size. For start you can try using moving 16x16 window around head of snake as an enviroment input, and use it on any board size. Later you can try experinent with other additional enviroment inputs like current snake length, distances to every board edge etc. I may be wrong, but maybe it's a good hint :) Nice video!

KrzysztofDerecki
Автор

Is there source code for this somewhere? Would be super helpful to have a look at it

elliotg
Автор

Bruhh wheres the coooode? I am doing literally the same project and hoping to take < a month

bobhanger
Автор

Can you explain me how did you calculate the complexity of the problem at 9:05? As I'm thinking about it, on 20x20 res, there are 400 states and actions. So it has to compute 400 actions depending on the environment, meaning 3^400 (given a pixel is 0 - no food/no body, 1 - there is food, 2 - there is part of his body), so 400 * (3 ^ 400)?

valentinpopescu
Автор

This is awesome!! Looking forward to more videos over the summer!

shahzebafroze
Автор

Very great video. I'm sad I haven't found this channel earlier!

martinsosmucnieks
Автор

If you need it to be trained on a powerful computer I think you should contact sentdex he released a video where he said he might accept projects from fans to be run on his new 30k$ PC

arcadesoft
Автор

Nice video! Clean and easy to follow explanation :)

tan-uzoe
Автор

I’ve never watched that game on its final form 😂😂😂

marlhex
Автор

Would love to watch more ❤️ . . .can we feed real game as an environment like as an input the program takes it frame by frame and we define the set of actions something like that ?

agentkoko
Автор

Any chance we could see the code for this?

tkallday