Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Data Coverage in UMaze Env #7

Closed
kpertsch opened this issue Apr 27, 2020 · 1 comment
Closed

Data Coverage in UMaze Env #7

kpertsch opened this issue Apr 27, 2020 · 1 comment

Comments

@kpertsch
Copy link

I visualized the state coverage of the provided data in the 2D maze environments. For the small UMaze environment the downloadable dataset seems to have a skewed data distribution where the agent never fully explores one of the sides:
image
The right shows a scatter plot of all positions in the downloaded dataset. Was there a bug in data generation or is this intended? (the data that is used to generate the GIF on the website does not seem to have this issue)

The other two maze environments seem to have full coverage of the maze:
image

I slightly modified the visualized_dataset.py script for these plots:

import argparse
import d4rl
import gym


if __name__ == "__main__":
    parser = argparse.ArgumentParser()
    parser.add_argument('--env_name', type=str, default='maze2d-umaze-v0')
    args = parser.parse_args()

    env = gym.make(args.env_name)
    
    dataset = env.get_dataset()
    if 'infos/qpos' not in dataset:
        raise ValueError('Only MuJoCo-based environments can be visualized')
    qpos = dataset['infos/qpos']
    qvel = dataset['infos/qvel']
    rewards = dataset['rewards']
    actions = dataset['actions']

    import matplotlib.pyplot as plt
    plt.scatter(qpos[:, 0], qpos[:, 1])
    plt.axis('equal')
    plt.show()
@justinjfu
Copy link
Contributor

Looks like the wrong dataset got uploaded - this should be fixed! Delete the cached copy in ~/.d4rl/datasets and you can download a fresh copy.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants