Skip to main content

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.

Installation

$ pip install dm_control2gym

Dependencies

  • Please check the requirements.txt or just pip install -r requirements.txt

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
    from dm_control2gym.recorder import Monitor
    
    env = make_dm2gym_env_obs(env_name="cheetah_run", num_repeat_action=1)
    env = Monitor(env=env, directory="./log", force=True)
    
    obs = env.reset()
    print("Obs shape: ", obs.shape)
    
    total_reward = 0
    
    env.record_start()
    env.reset()
    for t in itertools.count():
        action = env.action_space.sample()
        obs, reward, done, _ = env.step(action)
        total_reward += reward
    
        if done: break
    
    env.record_end()
    env.close()
    print("Total Reward: {}".format(total_reward))
    

Videos

For more details

Please refer to martinseilair's dm_control2gym

Release files for dm-control2gym 0.0.2

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Built distribution (wheel)

Table of built distributions (wheels) for dm-control2gym 0.0.2
File Interpreter ABI Platform
dm_control2gym-0.0.2-py3-none-any.whl Python 3 none any Details

Release files / dm_control2gym-0.0.2-py3-none-any.whl

Download URL dm_control2gym-0.0.2-py3-none-any.whl
Size 12.0 kB
Tags Python 3
SHA-256 checksum
How to use checksums
660b2283ce7ac711e3e2cabedce6268ebe9b943a66f0992bc5e4a0a645bf780e
BLAKE2b-256 checksum
How to use checksums
d9ec011281a336be31f4f16f1a6f6311da306b2b3960ac05c103ca09b20f1f51
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/3.1.1 pkginfo/1.5.0.1 requests/2.22.0 setuptools/44.0.0.post20200106 requests-toolbelt/0.9.1 tqdm/4.41.1 CPython/3.6.10

Release history Release notifications | RSS feed

This release

0.0.2 This release

1 release file

0.0.1

2 release files

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page