Skip to content

Commit

Permalink
fix unset reward
Browse files Browse the repository at this point in the history
  • Loading branch information
maurerle committed Oct 31, 2023
1 parent 2fc1497 commit 7482680
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions assume/common/outputs.py
Original file line number Diff line number Diff line change
Expand Up @@ -411,8 +411,10 @@ def get_sum_reward(self):
f"select reward FROM rl_params where simulation='{self.simulation_id}'"
)

avg_reward = 0
with self.db.begin() as db:
reward = db.execute(query).fetchall()
if len(reward):
avg_reward = sum(r[0] for r in reward) / len(reward)

return avg_reward

0 comments on commit 7482680

Please sign in to comment.