GitXplorerGitXplorer
g

dqn_mountain_car

public
3 stars
0 forks
0 issues

Commits

List of commits on branch main.
Unverified
1152657eb147f22d240e22277f3b1202f086b8a7

some fixes

committed 4 years ago
Unverified
8b5f071138761330b113333cf7910b80a95b1b9e

Improve ReadMe

committed 4 years ago
Unverified
9c27b36f34aa2b5f73baef65af99addb521daf03

Improve ReadMe

committed 4 years ago
Unverified
fce02cd612339090d5f701fef0371306e76c9398

Remove excess of horizontal lines

committed 4 years ago
Unverified
01def30dab7dfdf4d71116da86bd59e60ad6ff0a

Added ReadMe and License

committed 4 years ago
Unverified
75cda3a7db10b4afd918ace4d2ced10948731c30

Add: Start of README

committed 4 years ago

README

The README file for this repository.

DQN Model Playing The Mountain Car Game

Gif Of Model after being trained for 1 million frames

Introduction

In this project, I created a Deep Q-Learning that reaches the goal of the Mountain Car Game. It trained for 1 million steps and reached the result you see above.

Installation

These steps helps you install OpenAi Gym in a Windows Environment. If this isn't your case, you can follow a similar approach suited to your OS.

These steps are based on this tutorial

Install Microsoft Visual C++ Build Tools for Visual Studio 2019 here:

Screenshot showing here to download the Build Tools for Visual Studio 2019

Using conda, create an env.

conda create -n env_name python=3.8 pip
conda activate env_name

Then, install the necessary packages:

Minimum install of OpenAI Gym:

pip install gym

Package to run the ToyText Environments:

conda install pystan

To run the Atari environments:

pip install -f https://github.com/Kojoley/atari-py/releases atari_py

To run the Box2D environments:

conda install swig
pip install Box2D

To generate the .gif files:

pip install moviepy

To run the tests:

pip install pytest

Install Pytorch here.

Install Xming to display your model playing the environments.

Usage

You can train a model, view a model in action, and generate a gif directly from the command-line:

Trains a model using the hyperparameters defined on src/config.py. You can also specify a model_name as an argument (should include the extension ".pt").

python -m src.train -model_name my_model.pt

View a model in action. You can specify the model_name (it should be one from the models folder). Must have Xming installed on your computer.

python -m src.show_model -model_name my_model.pt

Generate Gif. You can specify the model_name (it should be one from the models folder) and the name of the gif file (should include the extension ".gif").

python -m src.generate_gif -model_name my_model.pt -gif_name my_gif.gif

Contributing

Pull requests are welcome. For major changes, please open an issue first to discuss what you would like to change.

Questions?

Send me a message at: https://www.linkedin.com/in/gustavobruno-developer/

License

MIT