Skip to content

Commit

Permalink
fix: typo num_episodes -> max_episode_length
Browse files Browse the repository at this point in the history
  • Loading branch information
BillHuang2001 committed Nov 4, 2024
1 parent 7f1e8aa commit 9d592fc
Showing 1 changed file with 6 additions and 6 deletions.
12 changes: 6 additions & 6 deletions src/evox/problems/neuroevolution/reinforcement_learning/brax.py
Original file line number Diff line number Diff line change
Expand Up @@ -172,7 +172,7 @@ def visualize(
weights,
output_type: str = "HTML",
respect_done: bool = False,
num_episodes: Optional[int] = None,
max_episode_length: Optional[int] = None,
*args,
**kwargs,
):
Expand All @@ -188,9 +188,9 @@ def visualize(
The output type, either "HTML" or "rgb_array".
respect_done
Whether to respect the done signal.
num_episodes
The number of episodes to visualize, used to override the num_episodes in the constructor.
If None, use the num_episodes in the constructor.
max_episode_length
Used to override the max_episode_length in the constructor.
If None, use the max_episode_length in the constructor.
"""
assert output_type in [
"HTML",
Expand All @@ -208,8 +208,8 @@ def visualize(
else:
rollout_state = (brax_state,)

num_episodes = num_episodes or self.num_episodes
for _ in range(num_episodes):
max_episode_length = max_episode_length or self.max_episode_length
for _ in range(max_episode_length):
if self.stateful_policy:
state, brax_state = rollout_state
action, state = self.policy(state, weights, brax_state.obs)
Expand Down

0 comments on commit 9d592fc

Please sign in to comment.