Skip to content

Commit 59cf348

Browse files
author
Beat Buesser
committed
Add typing
Signed-off-by: Beat Buesser <[email protected]>
1 parent 4c27ead commit 59cf348

File tree

1 file changed

+2
-5
lines changed
  • art/estimators/certification/neural_cleanse

1 file changed

+2
-5
lines changed

art/estimators/certification/neural_cleanse/keras.py

Lines changed: 2 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -311,16 +311,13 @@ def _prune_neuron_at_index(self, index: int) -> None:
311311
biases[index] = 0
312312
layer.set_weights([weights, biases])
313313

314-
def predict(self, x, batch_size=128):
314+
def predict(self, x: np.ndarray, batch_size: int = 128) -> np.ndarray:
315315
"""
316316
Perform prediction of the given classifier for a batch of inputs, potentially filtering suspicious input
317317
318-
:param x: Test set.
319-
:type x: `np.ndarray`
318+
:param x: Input data to predict.
320319
:param batch_size: Batch size.
321-
:type batch_size: `int`
322320
:return: Array of predictions of shape `(nb_inputs, nb_classes)`.
323-
:rtype: `np.ndarray`
324321
"""
325322
return NeuralCleanseMixin.predict(self, x, batch_size=batch_size)
326323

0 commit comments

Comments
 (0)