00. Overview
Influence of Different Reward Functions on a Snake Game Reinforcement Learning Agent.
This project explored the impact of varying reward functions on a reinforcement learning agent's performance in the classic Snake game. Reward functions determine the agent's strategy and learning efficiency, making them a critical factor in reinforcement learning. Five distinct reward functions, each emphasizing different heuristics, were implemented and analyzed. The goal was to evaluate their influence on the agent's training phase and overall performance.
01. Research.
Methodology.
Research Question
How do different reward functions influence the performance of a reinforcement learning agent in the Snake game during training?
Hypothesis
Null Hypothesis: No significant difference exists between the mean scores achieved with different reward functions.
Alternative Hypothesis: Significant differences exist between the mean scores achieved with different reward functions.
Reward Functions
Simple Reward Function: Basic incentives for eating the apple and penalties for collisions.
Manhattan-Based Reward Function: Encouraged moves that minimized the distance to the apple.
Inverse Manhattan-Based Reward Function: Assigned progressively higher rewards as the snake approached the apple.
Increased Score-Based Function: Dynamically increased apple rewards based on the snake's score, incentivizing long-term survival.
Punishment-Based Function: Applied heavy penalties for collisions, minimizing unnecessary actions.
02. Results.
Results.
Results Summary
The simple reward function showed steady learning, plateauing at 30-35 points after ~1000 games.
Manhattan-based rewards exhibited a slight upward trend beyond 1000 games, indicating ongoing learning.
Increased score-based rewards accelerated learning but required more episodes to reach stability.
Reward functions emphasizing proximity (Manhattan and inverse Manhattan) guided the agent toward better strategies.
03. Report
Report PDF.