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

Uniform random agent not moving in AntGather environment #3

Open
nikhilrayaprolu opened this issue Aug 27, 2021 · 6 comments
Open

Uniform random agent not moving in AntGather environment #3

nikhilrayaprolu opened this issue Aug 27, 2021 · 6 comments

Comments

@nikhilrayaprolu
Copy link

I tried the example code provided in the README. the agent is not making any move from the initial position it was dropped, except it jitters its body a little.

import hrl_pybullet_envs
import gym
import numpy as np

env = gym.make('AntGatherBulletEnv-v0')
env.render()
ob = env.reset()
tot_rew = 0

for i in range(1000):
  # Take random actions
  ob, rew, done, _ = env.step(np.random.uniform(-1, 1, env.action_space.shape))
  tot_rew += rew

  if done: break

print(f'Achieved total reward of: {tot_rew}')

image

@sash-a
Copy link
Owner

sash-a commented Aug 27, 2021

That's expected, it's performing random actions each time step, so on average it would likely stay in the same spot

@nikhilrayaprolu
Copy link
Author

But even in case of the PointGatherEnv there is no movement in the red cube on executing random actions

@sash-a
Copy link
Owner

sash-a commented Aug 28, 2021

Change

env.step(np.random.uniform(-1, 1, env.action_space.shape))

to

env.step(np.ones(env.action_space.shape))

@nikhilrayaprolu
Copy link
Author

Thanks, @sash-a Can you also provide PointMazeEnv?

@nikhilrayaprolu
Copy link
Author

Also, some examples with a trained example would help in the provided Colab. Probably running a Stable baselines agent might be enough:
https://stable-baselines3.readthedocs.io/en/master/

@sash-a
Copy link
Owner

sash-a commented Aug 29, 2021

PointMazeEnv may come in the future, but unfortunately I have pressing deadlines at the moment and it is not at the top of my list of envs to implement, AntPush and AntFall will likely come first.

The point of these environments is that they generally require hierarchical reinforcement learning to solve, so stable baselines likely would not cut it. Regardless that is beyond the scope of this repository, at the moment it is simply for my own research as I could not find non-mujoco versions of these envs and anyone that wants to use these envs is welcome, but I don't really have enough time to create baselines. You are more than welcome to try running some standard RL algorithms on these envs and see if they work and make some contributions like a benchmark.md, it would be much appreciated.

As a side not I did at one point try PPO on AntGather and it got a reward of 0, but that was a couple months ago and a very quick test.

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