File tree Expand file tree Collapse file tree 1 file changed +1
-8
lines changed Expand file tree Collapse file tree 1 file changed +1
-8
lines changed Original file line number Diff line number Diff line change @@ -114,17 +114,10 @@ class (int).
114
114
o_bestattack = x .clone ().detach ()
115
115
116
116
# Map images into the tanh-space
117
- # TODO as of 01/06/2020, PyTorch does not natively support
118
- # arctanh (see, e.g.,
119
- # https://github.com/pytorch/pytorch/issues/10324).
120
- # This particular implementation here is not numerically
121
- # stable and should be substituted w/ PyTorch's native
122
- # implementation when it comes out in the future
123
- arctanh = lambda x : 0.5 * torch .log ((1 + x ) / (1 - x ))
124
117
x = (x - clip_min ) / (clip_max - clip_min )
125
118
x = torch .clamp (x , 0 , 1 )
126
119
x = x * 2 - 1
127
- x = arctanh (x * 0.999999 )
120
+ x = torch . arctanh (x * 0.999999 )
128
121
129
122
# Prepare some variables
130
123
modifier = torch .zeros_like (x , requires_grad = True )
You can’t perform that action at this time.
0 commit comments