Skip to content

Commit 749ff05

Browse files
authored
Merge branch 'dev_1.8.0' into update-component-yaml
2 parents 8bcc444 + 353adb2 commit 749ff05

File tree

11 files changed

+1646
-47
lines changed

11 files changed

+1646
-47
lines changed

.github/workflows/ci-style-checks.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -51,7 +51,7 @@ jobs:
5151
run: mypy art
5252
- name: pytest-flake8
5353
if: ${{ always() }}
54-
run: pytest --flake8 -v -m flake8
54+
run: pytest --flake8 -v -m flake8 --ignore=contrib
5555
- name: black
5656
if: ${{ always() }}
5757
run: |

art/__init__.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@
1212
from art import preprocessing
1313

1414
# Semantic Version
15-
__version__ = "1.7.1"
15+
__version__ = "1.8.0.dev0"
1616

1717
# pylint: disable=C0103
1818

art/attacks/inference/attribute_inference/meminf_based.py

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -96,11 +96,11 @@ def infer(self, x: np.ndarray, y: Optional[np.ndarray] = None, **kwargs) -> np.n
9696
if y.shape[0] != x.shape[0]:
9797
raise ValueError("Number of rows in x and y do not match")
9898

99-
# assumes single index
99+
# single index
100100
if isinstance(self.attack_feature, int):
101101
first = True
102102
for value in values:
103-
v_full = np.full((x.shape[0], 1), value).astype(np.float32)
103+
v_full = np.full((x.shape[0], 1), value).astype(x.dtype)
104104
x_value = np.concatenate((x[:, : self.attack_feature], v_full), axis=1)
105105
x_value = np.concatenate((x_value, x[:, self.attack_feature :]), axis=1)
106106

@@ -112,7 +112,7 @@ def infer(self, x: np.ndarray, y: Optional[np.ndarray] = None, **kwargs) -> np.n
112112
probabilities = np.hstack((probabilities, predicted))
113113

114114
# needs to be of type float so we can later replace back the actual values
115-
value_indexes = np.argmax(probabilities, axis=1).astype(np.float32)
115+
value_indexes = np.argmax(probabilities, axis=1).astype(x.dtype)
116116
pred_values = np.zeros_like(value_indexes)
117117
for index, value in enumerate(values):
118118
pred_values[value_indexes == index] = value
@@ -134,7 +134,7 @@ def infer(self, x: np.ndarray, y: Optional[np.ndarray] = None, **kwargs) -> np.n
134134
else:
135135
probabilities = np.hstack((probabilities, predicted))
136136
first = False
137-
value_indexes = np.argmax(probabilities, axis=1).astype(np.float32)
137+
value_indexes = np.argmax(probabilities, axis=1).astype(x.dtype)
138138
pred_values = np.zeros_like(probabilities)
139139
for index, value in enumerate(values):
140140
curr_value = np.zeros(len(values))

art/attacks/inference/attribute_inference/white_box_decision_tree.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -98,7 +98,7 @@ def infer(self, x: np.ndarray, y: Optional[np.ndarray] = None, **kwargs) -> np.n
9898

9999
for i, value in enumerate(values):
100100
# prepare data with the given value in the attacked feature
101-
v_full = np.full((n_samples, 1), value)
101+
v_full = np.full((n_samples, 1), value).astype(x.dtype)
102102
x_value = np.concatenate((x[:, : self.attack_feature], v_full), axis=1)
103103
x_value = np.concatenate((x_value, x[:, self.attack_feature :]), axis=1)
104104

art/attacks/inference/attribute_inference/white_box_lifestyle_decision_tree.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -96,7 +96,7 @@ def infer(self, x: np.ndarray, y: Optional[np.ndarray] = None, **kwargs) -> np.n
9696

9797
for i, value in enumerate(values):
9898
# prepare data with the given value in the attacked feature
99-
v_full = np.full((n_samples, 1), value)
99+
v_full = np.full((n_samples, 1), value).astype(x.dtype)
100100
x_value = np.concatenate((x[:, : self.attack_feature], v_full), axis=1)
101101
x_value = np.concatenate((x_value, x[:, self.attack_feature :]), axis=1)
102102

@@ -117,7 +117,7 @@ def infer(self, x: np.ndarray, y: Optional[np.ndarray] = None, **kwargs) -> np.n
117117
def _calculate_phi(self, x, values, n_samples):
118118
phi = []
119119
for value in values:
120-
v_full = np.full((n_samples, 1), value)
120+
v_full = np.full((n_samples, 1), value).astype(x.dtype)
121121
x_value = np.concatenate((x[:, : self.attack_feature], v_full), axis=1)
122122
x_value = np.concatenate((x_value, x[:, self.attack_feature :]), axis=1)
123123
nodes_value = {}

art/estimators/speech_recognition/tensorflow_lingvo.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -95,7 +95,8 @@ class TensorFlowLingvoASR(SpeechRecognizerMixin, TensorFlowV2Estimator):
9595
},
9696
"decoder": {
9797
"uri": (
98-
"https://raw.githubusercontent.com/hesseltuinhof/lingvo/qin_patched_decoder/lingvo/tasks/asr/decoder.py"
98+
"https://raw.githubusercontent.com/Trusted-AI/adversarial-robustness-toolbox/"
99+
"4dabf5fcfb55502316ad48abbdc1a26033db1da5/contrib/lingvo-patched-decoder.py"
99100
),
100101
"basename": "decoder_patched.py",
101102
},

0 commit comments

Comments
 (0)