Conversation
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## main #440 +/- ##
=======================================
Coverage 99.51% 99.52%
=======================================
Files 23 23
Lines 2692 2713 +21
=======================================
+ Hits 2679 2700 +21
Misses 13 13 ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
|
@rpreen Please let me know what you think of this when you get a chance! |
|
@ssrhaso does this affect the meta-attack? |
…t-size # Conflicts: # sacroml/attacks/attack.py # sacroml/attacks/likelihood_attack.py
Avoids stray .npz files when callers request individual scores in-memory but no report on disk (e.g. MetaAttack sub-runs).
@jim-smith To my understanding and after checking thoroughly, no it does not. MetaAttack reads per-record scores from the in-memory sub-attack object, not from the JSON, so the key-stripping doesn't affect it. Spotted one related side-effect while checking: the new .npz write in LIRAAttack._save_attack_metrics was gated on report_individual only, so MetaAttack sub-runs (which set write_report=False) would have dropped stray lira_individual.npz files in each sub_dir. Pushed a fix to also gate on write_report. |
Summary
Reduce JSON report file size by removing large derived arrays and externalising individual record data.
fpr,tpr, androc_thresharrays from JSON serialisation via a_json_exclude_keysclass attribute on theAttackbase class. PDF generation is unaffected as it reads from the in-memory dict before serialisation..npzfile, storing a relative filename in JSON for portability. Includesy_pred_probaandy_testto allow ROC recomputation from stored data.LogLogROCModulefor JSON files without ROC arrays.For a CIFAR10-scale dataset, this reduces a single attack JSON from approximately 1.2MB to under 100KB.
Closes #437