Skip to content
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

Update to ART 1.14.0 #2072

Merged
merged 192 commits into from
Mar 17, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
192 commits
Select commit Hold shift + click to select a range
c855476
begin evasion detector refactoring
f4str Dec 23, 2022
354f2d9
refactored binary detectors
f4str Dec 28, 2022
a5f6ad4
refactored subsetscanning detector
f4str Dec 29, 2022
e2be659
Initial version of SHAPr metric
abigailgold Feb 21, 2022
8962222
More tests
abigailgold Feb 27, 2022
b11f7ef
Initial version of notebook
abigailgold Feb 27, 2022
94aa825
Correct indexes
abigailgold Mar 13, 2022
b4de1aa
Remove redundant param
abigailgold Mar 13, 2022
e7f7c98
Updated notebook
abigailgold Mar 13, 2022
66145f0
Add comparison type to PDTP metric, fix SHAPr implementation so not d…
abigailgold Dec 28, 2022
fccc635
Fix tests and notebook
abigailgold Jan 5, 2023
e3537cf
Formatting
abigailgold Jan 5, 2023
b8592e4
More formatting
abigailgold Jan 6, 2023
8dce8dd
Correct test skipping lists
abigailgold Jan 9, 2023
9c50a2c
Small fix to PDTP metric, diff mode. Fix tests.
abigailgold Jan 10, 2023
d3af329
Minor improvement to SHAPr code + some more asserts in tests
abigailgold Jan 11, 2023
7e51ede
split the binary evasion detectors
f4str Jan 12, 2023
cdb2082
created updated pytest unit tests for binary evasion detectors
f4str Jan 12, 2023
515ec33
Initial implementation of categorical (string) feature support in Att…
abigailgold Jan 15, 2023
5af2c5b
refactored subsetscanning detector test cases
f4str Jan 17, 2023
96149b4
update evasion detector test cases
f4str Jan 17, 2023
3597ffe
fixed mypy errors
f4str Jan 17, 2023
74c934b
updated binary input detector notebook
f4str Jan 17, 2023
5f2c6d0
fixed style checks and test cases
f4str Jan 18, 2023
7a9c980
fixed docs typo and added more unit tests
f4str Jan 18, 2023
2172635
Support for sklearn pipelines and non-numeric features in shadow models
abigailgold Jan 24, 2023
fbcb2a6
Typing and formatting
abigailgold Jan 25, 2023
406747a
Support for non-numeric features in AttributeInferenceBaselineTrueLabel
abigailgold Jan 25, 2023
732b592
Support for non-numeric features in AttributeInferenceBlackbox
abigailgold Jan 26, 2023
982f5d7
Fix notebook + typing
abigailgold Jan 26, 2023
e768b81
Formatting
abigailgold Jan 26, 2023
cf9fdd5
Support continuous features in AttributeInferenceBlackBox
abigailgold Jan 26, 2023
6d16b80
Typing fixes
abigailgold Jan 26, 2023
c605081
Support continuous features for AttributeInferenceBaseline and Attrib…
abigailgold Jan 26, 2023
07f3f53
Typing
abigailgold Jan 29, 2023
44e3613
Fix tests + warnings
abigailgold Jan 29, 2023
cd15e9a
Formatting
abigailgold Jan 29, 2023
4982ee8
Fix test
abigailgold Jan 29, 2023
85bfabb
Improve documentation of new params
abigailgold Jan 31, 2023
f1994a9
Fix param and tests
abigailgold Jan 31, 2023
70a10d2
Remove attacked feature from list of non-numeric features
abigailgold Jan 31, 2023
bb73ce0
Skip tests for dl frameworks
abigailgold Jan 31, 2023
95a92c2
Fix mypy errors
abigailgold Jan 31, 2023
4d2971b
Fix tests + formatting
abigailgold Jan 31, 2023
7d50684
Formatting
abigailgold Feb 1, 2023
16011f4
Fix assert
abigailgold Feb 1, 2023
ea2b271
fixed classifier type and consolidated unit tests
f4str Feb 7, 2023
a2b2ceb
fixed style checks
f4str Feb 7, 2023
4a8f40b
Merge pull request #1993 from Ethos-lab/evasion-detector-refactor
beat-buesser Feb 8, 2023
147ac5b
Move call to _check_attack_feature() to AttributeInferenceAttack._che…
abigailgold Feb 9, 2023
6d50dbf
initial IBP training
GiulioZizzo Jan 28, 2023
b62a4ad
initial training loop
GiulioZizzo Feb 6, 2023
ec46896
fast computation of adversarial examples
GiulioZizzo Feb 9, 2023
5b5242c
improved name comvention
GiulioZizzo Feb 9, 2023
5453928
implement auto conjugate gradient attack
yamamura-k Feb 15, 2023
30d3352
implement auto conjugate gradient attack
yamamura-k Feb 15, 2023
5019f7b
implement auto conjugate gradient attack
yamamura-k Feb 15, 2023
b85a854
update docs
yamamura-k Feb 15, 2023
b915b03
small fix
yamamura-k Feb 15, 2023
4ed12ae
fix codes for batchsize > 1
yamamura-k Feb 17, 2023
8efea2c
modify the implementation of auto_projected_gradient_descent.py to en…
yamamura-k Feb 17, 2023
acab6fa
update training and fix gp error
GiulioZizzo Feb 13, 2023
8e0e9fa
general development of IBP training
GiulioZizzo Feb 17, 2023
f74f8f7
initial complete training loop
GiulioZizzo Feb 17, 2023
c9dcc32
fix initialization of stepsize eta
yamamura-k Feb 18, 2023
80cfe5c
improve performance and fix bugs
yamamura-k Feb 18, 2023
d1a2302
Change the default reduction type for backward to "sum".
yamamura-k Feb 18, 2023
dd1be2d
Change the default reduction type for backward to "sum".
yamamura-k Feb 18, 2023
169a799
Merge branch 'main' of https://github.com/yamamura-k/adversarial-robu…
yamamura-k Feb 19, 2023
e203341
Merge branch 'main' of https://github.com/yamamura-k/adversarial-robu…
yamamura-k Feb 19, 2023
dc64e4c
Merge remote-tracking branch 'origin/main' into dev_1.14.0
Feb 20, 2023
b8020ef
formatting using black==21.12b0
yamamura-k Feb 20, 2023
c3c74c6
Merge branch 'main' of https://github.com/yamamura-k/adversarial-robu…
yamamura-k Feb 20, 2023
e6c9bcb
Merge branch 'dev_1.14.0' into main
beat-buesser Feb 21, 2023
965780c
Merge branch 'dev_1.14.0' into dev_1.14.0_shapr
beat-buesser Feb 21, 2023
9e0277a
Merge branch 'dev_1.14.0' into dev_1.14.0_attribute_improvements
beat-buesser Feb 21, 2023
921a5d6
change expected value in tests/attacks/evasion/test_shadow_attack.py:62
yamamura-k Feb 22, 2023
8aa5d1b
rename bs -> _batch_size
yamamura-k Feb 22, 2023
200c7b1
apply snake_case to the functions
yamamura-k Feb 22, 2023
c46d414
rename yk -> delta_gradk
yamamura-k Feb 22, 2023
66add95
rename sk -> cgradk
yamamura-k Feb 22, 2023
ceb24d0
remove commented-out codes
yamamura-k Feb 22, 2023
c736cf1
add class/function docstrings
yamamura-k Feb 22, 2023
750a1e1
Merge branch 'main' of https://github.com/yamamura-k/adversarial-robu…
yamamura-k Feb 22, 2023
b866377
Merge branch 'main' into local_update
yamamura-k Feb 22, 2023
afc9d84
fix definition of CE loss for tensorflow 1.x
yamamura-k Feb 22, 2023
43c7b42
run black --line-length 120
yamamura-k Feb 23, 2023
2e1b978
fix initialization of gradk_1, cgradk_1, etc.
yamamura-k Feb 23, 2023
5272e86
fix initialization of _loss_object for Tensorflow v1
yamamura-k Feb 23, 2023
34266be
small fix for style check
yamamura-k Feb 23, 2023
2e62b3a
make not supporting tensorflow v1 explicit
yamamura-k Feb 24, 2023
62d7240
resolve the warnings from mypy
yamamura-k Feb 27, 2023
4ec4869
General development
GiulioZizzo Feb 20, 2023
911c5b9
fixig mypy, pylint, and cuda errors
GiulioZizzo Feb 23, 2023
221ed6f
adding example notebook
GiulioZizzo Feb 26, 2023
d900c5f
additional tests and notebook
GiulioZizzo Feb 27, 2023
ecd82ed
test framework fix and style edits
GiulioZizzo Feb 27, 2023
6c7d33b
style edits, name convention update
GiulioZizzo Feb 27, 2023
71857a7
moving import to within trainer class
GiulioZizzo Feb 27, 2023
e73c1e9
Merge pull request #2006 from abigailgold/dev_1.14.0_attribute_improv…
beat-buesser Feb 27, 2023
6125b1f
fix for pylint warnings
yamamura-k Feb 28, 2023
491bf16
Move call to _check_attack_feature() to AttributeInferenceAttack._che…
abigailgold Feb 28, 2023
21bf5b7
fixed swapped height and width for image perturbations
f4str Mar 1, 2023
9b4c3ff
fix for pytorch error
yamamura-k Mar 1, 2023
bba71c4
formatting edits
GiulioZizzo Mar 1, 2023
5f5a609
added test cases for image perturbations
f4str Mar 1, 2023
aaf9252
Merge branch 'dev_1.14.0' into dev_1.14.0_shapr
beat-buesser Mar 2, 2023
3f82f39
Merge branch 'dev_1.14.0' into main
beat-buesser Mar 2, 2023
bb306aa
Merge branch 'dev_1.14.0' into IBP_Training
beat-buesser Mar 3, 2023
221a641
Merge pull request #2046 from f4str/image-perturbation-bug
beat-buesser Mar 3, 2023
0985ef2
Merge branch 'dev_1.14.0' into dev_1.14.0_shapr
beat-buesser Mar 3, 2023
f91c0fd
bad det regional misclassfication attack implementation
f4str Feb 23, 2023
50e93f7
fixed incorrect indexing
f4str Mar 1, 2023
7a420f7
create new base class for object detector poisoning attacks
f4str Mar 4, 2023
cd778ac
replace audio perturbation functions with classes so that audio trigg…
swsuggs Mar 6, 2023
a74ccc1
update tests for audio perturbations
swsuggs Mar 6, 2023
a284bf4
create notebook demo for baddet rma
f4str Mar 6, 2023
9498d47
added baddet rma unit tests
f4str Mar 6, 2023
43869f1
rename demo notebook
f4str Mar 6, 2023
7578de8
fix style checks
f4str Mar 7, 2023
ce25841
update notebook readme with demo
f4str Mar 7, 2023
0727e2b
Merge pull request #1978 from abigailgold/dev_1.14.0_shapr
beat-buesser Mar 7, 2023
d80d24d
Updating docstrings
swsuggs Mar 7, 2023
f0acc10
Merge branch 'dev_1.14.0' into cache-audio-perturbations
swsuggs Mar 7, 2023
11adf9f
removing whitespace
swsuggs Mar 7, 2023
e55b0d1
adding access methods to fetch classifier from trainer. Updating IBP …
GiulioZizzo Mar 7, 2023
6fa0170
Update art/estimators/certification/interval/pytorch.py
GiulioZizzo Mar 7, 2023
92f338f
Update art/defences/trainer/ibp_certified_trainer_pytorch.py
GiulioZizzo Mar 7, 2023
879d8fd
Update art/estimators/certification/interval/pytorch.py
GiulioZizzo Mar 7, 2023
f57a9ff
additional formatting
swsuggs Mar 7, 2023
bb973f3
Merge branch 'dev_1.14.0' into bad-dets-attack
f4str Mar 7, 2023
26f978f
name change from Pytorch to PyTorch
GiulioZizzo Mar 8, 2023
98aa1b6
name change from Pytorch to PyTorch
GiulioZizzo Mar 8, 2023
0b6046c
adding return for initialise_default_scheduler
GiulioZizzo Mar 8, 2023
21ff216
re-adding mypy fix
GiulioZizzo Mar 9, 2023
0e54668
updating docs
GiulioZizzo Mar 9, 2023
cd3ce4e
address review commends
f4str Mar 9, 2023
4c42f97
Update supported and tested Python versions
Mar 10, 2023
9013b8c
Merge branch 'dev_1.14.0' into IBP_Training
beat-buesser Mar 10, 2023
5d10d51
Merge branch 'dev_1.14.0' into main
beat-buesser Mar 10, 2023
affc604
Update supported and tested Python versions
Mar 10, 2023
9b2891b
Merge pull request #2044 from GiulioZizzo/IBP_Training
beat-buesser Mar 11, 2023
09281d0
Merge branch 'dev_1.14.0' into main
beat-buesser Mar 11, 2023
0a0a701
Merge pull request #2028 from yamamura-k/main
beat-buesser Mar 11, 2023
43e79fe
Merge branch 'dev_1.14.0' into bad-dets-attack
beat-buesser Mar 11, 2023
982bf7b
Update supported and tested Python versions
Mar 11, 2023
cdff3cf
Merge pull request #2054 from f4str/bad-dets-attack
beat-buesser Mar 12, 2023
e30b432
Update GaussianNB.get_trainable_attribute_names for scikit-learn >=1.0
Mar 12, 2023
0d70547
implement model training for pytorch faster rcnn
f4str Mar 11, 2023
5287f9e
use batches for pytorch faster rcnn predictions
f4str Mar 11, 2023
3cc3083
implement model training for pytorch yolo
f4str Mar 11, 2023
8ce4eca
added pytorch yolo test for fit
f4str Mar 11, 2023
3b95fb0
added missing pytorch yolo estimator params
f4str Mar 11, 2023
3fb0f52
update predict batching
f4str Mar 12, 2023
f687f14
update BadDet notebook with model fitting
f4str Mar 12, 2023
86312e0
rewrite pytorch object detector tests in pytest
f4str Mar 13, 2023
a4d0f87
cleanup pytorch yolo and object detector tests
f4str Mar 13, 2023
aa88c72
convert pytorch faster rcnn test cases to pytest
f4str Mar 13, 2023
0ba2e62
fix style checks
f4str Mar 13, 2023
8feb7a5
Merge branch 'dev_1.14.0' of https://github.com/Trusted-AI/adversaria…
swsuggs Mar 13, 2023
6098e4a
docstrings rearrangement
swsuggs Mar 13, 2023
4ff83fa
Update lingvo workflow
Mar 13, 2023
8dc415e
remove pylint ignores and add check for classifier type
GiulioZizzo Mar 13, 2023
e0680c6
further removal of pylint disable
GiulioZizzo Mar 13, 2023
9109b27
address review comments
f4str Mar 13, 2023
98f6d05
fix style checks
f4str Mar 13, 2023
ad31729
Merge branch 'dev_1.14.0' into development_maintenance_1140
beat-buesser Mar 13, 2023
d4e326c
address remainder of review comments
f4str Mar 13, 2023
15266e5
bugfix and more informative progress bar
GiulioZizzo Mar 13, 2023
9509942
implement bad det gma attack
f4str Mar 14, 2023
2f5f0c6
implement bad det oda attack
f4str Mar 14, 2023
0e7822a
enable channel agnostic attacks
f4str Mar 14, 2023
84ad7da
implement bad det oga attack
f4str Mar 14, 2023
1d74a0a
fix style checks
f4str Mar 14, 2023
7e33038
Merge pull request #2063 from Trusted-AI/development_maintenance_1140
beat-buesser Mar 14, 2023
52baf71
Merge branch 'dev_1.14.0' into cache-audio-perturbations
beat-buesser Mar 14, 2023
8a6ecf8
Merge branch 'dev_1.14.0' into pytorch-object-detector-training
beat-buesser Mar 14, 2023
4a4e8fe
better loading bar info
GiulioZizzo Mar 14, 2023
d3d1c8b
Merge branch 'dev_1.14.0' into zonotope_updates_1.14
GiulioZizzo Mar 14, 2023
f48d73e
Merge pull request #2053 from swsuggs/cache-audio-perturbations
beat-buesser Mar 14, 2023
f774359
Merge branch 'dev_1.14.0' into pytorch-object-detector-training
beat-buesser Mar 14, 2023
75399dd
addressing mypy errors
GiulioZizzo Mar 14, 2023
ed8f63a
Merge branch 'dev_1.14.0' into bad-dets-attacks
f4str Mar 14, 2023
1dd1e10
address review comments
f4str Mar 14, 2023
587783b
Merge pull request #2067 from f4str/pytorch-object-detector-training
beat-buesser Mar 15, 2023
31d13e7
Merge branch 'dev_1.14.0' into zonotope_updates_1.14
beat-buesser Mar 15, 2023
1f89ee9
Merge branch 'dev_1.14.0' into bad-dets-attacks
f4str Mar 15, 2023
b398942
update bad det notebook and fix yolo input size bug
f4str Mar 15, 2023
8f077bd
Merge pull request #2070 from GiulioZizzo/zonotope_updates_1.14
beat-buesser Mar 15, 2023
8ce733b
Merge branch 'dev_1.14.0' into bad-dets-attacks
beat-buesser Mar 15, 2023
d596fee
Merge pull request #2069 from f4str/bad-dets-attacks
beat-buesser Mar 16, 2023
1c7bacf
Merge branch 'main' into dev_1.14.0
beat-buesser Mar 16, 2023
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion .github/workflows/ci-pytorch-object-detectors.yml
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ jobs:
- name: Setup Python
uses: actions/setup-python@v4
with:
python-version: 3.8
python-version: '3.10'
- name: Install Dependencies
run: |
sudo apt-get update
Expand Down
10 changes: 8 additions & 2 deletions .github/workflows/ci-pytorch.yml
Original file line number Diff line number Diff line change
Expand Up @@ -28,13 +28,13 @@ jobs:
fail-fast: false
matrix:
include:
- name: PyTorch 1.11.0 (Python 3.8)
- name: PyTorch 1.11.0 (Python 3.9)
framework: pytorch
python: 3.8
torch: 1.11.0+cpu
torchvision: 0.12.0+cpu
torchaudio: 0.11.0
- name: PyTorch 1.12.1 (Python 3.8)
- name: PyTorch 1.12.1 (Python 3.9)
framework: pytorch
python: 3.8
torch: 1.12.1+cpu
Expand All @@ -46,6 +46,12 @@ jobs:
torch: 1.13.1+cpu
torchvision: 0.14.1+cpu
torchaudio: 0.13.1
- name: PyTorch 1.13.1 (Python 3.10)
framework: pytorch
python: '3.10'
torch: 1.13.1+cpu
torchvision: 0.14.1+cpu
torchaudio: 0.13.1

