File size: 598 Bytes
fd13782
 
 
 
 
 
 
1
2
3
4
5
6
7
8
"""Minimal reader for one score file of the STRICT record (a PIDSMaker evaluation output written by torch.save,
despite its .pkl name). Needs PyTorch; weights_only=False because the file holds Python objects, so load only files whose
hash matches a manifest."""
import sys, torch
d = torch.load(sys.argv[1], map_location="cpu", weights_only=False)
print({k: (getattr(v, "shape", None) or (len(v) if hasattr(v, "__len__") else v)) for k, v in d.items()})
# keys: pred_scores (per node), y_preds (alert at the native threshold), y_truth (label), nodes (node ids), node2attacks (node -> campaign ids)