Skip to main content

dm_control suite for OpenAI Gym env

Project description

Introduction

I simplified martinseilair's dm_control2gym as well as made it compatible with the latest MuJoCo library(e.g., 2.0.0). .... yeah,, I will upload the documents when I have time.

Usage

  • MDP tasks: env returns a state of a robot at each time-step

    import itertools
    from dm_control2gym.util import make_dm2gym_env_state
    
    env = make_dm2gym_env_state(env_name="cheetah_run")
    
    state = env.reset()
    print("State shape: ", state.shape)
    
    total_reward = 0
    
    for t in itertools.count():
        action = env.action_space.sample()
        state, reward, done, _ = env.step(action)
        total_reward += reward
    
        if done: break
    
    env.close()
    print("Total Reward: {}".format(total_reward))
    
  • POMDP tasks: env returns a raw image observation at each time-step

    import itertools
    from dm_control2gym.util import make_dm2gym_env_obs
    
    env = make_dm2gym_env_obs(env_name="cheetah_run", num_repeat_action=1)
    
    obs = env.reset()
    print("Obs shape: ", obs.shape)
    
    total_reward = 0
    
    for t in itertools.count():
        action = env.action_space.sample()
        obs, reward, done, _ = env.step(action)
        total_reward += reward
    
        if done: break
    
    env.close()
    print("Total Reward: {}".format(total_reward))
    

For more details

Please refer to martinseilair's dm_control2gym

Project details


Release history Release notifications

This version

0.0.1

Download files

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

Files for dm-control2gym, version 0.0.1
Filename, size File type Python version Upload date Hashes
Filename, size dm_control2gym-0.0.1-py3-none-any.whl (7.3 kB) File type Wheel Python version py3 Upload date Hashes View hashes
Filename, size dm_control2gym-0.0.1.tar.gz (5.1 kB) File type Source Python version None Upload date Hashes View hashes

Supported by

Elastic Elastic Search Pingdom Pingdom Monitoring Google Google BigQuery Sentry Sentry Error logging AWS AWS Cloud computing DataDog DataDog Monitoring Fastly Fastly CDN DigiCert DigiCert EV certificate StatusPage StatusPage Status page