From ab355475d556dc23ed82ee571b89192dbd3bbe67 Mon Sep 17 00:00:00 2001 From: Mark Date: Sun, 19 Feb 2023 20:57:32 -0800 Subject: [PATCH] Added new plotting script --- celeste/plot.py | 47 +++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 47 insertions(+) create mode 100644 celeste/plot.py diff --git a/celeste/plot.py b/celeste/plot.py new file mode 100644 index 0000000..cd8699f --- /dev/null +++ b/celeste/plot.py @@ -0,0 +1,47 @@ +import torch +from pathlib import Path + +import celeste_ai.plotting as plotting +from multiprocessing import Pool + + + +m = Path("model_data/current") + + +# Make "predicted reward" plots +def plot_pred(src_model): + plotting.predicted_reward( + src_model, + m / f"plots/predicted/{src_model.stem}.png", + + device = torch.device("cpu") + ) + + +# Make "actual reward" plots +def plot_act(src_model): + plotting.actual_reward( + src_model, + (60, 80), + m / f"plots/actual/{src_model.stem}.png", + + device = torch.device("cpu") + ) + + + +if __name__ == "__main__": + print("Making prediction plots...") + with Pool(5) as p: + p.map( + plot_pred, + list((m / "model_archive").iterdir()) + ) + + print("Making actual plots...") + with Pool(5) as p: + p.map( + plot_act, + list((m / "model_archive").iterdir()) + ) \ No newline at end of file