GithubHelp home page GithubHelp logo

moabitcoin / cherry-pytorch Goto Github PK

View Code? Open in Web Editor NEW
11.0 11.0 1.0 365 KB

Reinforcement Learning Tutorials & other bedtime stories in PyTorch

License: MIT License

Python 98.38% Makefile 1.62%
agents atari ddpg-pytorch ddqn-pyotrch deep-learning deep-reinforcement-learning dqn-pytorch pytorch pytorch-tutorial reinforcement-learning vizdoom vpg

cherry-pytorch's People

Contributors

sandhawalia avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar

Forkers

vishalbelsare

cherry-pytorch's Issues

Dockerhub support

Currently we don't have push rights to moabitcoin/cherry-torch-<cpu/gpu>. Its recommended to build from source. We want to support Docker pull/run

Doom optimiser bug fix

  • We could not re-produce doom results after porting learnings from Atari
  • This bug fix was due to BN layers in Doom which need RMSprop as the optimiser

Add verbosity levels to training/testing the agent

Currently all agents are training with logging.INFO logging enabled. We'd like to expose user configured logging level enabled from CLI

  parser = argparse.ArgumentParser('Train an RL Agent to'
                                   ' play Atari Game (DQN)')
  parser.add_argument('-x', dest='config_file', type=str,
                      help='Config for the Atari env/agent', required=True)
  parser.add_argument('-d', dest='device', choices=['gpu', 'cpu'],
                      help='Device to run the train/test', default='gpu')
  parser.add_argument('-v', dest='verbosity', choices=['info', 'debug', 'warning, 
'error'],
                      help='Logging verbosity level ', default='info')

Track code version with model version

Currently we don't track code version with the model version this can lead to inability to re-produce results.

  • Use git python package to get commit tag.
  • Add git commit tag as a prefix when saving model files
  • Add git commit tag to logs
  • Add git commit tags to yaml config files at exp_dir

Include Doom vars into DoomEnvironment

Currently DoomEnvironment gets default setting from the *.cfg/*.wad files. The default rewards from the DoomGame do not account for any change to the reward based on any changes to GameVariable.

We would like the DoomEnvironment to be configurable via config yaml file to account for changes to rewards based on available GameVariable.

F.ex include GameVariable.AMMO in basic.cfg to budget weapon fire. and GameVariable.HEALTH for health_gathering.cfg to incentivise gathering of medkits

Docker support

Currently we only support using cherry within a conda ๐Ÿ environment. We'd like to add support for building/running docker image. Following functionalities are handy

  1. Building docker image for cherry
  2. Publishing docker image on Docker Hub

Sample setup from here

Training Atari games with VPG

We currently train Atari models with DQN + DDQN. VPG (Vanilla Policy Gradient) have shown to be a better structured agent (as tested on Control problems / Health gathering in Doom).

Generate model + hyper params which can solve Breakout Atari retro game

Realtime render Doom/Atari playtime

Currently at playtime the gameplay + actions are written to a video file. We'd like an option for viewing the current gameplay rendered in realtime for debugging.

Optimize replay buffer

Currently we keep 2 * 4 frame states in buffer this can be reduced to 5 with first 4 frames the current state and last 4 the next state

Travis CI setup

Since ours is an open source project we'd like to use Travis CI for building / testing a PR/commits. This would also push the built images to Docker Hub for distribution.

Sample usage from here

Major code restructure

Currently the codebase is organised as follows

โ”œโ”€โ”€ ddqn
โ”‚ย ย  โ”œโ”€โ”€ atari
โ”‚ย ย  โ””โ”€โ”€ doom
โ”œโ”€โ”€ dqn
โ”‚ย ย  โ”œโ”€โ”€ atari
โ”‚ย ย  โ””โ”€โ”€ doom
โ”œโ”€โ”€ policy_gradients
โ”‚ย ย  โ”œโ”€โ”€ atari
โ”‚ย ย  โ”œโ”€โ”€ classic_control
โ”‚ย ย  โ””โ”€โ”€ doom
โ”œโ”€โ”€ q-learning
โ””โ”€โ”€ utils

Rather than running via an entry scripts as we do currently. We'd like a cli : bin/cherry
We'd to like to re-organise as follow

โ”œโ”€โ”€ agents
โ”‚ย ย  โ”œโ”€โ”€ dqn
โ”‚ย ย  โ””โ”€โ”€ ddqn
โ”‚ย ย  โ”œโ”€โ”€ q_learning
โ”‚ย ย  โ””โ”€โ”€ policy_gradient
โ”œโ”€โ”€ envs
โ”‚ย ย  โ”œโ”€โ”€ atari
โ”‚ย ย  โ””โ”€โ”€ doom
โ”‚ย ย  โ””โ”€โ”€ classic_control
โ”œโ”€โ”€ configs
โ”‚ย ย  โ”œโ”€โ”€ doom.yaml
โ”‚ย ย  โ””โ”€โ”€ atari.yaml
โ”œโ”€โ”€ utils
โ””โ”€โ”€ bin/cherry

And run as follows

bin/cherry train -cfg configs/doom.yaml
bin/cherry play -cfg configs/doom.yaml

Remove null state

Currently we include null_state to infer terminal or game over state. This can be factored out by using (1 - done) * gamma * Q

Deadly corridor for Doom

DQN & DDQN don't perform well for large action space problems like deadly_corridor & health_gathering. For this we want to explore

  • Policy gradients
  • Actor Critic models

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.