nazaruka / gym-http-api

NSGA2-based Sonic agent + experimental code
MIT License
1 stars 1 forks source link

Try DQN_cartpole.py with different domains #3

Closed schrum2 closed 5 years ago

schrum2 commented 5 years ago

I found that getting this code to work with MountainCar was as simple as changing the gym.make command to have 'MountainCar-v0'

However, the agent performed poorly. Maybe I didn't give it enough time, but it seemed like it wasn't learning very well. I wonder if tweaking the hyper parameters or other settings could make it learn properly.

For this issue, first try this code in the simple RL domains of Open AI Gym and take notes here on the baseline performance. Then, see if tweaking any settings helps performance. Talk to me about what you are trying to I can give helpful recommendations.

nazaruka commented 5 years ago

It works (to varying degrees, as you mentioned) in all the environments except for Pendulum-v0, which does not render at all. Upon running, it gave me the following code:

Traceback (most recent call last):
  File "DQN_cartpole.py", line 127, in <module>
    agent = DQN(act_dim=env.action_space.n, obs_dim=env.observation_space.shape[0],
AttributeError: 'Box' object has no attribute 'n'

I will see what I can do with the other environments, specifically MountainCar-v0 and its continuous variant.

nazaruka commented 5 years ago

It turns out that I get this same error as when I replace CartPole-v1 with any of the Box2D domains! If all it takes is to replace env.action_space.n with env.action_space.shape[0], then I might just be on my way with #10.

schrum2 commented 5 years ago

I feel that this issue has been sufficiently explored