Skip to content

Commit

Permalink
Finalize integration of BEYOND detector
Browse files Browse the repository at this point in the history
Signed-off-by: Beat Buesser <[email protected]>
  • Loading branch information
beat-buesser committed Dec 13, 2024
1 parent 4a40dcb commit bb73fd5
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
2 changes: 1 addition & 1 deletion art/defences/detector/evasion/beyond_detector.py
Original file line number Diff line number Diff line change
Expand Up @@ -164,7 +164,7 @@ def fit(self, x: np.ndarray, y: np.ndarray, batch_size: int = 128, nb_epochs: in
k_minus_one_metrics = clean_metrics[:, self.var_K - 1]
self.threshold = np.percentile(k_minus_one_metrics, q=self.percentile)

def detect(self, x: np.ndarray, batch_size: int = 128, **kwargs) -> tuple[np.ndarray, np.ndarray]:
def detect(self, x: np.ndarray, batch_size: int = 128, **kwargs) -> tuple[np.ndarray, np.ndarray]: # type: ignore
"""
Detect whether given samples are adversarial
Expand Down
2 changes: 1 addition & 1 deletion tests/defences/detector/evasion/test_beyond_detector.py
Original file line number Diff line number Diff line change
Expand Up @@ -145,7 +145,7 @@ def test_beyond_detector(art_warning, get_default_cifar10_subset):
augmentations=img_augmentations,
aug_num=50,
alpha=0.8,
K=20,
var_K=20,
percentile=5,
)

Expand Down

0 comments on commit bb73fd5

Please sign in to comment.