[RLlib] Deepmind Control Suite Examples (#9751)

This commit is contained in:
Michael Luo
2020-08-23 03:53:08 -07:00
committed by GitHub
parent 5264f888e4
commit 48a39d7cb9
2 changed files with 86 additions and 1 deletions
+1 -1
View File
@@ -71,7 +71,7 @@ class DMCEnv(core.Env):
domain_name,
task_name,
task_kwargs=None,
visualize_reward={},
visualize_reward=False,
from_pixels=False,
height=84,
width=84,
+85
View File
@@ -0,0 +1,85 @@
from ray.rllib.env.dm_control_wrapper import DMCEnv
import numpy as np
"""
8 Environments from Deepmind Control Suite
"""
def acrobot_swingup():
return DMCEnv(
"acrobot",
"swingup",
from_pixels=True,
height=64,
width=64,
task_kwargs={"random": np.random.randint(low=0, high=1e9)})
def hopper_hop():
return DMCEnv(
"hopper",
"hop",
from_pixels=True,
height=64,
width=64,
task_kwargs={"random": np.random.randint(low=0, high=1e9)})
def hopper_stand():
return DMCEnv(
"hopper",
"stand",
from_pixels=True,
height=64,
width=64,
task_kwargs={"random": np.random.randint(low=0, high=1e9)})
def cheetah_run():
return DMCEnv(
"cheetah",
"run",
from_pixels=True,
height=64,
width=64,
task_kwargs={"random": np.random.randint(low=0, high=1e9)})
def walker_run():
return DMCEnv(
"walker",
"run",
from_pixels=True,
height=64,
width=64,
task_kwargs={"random": np.random.randint(low=0, high=1e9)})
def pendulum_swingup():
return DMCEnv(
"pendulum",
"swingup",
from_pixels=True,
height=64,
width=64,
task_kwargs={"random": np.random.randint(low=0, high=1e9)})
def cartpole_swingup():
return DMCEnv(
"cartpole",
"swingup",
from_pixels=True,
height=64,
width=64,
task_kwargs={"random": np.random.randint(low=0, high=1e9)})
def humanoid_walk():
return DMCEnv(
"humanoid",
"walk",
from_pixels=True,
height=64,
width=64,
task_kwargs={"random": np.random.randint(low=0, high=1e9)})