forked from JonathanCollu/PolicyBased_DeepRL
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathmake_plot.py
28 lines (21 loc) · 818 Bytes
/
make_plot.py
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
from utils import *
import numpy as np
plot_name = "reinforce"
plot_title = "REINFORCE and ActorCritic without bootstrap"
optimum = 500
repetitions = 3
run_names = [("reinf", "REINFORCE"), ("reinf_baseline", "ActorCritic + baseline sub."), ("reinforce_entr0.2", "REINFORCE + entropy reg."), ("reinforce_baseline_entr0.2", "ActorCritic + baseline sub. + entropy reg.")]
plot = LearningCurvePlot(title = plot_title)
for name, label in run_names:
curve = None
for i in range(repetitions):
c = np.load(f"exp_results/{name}_{i}.npy")[2]
if curve is None:
curve = c
else:
curve += c
curve /= repetitions
curve = smooth(curve, 35, 1)
plot.add_curve(curve, label=label)
plot.add_hline(optimum, label="optimum")
plot.save("plots/" + plot_name + ".png")