name: ${{ matrix.name }}
steps:
Expand Down
16 changes: 10 additions & 6 deletions .github/workflows/ci-scikit-learn.yml
Original file line number Diff line number Diff line change
Expand Up @@ -32,14 +32,18 @@ jobs:
framework: scikitlearn
scikit-learn: 0.24.2
python: 3.9
- name: scikit-learn 1.0.2 (Python 3.9)
- name: scikit-learn 1.1.3 (Python 3.9)
framework: scikitlearn
scikit-learn: 1.0.2
scikit-learn: 1.1.3
python: 3.9
- name: scikit-learn 1.1.0 (Python 3.9)
- name: scikit-learn 1.2.2 (Python 3.9)
framework: scikitlearn
scikit-learn: 1.1.0
scikit-learn: 1.2.2
python: 3.9
- name: scikit-learn 1.2.2 (Python 3.10)
framework: scikitlearn
scikit-learn: 1.2.2
python: '3.10'

name: ${{ matrix.name }}
steps:
Expand All @@ -55,8 +59,8 @@ jobs:
sudo apt-get -y -q install ffmpeg libavcodec-extra
python -m pip install --upgrade pip setuptools wheel
pip install -r requirements_test.txt
pip install tensorflow==2.7.0
pip install keras==2.7.0
pip install tensorflow==2.10.1
pip install keras==2.10.0
pip install scikit-learn==${{ matrix.scikit-learn }}
pip list
- name: Run Tests
Expand Down
7 changes: 7 additions & 0 deletions .github/workflows/ci-tensorflow-v2.yml
Original file line number Diff line number Diff line change
Expand Up @@ -49,6 +49,13 @@ jobs:
tf_version: v2
keras: 2.10.0
tf_addons: 0.18.0
- name: TensorFlow 2.10.1 (Keras 2.10.0 Python 3.10)
framework: tensorflow
python: '3.10'
tensorflow: 2.10.1
tf_version: v2
keras: 2.10.0
tf_addons: 0.18.0

