Skip to content

Commit

Permalink
fix score
Browse files Browse the repository at this point in the history
  • Loading branch information
markub3327 committed Oct 12, 2023
1 parent bf36280 commit 37fa500
Showing 1 changed file with 6 additions and 2 deletions.
8 changes: 6 additions & 2 deletions rl_toolkit/agents/dueling_dqn/agent.py
Original file line number Diff line number Diff line change
Expand Up @@ -134,10 +134,14 @@ def collect(self, writer, policy):
action = np.array(action, copy=False, dtype=self._env.action_space.dtype)

# Perform action
new_obs, ext_reward, terminated, truncated, _ = self._env.step(action)
new_obs, ext_reward, terminated, truncated, info = self._env.step(action)

# Update variables
self._episode_reward += ext_reward
try:
self._episode_reward = info["score"]
except KeyError:
self._episode_reward += ext_reward

self._episode_steps += 1
self._total_steps += 1

Expand Down

0 comments on commit 37fa500

Please sign in to comment.