Skip to content

Commit

Permalink
skip momentum iterative tests for tf framework (Trusted-AI#2439)
Browse files Browse the repository at this point in the history
Signed-off-by: Élie Goudout <[email protected]>
  • Loading branch information
eliegoudout committed May 7, 2024
1 parent 7eb30c4 commit 5c74f1e
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -343,6 +343,9 @@ def _compute_perturbation( # pylint: disable=W0221

# Compute gradient momentum
if decay is not None and momentum is not None:
raise NotImplementedError(
"Momentum Iterative Attack currently not working with the Tensorflow framework. See issue #2439"
)
# Update momentum in-place (important).
# The L1 normalization for accumulation is an arbitrary choice of the paper.
grad_2d = tf.reshape(grad, (len(grad), -1))
Expand Down
4 changes: 2 additions & 2 deletions tests/attacks/evasion/test_momentum_iterative_method.py
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@ def fix_get_mnist_subset(get_mnist_dataset):
yield x_train_mnist[:n_train], y_train_mnist[:n_train], x_test_mnist[:n_test], y_test_mnist[:n_test]


@pytest.mark.framework_agnostic
@pytest.mark.skip_framework("tensorflow") # See issue #2439
def test_images(art_warning, fix_get_mnist_subset, image_dl_estimator_for_attack):
try:
(x_train_mnist, y_train_mnist, x_test_mnist, y_test_mnist) = fix_get_mnist_subset
Expand All @@ -55,7 +55,7 @@ def test_images(art_warning, fix_get_mnist_subset, image_dl_estimator_for_attack
art_warning(e)


@pytest.mark.framework_agnostic
@pytest.mark.skip_framework("tensorflow") # See issue #2439
def test_images_targeted(art_warning, fix_get_mnist_subset, image_dl_estimator_for_attack):
try:
(x_train_mnist, y_train_mnist, x_test_mnist, y_test_mnist) = fix_get_mnist_subset
Expand Down

0 comments on commit 5c74f1e

Please sign in to comment.