Skip to content

Commit

Permalink
Plots
Browse files Browse the repository at this point in the history
  • Loading branch information
PavelCz committed Jul 25, 2022
1 parent 9853f83 commit 99d0974
Show file tree
Hide file tree
Showing 4 changed files with 8 additions and 12 deletions.
4 changes: 2 additions & 2 deletions src/scripts/plot_pbt_laser_attack-ci.py
Original file line number Diff line number Diff line change
Expand Up @@ -64,7 +64,7 @@
# fig = plt.figure(figsize=(10, 5))
plt.xticks([0, 1e7, 2e7, 3e7, 4e7, 5e7])
# Remove y tick labels
if i != 0:
plt.yticks(ticks=[-1000, -750, -500,-250, 0,250,500],labels=["","","","","","",""])
# if i != 0:
# plt.yticks(ticks=[-1000, -750, -500,-250, 0,250,500],labels=["","","","","","",""])
# plt.show()
plt.savefig(f"{name}.pdf")
8 changes: 2 additions & 6 deletions src/scripts/plot_pbt_laser_attacks.py
Original file line number Diff line number Diff line change
Expand Up @@ -7,11 +7,7 @@
from scripts.common import get_run_df
from scripts.stylesheets import setup_styles

# run = api.run("chaiberkeley/pbrl-defense-icml/seqb62s8")
#
# print(run.config)
# print(run.history())
# print(run.summary)

import pickle

legend = True
Expand All @@ -23,7 +19,7 @@
"attack-pbt-laser-60-v2",
"attack-pbt-laser-80-v2",
]
names = ["Self-play", "PBRL-20", "PBRL-40", "PBRL-60", "PBRL-80"]
names = ["Self-play", "PBT-20", "PBT-40", "PBT-60", "PBT-80"]
colors = ["red", "blue", "green", "orange", "purple"]
max = 50_000_000
if legend:
Expand Down
4 changes: 2 additions & 2 deletions src/scripts/plot_sp_laser_attack.py
Original file line number Diff line number Diff line change
Expand Up @@ -40,11 +40,11 @@
legend=False,
label="Adversary",
)
ax.set(ylim=(-2000, 2000))
ax.set(ylim=(-2000, 1000))
ax.axhline(0, color="black", linestyle="--", label="Zero")
handles, _ = ax.get_legend_handles_labels()
# handles = [handles[0], handles[2]] # Remove the legend for the CI
ax.legend(loc="lower right", handles=handles)
#ax.legend(loc="lower right", handles=handles)
ax.set_xlabel("Timestep")
ax.set_ylabel("Return")
plt.xticks([0, 1e7, 2e7, 3e7, 4e7, 5e7])
Expand Down
4 changes: 2 additions & 2 deletions src/scripts/stylesheets.py
Original file line number Diff line number Diff line change
Expand Up @@ -86,10 +86,10 @@
"figure.subplot.bottom": 0.21,
},
"training-curve-laser-ci": {
"figure.figsize": (2.2, 3.5),
"figure.figsize": (3.5, 2.6),
"figure.subplot.top": 0.93,
"figure.subplot.right": 0.93,
"figure.subplot.left": 0.05,
"figure.subplot.left": 0.18,
"figure.subplot.bottom": 0.21,
},
"training-curve-2col": {
Expand Down

0 comments on commit 99d0974

Please sign in to comment.