-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathsummary.py
More file actions
28 lines (25 loc) · 947 Bytes
/
summary.py
File metadata and controls
28 lines (25 loc) · 947 Bytes
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
import json
import os
from omegaconf import OmegaConf
import glob
from tabulate import tabulate
import pandas as pd
filepaths = ["launch/outputs/prefix_sums_test"] # edit this list to add the directories with the tested models in
count =0
checkpoints = []
for filepath in filepaths:
for f_name in glob.iglob(f"{filepath}/**/*testing*/stats.json", recursive=True):
print(f_name)
model_path = "/".join(f_name.split("/")[1:-1])
json_name = os.path.join("/".join(f_name.split("/")[:-1]), "stats.json")
with open(json_name) as f:
data = json.load(f)
checkpoints.append([model_path,
round(data["alpha"],2),
round(max(data["train_acc"].values()),3),
round(max(data["val_acc"].values()),3),
round(max(data["test_acc"].values()),3)
])
count+=1
head = ["Model Name","Alpha","Train Acc","Val Acc","Test Acc"]
print(tabulate(checkpoints, headers=head))