You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I am currently trying to train an agent from Stable Baselines 3 on the Mountain Car Continuous environment. I wish to increase the number of max_episode_steps (which is set to 999 by default) to a higher number since the agent seems to not be able to train well with these number of steps.
I was wondering if there is a function to overwrite the predefined registration in: https://github.com/Farama-Foundation/Gymnasium/blob/main/gymnasium/envs/__init__.py
I am just begining with Gymnasium, but it seems that the gym.make() method is responsible to inititate the environment with this max_episode_steps as the termination is not present in the step() method in the Continuous_MountainCarEnv class.
Also, I suspect the reward_threshold should be changed in accordance if I change the max_episode_steps, is this right?
The text was updated successfully, but these errors were encountered:
Simply add an argument 'max_episode_steps' when you are trying to initialize the environment,
e.g. env = gym.make("MountainCar-v0", max_episode_steps=2000, render_mode="human")
which can change the max_episode_steps in the EnvSpec.
While truncation is always False in Continuous_MountainCarEnv, using gymnasium.wrappers.TimeLimit may help you to add truncated in steps.
Hope this can answer your question.
pseudo-rnd-thoughts
changed the title
[Question] How to modify registration?
[Question] How to increase the number of max episode steps
May 10, 2023
Thanks Norman and Mark for the quick responses. The methods mentioned indeed work. Can you answer my second question in the post? Does the reward threshold need to be changed if the maximum episode steps change? I see that for the Continuous_MountainCarEnv is set by default to +90.0
Question
I am currently trying to train an agent from Stable Baselines 3 on the Mountain Car Continuous environment. I wish to increase the number of
max_episode_steps
(which is set to 999 by default) to a higher number since the agent seems to not be able to train well with these number of steps.I was wondering if there is a function to overwrite the predefined registration in:
https://github.com/Farama-Foundation/Gymnasium/blob/main/gymnasium/envs/__init__.py
I am just begining with Gymnasium, but it seems that the
gym.make()
method is responsible to inititate the environment with thismax_episode_steps
as the termination is not present in thestep()
method in theContinuous_MountainCarEnv
class.Also, I suspect the
reward_threshold
should be changed in accordance if I change themax_episode_steps
, is this right?The text was updated successfully, but these errors were encountered: