Skip to content

Commit

Permalink
Updating reward gathering
Browse files Browse the repository at this point in the history
  • Loading branch information
yngtodd committed Dec 13, 2018
1 parent 6f13927 commit 2f66c89
Showing 1 changed file with 11 additions and 1 deletion.
12 changes: 11 additions & 1 deletion hyperpoints/utils/utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,17 @@ def gather_rewards(path: str, savefile: str=None) -> pd.DataFrame:
p = Path(path)
results_paths = [x for x in p.iterdir() if x.is_dir()]
results_paths = [x.joinpath('progress.csv') for x in results_paths]
results = [pd.read_csv(x) for x in results_paths]

results = []
for i in results_paths:
try:
res = pd.read_csv(i)
if len(res) > 1000:
results.append(res)
except Exception:
pass

print(f'Number of results: {len(results)}')
rewards = [np.array(x['PMM:episode_rewards']) for x in results]
rewards = pd.concat([pd.Series(x) for x in rewards], axis=1)

Expand Down

0 comments on commit 2f66c89

Please sign in to comment.