From 4fcaea03570ef697f663b18d83b46d5da58b7007 Mon Sep 17 00:00:00 2001 From: bri25yu Date: Wed, 31 Aug 2022 18:20:28 -0700 Subject: [PATCH] setting MAX_VIDEO_LEN in __init__ uses global param --- hw1/cs285/infrastructure/rl_trainer.py | 3 +++ 1 file changed, 3 insertions(+) diff --git a/hw1/cs285/infrastructure/rl_trainer.py b/hw1/cs285/infrastructure/rl_trainer.py index df8cbe502..0e04ec4fe 100644 --- a/hw1/cs285/infrastructure/rl_trainer.py +++ b/hw1/cs285/infrastructure/rl_trainer.py @@ -47,6 +47,9 @@ def __init__(self, params): # Maximum length for episodes self.params['ep_len'] = self.params['ep_len'] or self.env.spec.max_episode_steps + + # We need to update our outer `MAX_VIDEO_LEN` value + global MAX_VIDEO_LEN MAX_VIDEO_LEN = self.params['ep_len'] # Is this env continuous, or self.discrete?