This project explores the application of Deep Q-Learning to the classic Snake game, aiming to learn a near-optimal policy through interaction with the environment. The Deep Q-Network (DQN) employed is a neural network that approximates the policy by estimating the action-value function (Q-function), enabling the agent to estimate the expected return for each state-action pair. Based on these Q-values, the agent selects actions, making the DQN central to both learning and decision-making. The network is trained using gameplay experiences, allowing it to improve its predictions over time. To address the limitations of conventional epsilon-greedy exploration, a Thompson sampling-based exploration strategy is applied. This approach samples from a Gaussian approximation to the posterior distribution over the network weights, enabling, in principle, a better exploration of a deep environment.
Questo progetto esplora l'applicazione del Deep Q-Learning al classico gioco Snake, con l'obiettivo di apprendere una strategia quasi ottimale attraverso l'interazione con l'ambiente. La Deep Q-Network (DQN) utilizzata è una rete neurale che approssima la strategia stimando la funzione Q, permettendo all'agente di valutare il guadagno cumulativo atteso per ogni coppia stato-azione. Sulla base di questi valori Q, l’agente seleziona le azioni, rendendo la DQN un componente centrale sia per l’apprendimento sia per il processo decisionale. La rete viene addestrata utilizzando le esperienze di gioco raccolte, consentendole di migliorare progressivamente le proprie previsioni. Per superare le limitazioni dell'esplorazione tramite una strategia di tipo epsilon-greedy, viene adottata una strategia di esplorazione basata sul campionamento di Thompson. Questo approccio campiona da un’approssimazione gaussiana della distribuzione a posteriori dei pesi della rete, consentendo, in linea di principio, un’esplorazione più efficace di ambienti complessi.
A simple algorithm for uncertainty quantification in Snake
GIORGETTI, LUCA
2024/2025
Abstract
This project explores the application of Deep Q-Learning to the classic Snake game, aiming to learn a near-optimal policy through interaction with the environment. The Deep Q-Network (DQN) employed is a neural network that approximates the policy by estimating the action-value function (Q-function), enabling the agent to estimate the expected return for each state-action pair. Based on these Q-values, the agent selects actions, making the DQN central to both learning and decision-making. The network is trained using gameplay experiences, allowing it to improve its predictions over time. To address the limitations of conventional epsilon-greedy exploration, a Thompson sampling-based exploration strategy is applied. This approach samples from a Gaussian approximation to the posterior distribution over the network weights, enabling, in principle, a better exploration of a deep environment.| File | Dimensione | Formato | |
|---|---|---|---|
|
Giorgetti_Luca.pdf
accesso aperto
Dimensione
3.35 MB
Formato
Adobe PDF
|
3.35 MB | Adobe PDF | Visualizza/Apri |
The text of this website © Università degli studi di Padova. Full Text are published under a non-exclusive license. Metadata are under a CC0 License
https://hdl.handle.net/20.500.12608/91174