We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 30de27a commit 35f8134Copy full SHA for 35f8134
cellseg_models_pytorch/losses/criterions/sce.py
@@ -73,8 +73,15 @@ def forward(
73
yhat_soft = F.softmax(yhat, dim=1) + self.eps
74
assert target_one_hot.shape == yhat.shape
75
76
- yhat = torch.clamp(yhat_soft, min=1e-7, max=1.0)
77
- target_one_hot = torch.clamp(target_one_hot, min=1e-4, max=1.0)
+ if self.apply_svls:
+ target_one_hot = self.apply_svls_to_target(
78
+ target_one_hot, num_classes, **kwargs
79
+ )
80
+
81
+ if self.apply_ls:
82
+ target_one_hot = self.apply_ls_to_target(
83
84
85
86
forward = target_one_hot * torch.log(yhat_soft)
87
reverse = yhat_soft * torch.log(target_one_hot)
0 commit comments