Giter VIP home page Giter VIP logo

srm's Introduction

SRM

Spectrum Random Erasing for Generalization in Image-based Reinforcement Learning

Setup

We assume that you have access to a GPU with CUDA >=9.2 support. All dependencies can then be installed with the following commands:

Install MuJoCo

Download the MuJoCo version 2.1 binaries for Linux or OSX.

Extract the downloaded mujoco210 directory into ~/.mujoco/mujoco210.

If you want to specify a nonstandard location for the package, use the env variable MUJOCO_PY_MUJOCO_PATH.
pip3 install -U 'mujoco-py<2.2,>=2.1'

Install DMControl

conda env create -f setup/conda.yml

conda activate dmcgb

sh setup/install_envs.sh

Install CARLA

mkdir carla

tar -xvzf CARLA_0.9.9.4.tar.gz -C carla

cd carla/PythonAPI/carla/dist

easy_install carla-0.9.9-py3.7-linux-x86_64.egg

ln -fs carla/CarlaUE4.sh /usr/local/bin/carla-server

Install Robosuite

pip install robosuite

Install DrawerWorld

cd src/env/drawerworld

pip install -e .

Usage

DMControl Benchmark

from env.wrappers import make_env
env = make_env(
domain_name=args.domain_name,
task_name=args.task_name,
seed=args.seed,
episode_length=args.episode_length,
action_repeat=args.action_repeat,
image_size=args.image_size,
mode='train'
) env.reset()

done = False while not done: action = env.action_space.sample() obs, reward, done, info = env.step(action)

You can try other environments easily.

Carla Benchmark

from env.carla import make_carla env = make_carla( map_name=args.task_name, client_port=29000,
npc_vehicles_port=29008,
modalities = ["rgb",],
frame_stack=3,
weather = 'clear_noon',
action_repeat=args.action_repeat,
seed=args.seed
)

Robosuite Benchmark

from env.robosuite import make_robosuite
env = make_robosuite(
task=args.task_name,
mode="train",
scene_id=0,
)

DrawerWorld Benchmark

from env.metaworld_wrappers import make_pad_env
env = make_pad_env(
domain_name=args.domain_name,
task_name=args.task_name,
seed=args.seed,
episode_length=args.episode_length,
action_repeat=args.action_repeat,
mode='train',
action_factor=args.action_factor,
moving_average_denoise=args.moving_average_denoise,
moving_average_denoise_factor=args.moving_average_denoise_factor,
moving_average_denoise_alpha=args.moving_average_denoise_alpha,
exponential_moving_average=args.exponential_moving_average
)

Training

MUJOCO_GL='egl' CUDA_VISIBLE_DEVICES=10 python3 src/train.py --algorithm drq_aug --seed 0 --tag SRM --augmentation random_mask_freq;

BibTex:

If you find this survey useful for your research, please cite the following papers:

@article{huang2022spectrum,  
  title={Spectrum Random Masking for Generalization in Image-based Reinforcement Learning},  
  author={Huang, Yangru and Peng, Peixi and Zhao, Yifan and Chen, Guangyao and Tian, Yonghong},  
  journal={Advances in Neural Information Processing Systems},  
  volume={35},  
  pages={20393--20406},  
  year={2022}  
}  

srm's People

Contributors

yara-hyr avatar

Stargazers

 avatar Liu Shuo avatar Ding Chen avatar  avatar free_wind avatar kyoRan avatar

Watchers

 avatar  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.