name: ${{ matrix.name }}
steps:
Expand Down
3 changes: 2 additions & 1 deletion art/attacks/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,8 @@
Module providing adversarial attacks under a common interface.
"""
from art.attacks.attack import Attack, EvasionAttack, PoisoningAttack, PoisoningAttackBlackBox, PoisoningAttackWhiteBox
from art.attacks.attack import PoisoningAttackTransformer, ExtractionAttack, InferenceAttack, AttributeInferenceAttack
from art.attacks.attack import PoisoningAttackGenerator, PoisoningAttackTransformer, PoisoningAttackObjectDetector
from art.attacks.attack import ExtractionAttack, InferenceAttack, AttributeInferenceAttack
from art.attacks.attack import ReconstructionAttack

from art.attacks import evasion
Expand Down
52 changes: 49 additions & 3 deletions art/attacks/attack.py
Original file line number Diff line number Diff line change
Expand Up @@ -22,12 +22,13 @@

import abc
import logging
from typing import Any, List, Optional, Tuple, Union, TYPE_CHECKING
from typing import Any, Dict, List, Optional, Tuple, Union, TYPE_CHECKING

import numpy as np

from art.exceptions import EstimatorError
from art.summary_writer import SummaryWriter, SummaryWriterDefault
from art.utils import get_feature_index

if TYPE_CHECKING:
from art.utils import CLASSIFIER_TYPE, GENERATOR_TYPE
Expand Down Expand Up @@ -265,7 +266,7 @@ def poison_estimator(
max_iter: int,
lambda_p: float,
verbose: int,
**kwargs
**kwargs,
) -> "GENERATOR_TYPE":
"""
Returns a poisoned version of the generator used to initialize the attack
Expand Down Expand Up @@ -324,6 +325,39 @@ def poison_estimator(self, x: np.ndarray, y: np.ndarray, **kwargs) -> "CLASSIFIE
raise NotImplementedError


