Skip to content

dAiv-CNU/dAiv.AI-Lecture.DQN

 
 

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

22 Commits
 
 
 
 
 
 
 
 
 
 

Repository files navigation

dAiv Reinforcement Learning Basics

Dependencies

To run this project, ensure Python 3.10 or later is installed. Follow the steps below to set up the environment:

Reproduction

Clone this repo

git clone https://github.com/dAiv-CNU/dAiv.AI-Lecture.DQN dqn
cd dqn

Install Required Packages

pip install --upgrade uv
uv sync

Install PyTorch

For NVIDIA GPUs (CUDA versions):

CUDA 11.8

uv add torch torchvision torchaudio --index-url https://download.pytorch.org/whl/cu118 --frozen

CUDA 12.1

uv add torch torchvision torchaudio --index-url https://download.pytorch.org/whl/cu121 --frozen

CUDA 12.4

uv add torch torchvision torchaudio --index-url https://download.pytorch.org/whl/cu124 --frozen

using Mac or Window cpu environment

uv add torch torchvision torchaudio

How to Run

1. Play the Snake Game

Run the playable snake game:

python -m snakegame normal

2. Evolutionary Snake Game

Use genetic algorithms to evolve the snake:

python -m snakegame genetic

3. Deep Q-Learning Snake Game

Run the DQN-based snake AI:

python -m snakegame dqn

Credits

Snake game code by HonzaKral: https://gist.github.com/HonzaKral/833ee2b30231c53ec78e

About

Practical code for dAiv's basic reinforcement learning education.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages

  • Python 100.0%