Skip to content

Commit 280963a

Browse files
author
José Morano
committed
Solved type issues (mypy check).
Signed-off-by: José Morano <[email protected]>
1 parent 1ac948e commit 280963a

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

monai/losses/focal_loss.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -276,7 +276,7 @@ def focal_loss_with_probs(
276276
log_pt = torch.log(torch.clamp(pt, min=1e-8)) # Avoid log(0)
277277
focal_factor = (1 - pt).pow(gamma) # (1 - pt)**gamma
278278

279-
loss = -focal_factor * log_pt
279+
loss: torch.Tensor = -focal_factor * log_pt
280280

281281
if alpha is not None:
282282
# alpha if t==1; (1-alpha) if t==0

0 commit comments

Comments
 (0)