class PoisoningAttackObjectDetector(Attack):
"""
Abstract base class for poisoning attack classes on object detection models.
"""

def __init__(self):
"""
Initializes object detector poisoning attack.
"""
super().__init__(None) # type: ignore

@abc.abstractmethod
def poison(
self,
x: np.ndarray,
y: List[Dict[str, np.ndarray]],
**kwargs,
) -> Tuple[np.ndarray, List[Dict[str, np.ndarray]]]:
"""
Generate poisoning examples and return them as an array. This method should be overridden by all concrete
poisoning attack implementations.

:param x: An array with the original inputs to be attacked.
:param y: True labels of type `List[Dict[np.ndarray]]`, one dictionary per input image.
The keys and values of the dictionary are:
- boxes [N, 4]: the boxes in [x1, y1, x2, y2] format, with 0 <= x1 < x2 <= W and 0 <= y1 < y2 <= H.
- labels [N]: the labels for each image
- scores [N]: the scores or each prediction.
:return: An tuple holding the `(poisoning_examples, poisoning_labels)`.
"""
raise NotImplementedError


class PoisoningAttackBlackBox(PoisoningAttack):
"""
Abstract base class for poisoning attack classes that have no access to the model (classifier object).
Expand Down Expand Up @@ -425,7 +459,8 @@ def __init__(self, estimator, attack_feature: Union[int, slice] = 0):
:param attack_feature: The index of the feature to be attacked.
"""
super().__init__(estimator)
self.attack_feature = attack_feature
self._check_attack_feature(attack_feature)
self.attack_feature = get_feature_index(attack_feature)

