Skip to content

Commit

Permalink
Fix focal
Browse files Browse the repository at this point in the history
  • Loading branch information
kaidic committed Nov 13, 2019
1 parent 6feb304 commit 3193f05
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion losses.py
Expand Up @@ -18,7 +18,7 @@ def __init__(self, weight=None, gamma=0.):
self.weight = weight

def forward(self, input, target):
return focal_loss(F.cross_entropy(input, target, weight=self.weight), self.gamma)
return focal_loss(F.cross_entropy(input, target, reduction='none', weight=self.weight), self.gamma)

class LDAMLoss(nn.Module):

Expand Down

0 comments on commit 3193f05

Please sign in to comment.