Mark
/
celeste-ai
Archived
1
0
Fork 0

Added new plotting script

master
Mark 2023-02-19 20:57:32 -08:00
parent 55ac62dc47
commit ab355475d5
Signed by: Mark
GPG Key ID: AD62BB059C2AAEE4
1 changed files with 47 additions and 0 deletions

47
celeste/plot.py Normal file
View File

@ -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())
)