Skip to content

Commit 19706eb

Browse files
authored
Merge branch 'dev_1.5.1' into development_maintenance_151
2 parents 64eb9f6 + 25982c5 commit 19706eb

File tree

9 files changed

+19
-11
lines changed

9 files changed

+19
-11
lines changed

.github/workflows/ci.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@ on:
1616

1717
# Run scheduled CI flow daily
1818
schedule:
19-
- cron: '0 8 * * *'
19+
- cron: '0 8 * * 0'
2020

2121
jobs:
2222
test:

README-cn.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@
77
![Continuous Integration](https://github.com/Trusted-AI/adversarial-robustness-toolbox/workflows/Continuous%20Integration/badge.svg)
88
![CodeQL](https://github.com/Trusted-AI/adversarial-robustness-toolbox/workflows/CodeQL/badge.svg)
99
[![Documentation Status](https://readthedocs.org/projects/adversarial-robustness-toolbox/badge/?version=latest)](http://adversarial-robustness-toolbox.readthedocs.io/en/latest/?badge=latest)
10-
[![GitHub version](https://badge.fury.io/gh/Trusted-AI%2Fadversarial-robustness-toolbox.svg)](https://badge.fury.io/gh/Trusted-AI%2Fadversarial-robustness-toolbox)
10+
[![PyPI](https://badge.fury.io/py/adversarial-robustness-toolbox.svg)](https://badge.fury.io/py/adversarial-robustness-toolbox)
1111
[![Language grade: Python](https://img.shields.io/lgtm/grade/python/g/Trusted-AI/adversarial-robustness-toolbox.svg?logo=lgtm&logoWidth=18)](https://lgtm.com/projects/g/Trusted-AI/adversarial-robustness-toolbox/context:python)
1212
[![Total alerts](https://img.shields.io/lgtm/alerts/g/Trusted-AI/adversarial-robustness-toolbox.svg?logo=lgtm&logoWidth=18)](https://lgtm.com/projects/g/Trusted-AI/adversarial-robustness-toolbox/alerts/)
1313
[![codecov](https://codecov.io/gh/Trusted-AI/adversarial-robustness-toolbox/branch/master/graph/badge.svg)](https://codecov.io/gh/Trusted-AI/adversarial-robustness-toolbox)

README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@
77
![Continuous Integration](https://github.com/Trusted-AI/adversarial-robustness-toolbox/workflows/Continuous%20Integration/badge.svg)
88
![CodeQL](https://github.com/Trusted-AI/adversarial-robustness-toolbox/workflows/CodeQL/badge.svg)
99
[![Documentation Status](https://readthedocs.org/projects/adversarial-robustness-toolbox/badge/?version=latest)](http://adversarial-robustness-toolbox.readthedocs.io/en/latest/?badge=latest)
10-
[![GitHub version](https://badge.fury.io/gh/Trusted-AI%2Fadversarial-robustness-toolbox.svg)](https://badge.fury.io/gh/Trusted-AI%2Fadversarial-robustness-toolbox)
10+
[![PyPI](https://badge.fury.io/py/adversarial-robustness-toolbox.svg)](https://badge.fury.io/py/adversarial-robustness-toolbox)
1111
[![Language grade: Python](https://img.shields.io/lgtm/grade/python/g/Trusted-AI/adversarial-robustness-toolbox.svg?logo=lgtm&logoWidth=18)](https://lgtm.com/projects/g/Trusted-AI/adversarial-robustness-toolbox/context:python)
1212
[![Total alerts](https://img.shields.io/lgtm/alerts/g/Trusted-AI/adversarial-robustness-toolbox.svg?logo=lgtm&logoWidth=18)](https://lgtm.com/projects/g/Trusted-AI/adversarial-robustness-toolbox/alerts/)
1313
[![codecov](https://codecov.io/gh/Trusted-AI/adversarial-robustness-toolbox/branch/master/graph/badge.svg)](https://codecov.io/gh/Trusted-AI/adversarial-robustness-toolbox)

art/attacks/evasion/projected_gradient_descent/projected_gradient_descent_pytorch.py

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -238,9 +238,11 @@ def _generate_batch(
238238
:param eps_step: Attack step size (input variation) at each iteration.
239239
:return: Adversarial examples.
240240
"""
241+
import torch # lgtm [py/repeated-import]
242+
241243
inputs = x.to(self.estimator.device)
242244
targets = targets.to(self.estimator.device)
243-
adv_x = inputs
245+
adv_x = torch.clone(inputs)
244246

245247
if mask is not None:
246248
mask = mask.to(self.estimator.device)

art/attacks/evasion/projected_gradient_descent/projected_gradient_descent_tensorflow_v2.py

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -234,7 +234,10 @@ def _generate_batch(
234234
:param eps_step: Attack step size (input variation) at each iteration.
235235
:return: Adversarial examples.
236236
"""
237-
adv_x = x
237+
import tensorflow as tf # lgtm [py/repeated-import]
238+
239+
adv_x = tf.identity(x)
240+
238241
for i_max_iter in range(self.max_iter):
239242
adv_x = self._compute_tf(
240243
adv_x, x, targets, mask, eps, eps_step, self.num_random_init > 0 and i_max_iter == 0,

art/estimators/classification/keras.py

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -630,7 +630,10 @@ def custom_loss_gradient(self, nn_function, tensors, input_values, name="default
630630
:return: the gradient of the function w.r.t vars
631631
:rtype: `np.ndarray`
632632
"""
633-
import keras.backend as k
633+
if self.is_tensorflow:
634+
import tensorflow.keras.backend as k
635+
else:
636+
import keras.backend as k
634637

635638
if not hasattr(self, "_custom_loss_func"):
636639
self._custom_loss_func = {}

requirements.txt

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
numpy==1.19.2
33
scipy==1.4.1
44
matplotlib==3.3.3
5-
scikit-learn>=0.22.2
5+
scikit-learn>=0.22.2,==0.23.*
66
six==1.15.0
77
Pillow==7.2.0
88
tqdm==4.49.0
@@ -18,7 +18,7 @@ h5py==2.10.0
1818
# supported versions: (tensorflow==2.2.0 with keras==2.3.1) or (tensorflow==1.15.4 with keras==2.2.5)
1919
tensorflow>=1.15.4
2020
keras>=2.2.5
21-
tensorflow-addons>=0.11.2
21+
tensorflow-addons~=0.11.0
2222
mxnet==1.6.0
2323
--find-links https://download.pytorch.org/whl/torch_stable.html
2424
torch==1.6.0

setup.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@
1010
"numpy",
1111
"scipy>=1.4.1",
1212
"matplotlib",
13-
"scikit-learn>=0.22.2",
13+
"scikit-learn>=0.22.2,==0.23.*",
1414
"six",
1515
"setuptools",
1616
"Pillow",
@@ -32,7 +32,7 @@
3232
"numpy",
3333
"scipy>=1.4.1",
3434
"six>=1.13.0",
35-
"scikit-learn>=0.22.2",
35+
"scikit-learn>=0.22.2,==0.23.*",
3636
"Pillow>=6.0.0",
3737
]
3838

tests/attacks/test_copycat_cnn.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -47,7 +47,7 @@
4747

4848
logger = logging.getLogger(__name__)
4949

50-
NB_EPOCHS = 10
50+
NB_EPOCHS = 20
5151
NB_STOLEN = 1000
5252

5353

0 commit comments

Comments
 (0)