Skip to content

Commit c793454

Browse files
committed
minor fixes
Signed-off-by: ytl0623 <[email protected]>
1 parent 6c77725 commit c793454

File tree

1 file changed

+4
-4
lines changed

1 file changed

+4
-4
lines changed

tests/losses/test_unified_focal_loss.py

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@
2424
[
2525
{},
2626
{
27-
"y_pred": torch.tensor([[[[20.0, -20.0], [-20.0, 20.0]]], [[[20.0, -20.0], [-20.0, 20.0]]]]),
27+
"y_pred": torch.tensor([[[[100.0, -100.0], [-100.0, 100.0]]], [[[100.0, -100.0], [-100.0, 100.0]]]]),
2828
"y_true": torch.tensor([[[[1.0, 0], [0, 1.0]]], [[[1.0, 0], [0, 1.0]]]]),
2929
},
3030
0.0,
@@ -33,7 +33,7 @@
3333
[
3434
{"use_softmax": False, "to_onehot_y": False},
3535
{
36-
"y_pred": torch.tensor([[[[20.0, -20.0], [-20.0, 20.0]]], [[[20.0, -20.0], [-20.0, 20.0]]]]),
36+
"y_pred": torch.tensor([[[[100.0, -100.0], [-100.0, 100.0]]], [[[100.0, -100.0], [-100.0, 100.0]]]]),
3737
"y_true": torch.tensor([[[[1.0, 0], [0, 1.0]]], [[[1.0, 0], [0, 1.0]]]]),
3838
},
3939
0.0,
@@ -42,7 +42,7 @@
4242
[
4343
{"use_softmax": True, "to_onehot_y": True},
4444
{
45-
"y_pred": torch.tensor([[[[-20.0]], [[-20.0]], [[20.0]]]]).repeat(2, 1, 1, 1),
45+
"y_pred": torch.tensor([[[[-100.0]], [[-100.0]], [[100.0]]]]).repeat(2, 1, 1, 1),
4646
"y_true": torch.tensor([[[[2]]]]).repeat(2, 1, 1, 1),
4747
},
4848
0.0,
@@ -65,7 +65,7 @@ def test_ill_shape(self):
6565

6666
def test_with_cuda(self):
6767
loss = AsymmetricUnifiedFocalLoss()
68-
i = torch.tensor([[[[20.0, -20.0], [-20.0, 20.0]]], [[[20.0, -20.0], [-20.0, 20.0]]]])
68+
i = torch.tensor([[[[100.0, -100.0], [-100.0, 100.0]]], [[[100.0, -100.0], [-100.0, 100.0]]]])
6969
j = torch.tensor([[[[1.0, 0], [0, 1.0]]], [[[1.0, 0], [0, 1.0]]]])
7070
if torch.cuda.is_available():
7171
i = i.cuda()

0 commit comments

Comments
 (0)