Neural network design for Snake game AI: Input/output structure advice needed

Hey everyone! I’m a beginner in ML and RL. I’m trying to make an AI that can play Snake. I’m stuck on how to set up the neural network for my input and output.

My input is a 3D grid (3x10x10). It shows:

  • Snake body parts (layer 1)
  • Apple location (layer 2)
  • Snake head (layer 3)

I want the output to be 4 numbers for the snake’s moves (up, down, left, right).

I’m not sure if this is a good way to represent the game. Any tips on choosing the right network setup? Or suggestions to improve my input format?

Thanks for your help!

hey mike, ur input looks decent. maybe consider adding distance to walls? for output, u could use softmax to get probabilities for each direction. start with a simple feed-forward network, like 2-3 hidden layers. experiment with diff architectures. good luck with ur snek AI!