Skip to content

Commit 63b89ef

Browse files
premkiran-o7beat-buesser
authored andcommitted
Update randomized_smoothing.py
Signed-off-by: Prem Kiran Laknaboina <[email protected]>
1 parent 6be8850 commit 63b89ef

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

art/estimators/certification/randomized_smoothing/randomized_smoothing.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -100,13 +100,13 @@ def predict(self, x: np.ndarray, batch_size: int = 128, verbose: bool = False, *
100100
# get class counts
101101
counts_pred = self._prediction_counts(x_i, batch_size=batch_size)
102102
top = counts_pred.argsort()[::-1]
103-
# Conersion to int
103+
# conversion to int
104104
count1 = int(np.max(counts_pred))
105105
count2 = int(counts_pred[top[1]])
106106

107107
# predict or abstain
108108
smooth_prediction = np.zeros(counts_pred.shape)
109-
#Get p value from BinomTestResult object
109+
# get p value from BinomTestResult object
110110
p_value = binomtest(count1, count1 + count2, p=0.5).pvalue
111111
if (not is_abstain) or (p_value <= self.alpha):
112112
smooth_prediction[np.argmax(counts_pred)] = 1

0 commit comments

Comments
 (0)