GithubHelp home page GithubHelp logo

frankroeder / dreamduck Goto Github PK

View Code? Open in Web Editor NEW
0.0 0.0 2.0 27.01 MB

World Models Experiments for Duckietown

Python 57.92% Shell 0.11% Jupyter Notebook 41.98%
reinforcement-learning vae duckietown baselines mixture-density-networks deep-learning dreaming ppo2 gym gym-environment

dreamduck's Introduction

World Model DuckieTown

This repository is an implementation of the WorldModelsExperiments combined with forks of gym-duckietown and baselines.

There are three gym environments provided.

  1. DreamDuck-v0: default environment dreamduck/envs/env.py


  1. DreamDuck-v1: world model representation dreamduck/envs/realenv.py


  1. DreamDuck-v2: dream environment dreamduck/envs/rnnenv.py


Getting Started

Installation

  1. Create a virtual environment with python3 -m venv venv and activate it with source venv/bin/activate
  • If the module is not present run sudo apt-get install python3-venv, otherwise make use of instructions for your OS
  1. Install dependencies pip install -r ./dreamduck/envs/requirements.txt

  2. Install baselines fork pip install git+https://github.com/Bassstring/baselines

  3. Install this module pip install -e .

Manual Control

All three environments can be controlled manually:

Default environment

  • python dreamduck/envs/env.py
  • Use the flag -h for all options

World Model Interpretation of the real Environment

  • python dreamduck/envs/realenv.py
  • Show real observation next to world model interpretation with --debug

Dreaming without real Environment

  • python dreamduck/envs/rnnenv.py
  • Make use of flag --temp to control uncertainty

Training

baselines (0.1.5)

The baselines module provide a straightforward way of training an agent with different algorithms and settings out of the box.

With the following commands an agent is trained in the dream and evaluated in the real environment interpreted by our world model.

  • python -m baselines.run --alg=ppo2 --env=DreamDuck-v2 --num_timesteps=2e7 --network=mlp --num_env=2 --save_path=./models/dreamduck_rnnenv_ppo2 --log_path=train_rnnenv_logs

  • python -m baselines.run --alg=ppo2 --env=DreamDuck-v1 --network=mlp --num_timesteps=0 --load_path=./models/dreamduck_rnnenv_ppo2 --play

For debugging purposes invoke baselines with following environmental variable:

  • DEBUG_BASELINES=1 python -m baselines.run --alg=ppo2 ...

Running headless training with xvfb

  • Install xvfb sudo apt install xvfb -y
  • Run xvfb-run -a -s "-screen 0 1400x900x24 +extension RANDR" -- python -m baselines.run --alg=ppo2 --env=DreamDuck-v0 --num_timesteps=2e7 --network=cnn_lstm --num_env=8 --save_path=./models/dreamduck_cnn_lstm_ppo2 --log_path=train_logs

If there are issues follow this instruction.

Presentation to initial Results

https://docs.google.com/presentation/d/1wxcVQcTnhOC700dCKF-H1ftDOI84jh5EPQZgoMzgHvc/edit?usp=sharing

Authors

Frank Röder & Shahd Safarani

dreamduck's People

Contributors

frankroeder avatar shahdsaf avatar

Forkers

shahdsaf

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.