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).
114114 o_bestattack = x .clone ().detach ()
115115
116116 # 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 ))
124117 x = (x - clip_min ) / (clip_max - clip_min )
125118 x = torch .clamp (x , 0 , 1 )
126119 x = x * 2 - 1
127- x = arctanh (x * 0.999999 )
120+ x = torch . arctanh (x * 0.999999 )
128121
129122 # Prepare some variables
130123 modifier = torch .zeros_like (x , requires_grad = True )
You can’t perform that action at this time.
0 commit comments