refactor(attr-inference+data-recon): migrate to new attack architecture#80
Open
asim29 wants to merge 1 commit intopr/4.6-discriminatory-behaviorfrom
Open
refactor(attr-inference+data-recon): migrate to new attack architecture#80asim29 wants to merge 1 commit intopr/4.6-discriminatory-behaviorfrom
asim29 wants to merge 1 commit intopr/4.6-discriminatory-behaviorfrom
Conversation
…ls to new architecture DudduCIKM2022 subclasses AttributeInferenceAttack(ABC); FredriksonCCS2015 subclasses DataReconstructionAttack(ABC). attack_accuracy: docstring converted to Google style. similarity_evaluation: module-level __figure_mse replaced with a module-private helper. Examples updated to use load_or_train. Dataset integration tests added for CelebA, LFW, and UTKFace loaders.
3 tasks
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Context
Seventh in the
refactor/risk-modulesstack. Stacked on #79 (discriminatory behavior). Final risk-vertical PR.Changes
amulet/attribute_inference/attacks/duddu_cikm_2022.pyDudduCIKM2022subclassesAttributeInferenceAttack(ABC)and delegatestarget_model,x_train_adv,x_test,z_train_adv,devicetosuper().__init__().attack()return type narrowed todict[int, dict[str, np.ndarray]].amulet/attribute_inference/metrics/attack_accuracy.py:class:RST markup removed.amulet/data_reconstruction/attacks/fredrikson_ccs_2015.pyFredriksonCCS2015subclassesDataReconstructionAttack(ABC)and delegatestarget_model,input_size,output_size,devicetosuper().__init__().amulet/data_reconstruction/metrics/similarity_evaluation.py__figure_mse(mangled name, invisible outside module) replaced with a module-private_figure_msehelper. Docstring converted to Google style.examples/attack_pipelines/run_attribute_inference.py/run_data_recon.pyload_or_traininstead of manual save/load blocks.tests/integration/test_other_risks.py(new)DudduCIKM2022.attack(),FredriksonCCS2015.attack(), andSuriEvans2022.attack().tests/integration/test_celeba_datasets.py,test_lfw_datasets.py,test_utkface_datasets.py(new)@pytest.mark.integration; require network/disk access).tests/unit/test_metrics_attribute.py(new)evaluate_attribute_inferencecovering perfect-prediction identity and output shape.Test plan
uv run pytest tests/integration/test_other_risks.py -v -m integrationuv run pytest tests/unit/test_metrics_attribute.py -vuv run pre-commit run --all-files