Score
0
Pre-trained via stable-baselines. In-browser DQN training powered by TensorFlow.js. Game interface from Snake-Javascript.
About this AI
The snake is controlled by a small neural network trained with reinforcement learning. It was never told the rules — it learned entirely by playing thousands of games, receiving rewards for eating food and penalties for dying.
Every 90 ms the network observes 12 boolean features about the game state and outputs a score for each of the 4 possible directions. The highest-scoring safe direction is chosen.
Neural network architecture
Input
12 features
→
12 features
Dense
64 · tanh
→
64 · tanh
Dense
64 · tanh
→
64 · tanh
Output
4 directions
4 directions
How does it work?