Neural Network Learns to Play Snake

preview_player
Показать описание
In this project I built a neural network and trained it to play Snake using a genetic algorithm.

Thanks for watching! Subscribe if you enjoyed and Share if you know anyone who would be interested!

Thanks to Josh Cominelli for the music!
Рекомендации по теме
Комментарии
Автор

You guys think that the snake died because of the lack of left turns, but in reality the snake evolved to the point where it got consciousness and understood that life dedicated to running in circles is not worth living.

MrPman
Автор

For anyone who wonders why it seems to prefer right turns, I believe that is because it started at the top-left, going towards the right. There was no way for it to turn left. So with 2000 snakes per generation, a LOT of those learned that left is death. Since right worked every time, it simply had no reason to learn that turning left after leaving the wall would be safe.
I believe that is also why you got those wiggly motions. That's it trying to turn left, but then immediately turning right again, so its profile won't go any further to the right than the starting position.

morphman
Автор

ME: "Hello World">>20 errors found.

funny
Автор

My favorite part is every time you think the AI finally has it down, then runs into a wall for no reason

Every time

cap
Автор

I love that the reason it failed is because that's the one flaw of the technique it's honed from the start

XPimKossibleX
Автор

I have deeply learned that in the end, nothing is left.

ItachiUchiha-nxsw
Автор

I think another one reason why this doesn’t get higher because in input it gets -
1. Distance to food
2. Distance to wall
3. Distance to tail

Wait but what about its whole body ??

So that’s why snake trap around it’s own body.

Just a guess though 🤔

rutvikrana
Автор

Humans: *computers will take over the world and destroy us all*

Computer: *hehe line go zoom*

nanxhu
Автор

This neural network is incredibly inefficient. Right from the beginning, it learned to not turn left by any means. This video is perfect as a demonstration that neural networks can easily get stuck on a very wrong local optimum.

riverrist
Автор

congratulations for the big work you've done, not only at the algorithmic part, but the visual part which i can see it's a huge effort to present us your job.

uchihatomy
Автор

I can't imagine how happy would be the first guy who developed these algorithms.... ❤️❤️

abhiramcd
Автор

"What is my purpose ?"
"You pass butter...."

kvadityasrivatsa
Автор

Generation 30: *dies*
Me: YOU WERE THE CHOSEN ONE

zackrodriguez
Автор

The mind of the Snake in the first few generations, spinning to infinity a pixel away from the food
"FOOD FOOD FOOD FOOD FOOD FOOD FOOD FOOD FOOD FOOD FOOD FOOD"

sciencesyfy
Автор

No one:
YouTube when my lil brother uses Wi-Fi 1:22

markgeorge
Автор

I think it probably would have learned better if you had started off with a lower number of moves left (maybe like 60?) so that it doesn't have so much security to take its time.

Flourish
Автор

6:07 love how the snake eating the food is perfectly synced up to the songs snare until around 6:22

SmokeDoinks
Автор

What I think is most fascinating about this project is that the neural network never learned the dimensions of the game board and kept returning to the start

sykeassai
Автор

I would like to see this but also with an adversarial neural network placing the next food piece.

MudakTheMultiplier
Автор

It's so fascinating to look at a neural network learn and it be visualized, it's like a mini brain in a computer learning and reacting to their surroundings, telling a machine that only follows orders to figure it out themself

blzrL