Skip to content

Commit

Permalink
fix(stats/evaluation): make execution of compare_policies invariant t…
Browse files Browse the repository at this point in the history
…o the ordering of input agent_stats_list.
  • Loading branch information
omardrwch committed Mar 9, 2021
1 parent 3fddd42 commit 69f7d53
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions rlberry/stats/evaluation.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,6 @@
import matplotlib.pyplot as plt
import pandas as pd
import seaborn as sns
import rlberry.seeding as seeding
from itertools import cycle


Expand Down Expand Up @@ -198,8 +197,6 @@ def compare_policies(agent_stats_list,
use_eval_from_agent_stats = (eval_env is None)
use_horizon_from_agent_stats = (eval_horizon is None)

rng = agent_stats_list[0].seeder.rng

agents_rewards = []
for agent_stats in agent_stats_list:
# train agents if they are not already trained
Expand All @@ -216,6 +213,9 @@ def compare_policies(agent_stats_list,
assert eval_horizon is not None, \
"eval_horizon not in AgentStats %s" % agent_stats.agent_name

# get rng from agent_stats
rng = agent_stats.seeder.rng

# evaluate agent
episode_rewards = np.zeros(n_sim)
for sim in range(n_sim):
Expand Down

0 comments on commit 69f7d53

Please sign in to comment.