peal.web.summarize.summarize

peal.web.summarize.summarize(job_dir)[source]

Condense a finished web-demo job into <job_dir>/results.json.

Parameters:

job_dir (str) – Job directory containing run/ (the DiDAE run directory) and log.txt (captured stdout of run_didae.py).

Returns:

The written summary with keys directions (one entry per ranked direction from run/sweep_results.pt with its flip counts, verdict and collage paths), feedback (verdicts keyed by direction index as strings), false_directions (indices judged "false"), accuracies (parsed from log.txt), outputs (relative paths of run/model.onnx / run/model.cpl when present) and corrected (True when an ONNX model exists and at least one direction was marked false).

Return type:

dict

Notes

torch is imported lazily and only when run/sweep_results.pt exists, so the summary of a failed job can be built without a GPU environment. All paths in the result are relative to job_dir so the results page can serve them directly.