Skip to content

Commit

Permalink
Update mano.py
Browse files Browse the repository at this point in the history
  • Loading branch information
ambroiseodt authored Oct 23, 2024
1 parent 8f674c5 commit 382225d
Showing 1 changed file with 2 additions and 4 deletions.
6 changes: 2 additions & 4 deletions algs/mano.py
Original file line number Diff line number Diff line change
Expand Up @@ -31,10 +31,8 @@ def scaling_method(self, logits):
outputs = logits + 1 + logits ** 2 / 2
min_value = torch.min(outputs, 1, keepdim=True)[0].expand_as(outputs)

"""Remove min values to ensure all entries are positive. This is in particular
necessary for orders higher than 2 to ensure that outputs are
probability distributions."""

# Remove min values to ensure all entries are positive. This is not needed
# when the approximation order is $n=2$ but is needed for higher orders.
outputs = nn.functional.normalize(outputs - min_value, dim=1, p=1)
return outputs

Expand Down

0 comments on commit 382225d

Please sign in to comment.