Skip to main content

Environment with different disk dynamics for distractions in RL environments

Project description

Gym Distractions

PyPI codecov

This package provides a number of distractions that can be added to pixel based gym environments. It directly includes the creation of MuJoCo Environments with these distractions.

Installation

Release install from pypi

pip install gym-distractions

Installation of latest from GIT Repository

pip install -e git+https://github.com/sebimarkgraf/gym-distractions.git

Using MuJoCo Environments

Use the MuJoCo environments by importing it and using the make() method.

import gym_distractions

env = gym_distractions.make(domain_name,
                    task_name,
                    distract_type,
                    ground,
                    difficulty,
                    background_dataset_path,
                    train_or_val,
                    seed,
                    visualize_reward,
                    from_pixels,
                    height,
                    width,
                    camera_id,
                    frame_skip,
                    episode_length,
                    environment_kwargs,
                    time_limit,
                    channels_first
                    )

The following is the explanation of the parameters which used to control the background/foreground, and the rest of the parameters are the same as the original dmc2gym code.

distract_type             : choice{'color', 'noise', 'dots', 'videos'}, default: None
ground                    : choice{'background', 'forground', 'both'}, default: None,
                            'both' only used for 'videos' distractor, 'color' and 'noise' only have 'background'
difficulty                : choice{'easy', 'medium', 'hard'}, default: 'hard'
                            only useful for 'dots' and 'videos' distractor
                            when use 'dots' distractor, set num_dots to: 'hard'=16, 'medium'=8, 'easy'=5;
                            when use 'videos' distract type, set num_video to: 'hard'=all, others the same as 'dots'
intensity                 : 0-1, default: 1
                            distracting intensity(non-transparency?): 1 is all distrated, 0 is same as original env
background_dataset_path   : where you put your video/image dataset, only useful for 'videos'
train_or_val              : choice{'train', 'val'}, default: None
                            when use DAVIS Dataset, can divided it to train-set and validation-set

when you use 'dots', by default, distractors are repeated, and movements of dots obey the dynamics of an ideal gas with no collison. If you want to change those default settings, or you want to modify sizes/velocitys/positions/quantity/or some others of dots, you can modify them in file 'background_source.py', class 'RandomDotsSource' by yourself.

Attribution

Based on work of:

  • Philipp Becker
  • Yiping Wei
  • Yitian Yang

Citing This Work

If you find this work helpful, please cite the corresponding publication

TODO

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

gym-distractions-0.1.1.tar.gz (15.5 kB view hashes)

Uploaded Source

Built Distribution

gym_distractions-0.1.1-py3-none-any.whl (20.0 kB view hashes)

Uploaded Python 3

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page