|View source on GitHub|
Suite for loading Gym Environments.
Note we use gym.spec(env_id).make() on gym envs to avoid getting a TimeLimit wrapper on the environment. OpenAI's TimeLimit wrappers terminate episodes without indicating if the failure is due to the time limit, or due to negative agent behaviour. This prevents us from setting the appropriate discount value for the final step of an episode. To prevent that we extract the step limit from the environment specs and utilize our TimeLimit wrapper.
load(...): Loads the selected environment and wraps it with the specified wrappers.
wrap_env(...): Wraps given gym environment with TF Agent's GymWrapper.