Skip to content

Commit

Permalink
Revert base of softermax to 2.0
Browse files Browse the repository at this point in the history
  • Loading branch information
gkielian committed May 15, 2024
1 parent 5e870ee commit 03c7b60
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion variations/softmax_variations.py
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ def forward(self, x):
if self.subtract_max:
max_x = x.max(dim=self.dim, keepdim=True).values
x = x - max_x
e_x = torch.pow(math.e, x)
e_x = torch.pow(2.0, x)
return e_x / e_x.sum(dim=self.dim, keepdim=True)

# Softmax variation with learnable constant parameters for xmax and denominator
Expand Down

0 comments on commit 03c7b60

Please sign in to comment.