Home

Awesome

format check test MIT Gitter

d4rl-pybullet

Datasets for Data-Driven Deep Reinforcement Learning with Pybullet environments. This work is intending to provide datasets for data-driven deep reinforcement learning with open-sourced bullet simulator, which encourages more people to join this community.

This repository is built on top of d4rl. However, currently, it is impossible to import d4rl without checking MuJoCo activation keys, which fails the program. Thus, d4rl_pybullet.offline_env is directly copied from d4rl repository.

install

$ pip install git+https://github.com/takuseno/d4rl-pybullet

usage

The API is mostly identical to the original d4rl.

import gym
import d4rl_pybullet

# dataset will be automatically downloaded into ~/.d4rl/datasets
env = gym.make('hopper-bullet-mixed-v0')

# interaction with its environment
env.reset()
env.step(env.action_space.sample())

# access to the dataset
dataset = env.get_dataset()
dataset['observations'] # observation data in N x dim_observation
dataset['actions'] # action data in N x dim_action
dataset['rewards'] # reward data in N x 1
dataset['terminals'] # terminal flags in N x 1 

available datasets

idtaskmean rewardstd rewardmax rewardmin rewardsamples
hopper-bullet-random-v0HopperBulletEnv-v018.643.0453.21-8.581000000
hopper-bullet-medium-v0HopperBulletEnv-v01078.36325.521238.9569220.231000000
hopper-bullet-mixed-v0HopperBulletEnv-v0139.08147.621019.949.1559345
halfcheetah-bullet-random-v0HalfCheetahBulletEnv-v0-1304.4999.30-945.29-1518.581000000
halfcheetah-bullet-medium-v0HalfCheetahBulletEnv-v0787.35104.31844.91-522.571000000
halfcheetah-bullet-mixed-v0HalfCheetahBulletEnv-v0453.12498.19801.02-1428.22178178
ant-bullet-random-v0AntBulletEnv-v010.350.3113.049.821000000
ant-bullet-medium-v0AntBulletEnv-v0570.80104.82816.7970.871000000
ant-bullet-mixed-v0AntBulletEnv-v0255.40196.22609.66-32.7453572
walker2d-bullet-random-v0Walker2DBulletEnv-v014.982.9466.905.731000000
walker2d-bullet-medium-v0Walker2DBulletEnv-v01106.68417.791394.3816.001000000
walker2d-bullet-mixed-v0Walker2DBulletEnv-v0181.51277.711363.949.4589772

train policy

You can train Soft Actor-Critic policy on your own machine.

# giving -g option to choose GPU device
$ ./scripts/train -e HopperBulletEnv-v0 -g 0 -n 1

data collection

You can collect datasets with the trained policy.

$ ./scripts/collect -e HopperBulletEnv-v0 -g -n 1

data collection with randomly initialized policy

You can collect datasets with the random policy.

$ ./scripts/random_collect -e HopperBulletEnv-v0 -g -n 1

contribution

Any contributions will be welcomed!!

coding style

This repository is formatted with yapf. You can format the entire repository (excluding offline_env.py) as follows:

$ ./scripts/format

acknowledgement

This work is supported by Information-technology Promotion Agency, Japan (IPA), Exploratory IT Human Resources Project (MITOU Program) in the fiscal year 2020.