GithubHelp home page GithubHelp logo

dfilan / procgen-expose-state Goto Github PK

View Code? Open in Web Editor NEW

This project forked from pavelcz/procgenaisc

0.0 0.0 0.0 31.02 MB

Fork of procgen that, among other things, exposes state variables in the info dict

License: MIT License

C++ 89.88% Python 9.34% C 0.23% CMake 0.51% Dockerfile 0.04%

procgen-expose-state's Introduction

This is a fork of the procgen benchmark that implements modifications for the paper Goal Misgeneralization in Deep Reinforcement Learning, as well as adding state variables and the final observation of an episode to the info dict.

Descriptions of the modified environments

  • coinrun_aisc: Like coinrun, but the coin is placed randomly on ground level instead of at the far right end.
  • coinrun: Added a flag --random_percent, which places the coin randomly in a given percentage of environments. Default 0.
  • heist_aisc_many_chests: A heavily modified heist. Doors are now 'chests' (they do not prevent the agent from passing). Every key can open every chest. The agent is rewarded for opening chests. This version generates twice as many chests as keys.
  • heist_aisc_many_keys: Same as heist_aisc_many_chests, but instead has twice as many keys as chests.
  • maze_aisc: Like maze, but the cheese is always to be found in the top right corner.
  • maze_yellowgem: like maze, but the goal is a yellow gem.
  • maze_redgem_yellowstar: like maze, but two objects are placed in the maze: a red gem, and a yellow star. The objective is the red gem.
  • maze_yellowstar_redgem: Identical to maze_yellowstar_redgem, but the objective is instead the yellow star.

For both 'Keys and Chests' environments we added two options:

  • --key_penalty: integer. Every time the agent picks up a key it loses options.key_penalty / 10 reward.
  • --step_penalty: integer time penalty. Each step, options.step_penalty / 1000 is subtracted from the reward.

For more information on the standard environments see the original repository.

Installation

Below we reproduce the instructions to install from source, copied from the original repo.


First make sure you have a supported version of python:

# run these commands to check for the correct python version
python -c "import sys; assert (3,6,0) <= sys.version_info <= (3,9,0), 'python is incorrect version'; print('ok')"
python -c "import platform; assert platform.architecture()[0] == '64bit', 'python is not 64-bit'; print('ok')"

If you want to change the environments or create new ones, you should build from source. You can get miniconda from https://docs.conda.io/en/latest/miniconda.html if you don't have it, or install the dependencies from environment.yml manually. On Windows you will also need "Visual Studio 15 2017" installed.

git clone [email protected]:openai/procgen.git
cd procgen
conda env update --name procgen --file environment.yml
conda activate procgen
pip install -e .
# this should say "building procgen...done"
python -c "from procgen import ProcgenGym3Env; ProcgenGym3Env(num=1, env_name='coinrun')"
# this should create a window where you can play the coinrun environment
python -m procgen.interactive

The environment code is in C++ and is compiled into a shared library exposing the gym3.libenv C interface that is then loaded by python. The C++ code uses Qt for drawing.

procgen-expose-state's People

Contributors

christopherhesse avatar langosco avatar jacobpfau avatar dfilan avatar pavelcz avatar kcobbe avatar christopher-hesse avatar dbalicki avatar jschapke avatar leesharkey avatar

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.