Skip to content

vaibkumr/DQN-Atari

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

5 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

DQN for Atari

One of my main motivations towards studying Reinfrocement Learning was being able to create an agent that could play atari games (since I was terrible at them). I have implemented DQN before but it was a comparatively very simple task (job scheduling). Playing Atari games is a completely different task (and much diffucult in terms of computational complexity). Even cartpool was so much easier.

I wrote this simple, intuitive and easy to understand DQN implementation in PyTorch a few months ago. Sharing it for others now, if you find any bugs please raise an issue (there must be many).

I have trained this model on the BreakoutDeterministic-v4 gym environment

Check out config/config.ini for the hyperparameters used (mostly taken from other mentioned sources).

Requirements

  • Pytorch
  • openAI gym
  • numpy
  • matplotlib

How to?

Train:

git clone https://github.com/TimeTraveller-San/DQN-Atari

python train_atari.py

How long does it take to train?

On my GTX 1060 6GB, 16 GB RAM and i7 6700k

  • it took the agent ~1 hour to start hitting the ball
  • it took the agent ~13 hours to reach the score of ~50

Have a glance at the harbinger of humanity's demise (test agent):

python test_atari.py --m <MODEL PATH>

TODO (ideas)

  • Try pretrained CNNs.. small resnets and EfficientNets
  • Parallel programming for environment render (CPU < 30% used and RAM < 4GB used for now)
  • Transfer learning? (have to test how well does an agent generalize over different games, I expect it to not generalize with current architecture at all)
  • Parameter tuning
  • Double-DQN (RIP my GPU x_x)
  • Write in Lua (like the repo below)
  • Train for other than breakout

Thanks to

8 bit is life

About

DQN based agent for Atari games

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages