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 details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

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

Uploaded Python 3

File details

Details for the file gym-distractions-0.1.1.tar.gz.

File metadata

  • Download URL: gym-distractions-0.1.1.tar.gz
  • Upload date:
  • Size: 15.5 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/4.0.1 CPython/3.11.3

File hashes

Hashes for gym-distractions-0.1.1.tar.gz
Algorithm Hash digest
SHA256 9cdc6fbafd8710f0e6139806a5bbb78f1b4059d0c20f2e705d65872ab602206d
MD5 9351b25aedc5d2abac03e38932a14917
BLAKE2b-256 d90a2965c0a791793b263f9c34b16d85e079bbff5e2561340ba7aaa2dc6efdcb

See more details on using hashes here.

File details

Details for the file gym_distractions-0.1.1-py3-none-any.whl.

File metadata

File hashes

Hashes for gym_distractions-0.1.1-py3-none-any.whl
Algorithm Hash digest
SHA256 b1f486c8723f2466d03db41ee0fc8e96f0fae182fb3176b29cc7afc51019dbf0
MD5 fbb2181e5b5d026785870b64d06f93c1
BLAKE2b-256 01272a043d9f1a096a992b0360f0b36a44c77fd3494b30318365aaefcbca5320

See more details on using hashes here.

Supported by

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