We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent ba76240 commit cc6f6e9Copy full SHA for cc6f6e9
art/defences/feature_squeezing.py
@@ -57,7 +57,7 @@ def __call__(self, x, y=None, bit_depth=None, clip_values=(0, 1)):
57
58
x_ = x - clip_values[0]
59
if clip_values[1] != 0:
60
- x_ = x_ / clip_values[1]
+ x_ = x_ / (clip_values[1] - clip_values[0])
61
62
max_value = np.rint(2 ** self.bit_depth - 1)
63
res = (np.rint(x_ * max_value) / max_value) * (clip_values[1] - clip_values[0]) + clip_values[0]
0 commit comments