This project was realized within the scope of a school module. We had to implement a reinforcement learning algorithm to teach an agent playing the Space Invader game.
- Get the source code by cloning this github locally
git clone https://github.com/b-yukky/space-invader-ai.git
cd space-invader-ai
- Install the dependancies in a virtual env
python -m venv env
./env/Scripts/activate
pip3 install -r requirements.txt
You can run the best agent by running the game
python3 run_game.py
Best agent has been trained with weights "policy_weights_2022-07-03_13h21_best" (16 hours)
You can switch trained weights by changing in run_game.py
weights = torch.load("./training/policy_weights_2022-07-03_13h21_best")
You can start a training with
python3 train_dqn_agent.py