Skip to content

Commit

Permalink
Update trades.py
Browse files Browse the repository at this point in the history
  • Loading branch information
yaodongyu authored Sep 14, 2019
1 parent c1cad08 commit c8233ad
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion trades.py
Original file line number Diff line number Diff line change
Expand Up @@ -65,7 +65,7 @@ def trades_loss(model,
# projection
delta.data.add_(x_natural)
delta.data.clamp_(0, 1).sub_(x_natural)
delta.data.renorm_(p=2, dim=0, maxnorm=max_norm)
delta.data.renorm_(p=2, dim=0, maxnorm=epsilon)
x_adv = Variable(x_natural + delta, requires_grad=False)
else:
x_adv = torch.clamp(x_adv, 0.0, 1.0)
Expand Down

0 comments on commit c8233ad

Please sign in to comment.