Skip to content

feat: save and reuse trained shadow models #357

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 20 commits into
base: main
Choose a base branch
from
Open

Conversation

rpreen
Copy link
Contributor

@rpreen rpreen commented Jul 22, 2025

Resolves #347 and resolves #351

  • Move shadow model training to sacroml/attacks/utils.py and save trained models and indices to subfolders;
  • Reuse any previously trained models;
    • This means that if different LiRA modes need to be computed (e.g., offline and online) a new attack object can simply be created with a different mode and it will quickly run the attack using previously trained models and save the output to the report JSON and PDF.
    • Any other future attacks that may use shadow models can reuse these trained models;
    • A small number of shadow models (e.g., 10) can be initially be used to compute scores and then if needed a subsequent attack object with a larger number (e.g., 20) can be run and it will only need to train the additional models;

Copy link

codecov bot commented Jul 22, 2025

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 99.72%. Comparing base (f97195f) to head (2d713c3).

Additional details and impacted files
@@           Coverage Diff           @@
##             main     #357   +/-   ##
=======================================
  Coverage   99.72%   99.72%           
=======================================
  Files          43       44    +1     
  Lines        4343     4386   +43     
=======================================
+ Hits         4331     4374   +43     
  Misses         12       12           

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

@rpreen rpreen marked this pull request as ready for review July 22, 2025 19:00
@rpreen rpreen force-pushed the save_shadow_models branch from 83a5604 to 2d713c3 Compare July 25, 2025 09:31
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

[New Feature Request] Compute all LiRA modes simultaneously [New Feature Request] Add option to save shadow models generated
1 participant