@abc.abstractmethod
def infer(self, x: np.ndarray, y: Optional[np.ndarray] = None, **kwargs) -> np.ndarray:
Expand All @@ -439,6 +474,17 @@ def infer(self, x: np.ndarray, y: Optional[np.ndarray] = None, **kwargs) -> np.n
"""
raise NotImplementedError

@staticmethod
def _check_attack_feature(attack_feature: Union[int, slice]) -> None:
if not isinstance(attack_feature, int) and not isinstance(attack_feature, slice):
raise ValueError("Attack feature must be either an integer or a slice object.")

if isinstance(attack_feature, int) and attack_feature < 0:
raise ValueError("Attack feature index must be non-negative.")

def _check_params(self) -> None:
self._check_attack_feature(self.attack_feature)


class MembershipInferenceAttack(InferenceAttack):
"""
Expand Down
1 change: 1 addition & 0 deletions art/attacks/evasion/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@
from art.attacks.evasion.adversarial_asr import CarliniWagnerASR
from art.attacks.evasion.auto_attack import AutoAttack
from art.attacks.evasion.auto_projected_gradient_descent import AutoProjectedGradientDescent
from art.attacks.evasion.auto_conjugate_gradient import AutoConjugateGradient

if importlib.util.find_spec("numba") is not None:
from art.attacks.evasion.brendel_bethge import BrendelBethgeAttack
Expand Down
Loading
Loading