Skip to content

Commit

Permalink
Torch: bugfix in diameter rescaling
Browse files Browse the repository at this point in the history
  • Loading branch information
zimmer-m committed Oct 26, 2020
1 parent 875ea1b commit 9afe7b9
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion frankwolfe/pytorch/optimizers.py
Original file line number Diff line number Diff line change
Expand Up @@ -64,7 +64,7 @@ def step(self, constraints, closure=None):

if self.rescale == 'diameter':
# Rescale lr by diameter
factor = 1. / constraints[idx].get_diameter(v.shape)
factor = 1. / constraints[idx].get_diameter()
elif self.rescale == 'gradient':
# Rescale lr by gradient
factor = torch.norm(d_p, p=2) / torch.norm(p - v, p=2)
Expand Down

0 comments on commit 9afe7b9

Please sign in to comment.