Skip to content

Commit c9002e0

Browse files
committed
add test case for include_background=False
Signed-off-by: ytl0623 <[email protected]>
1 parent ca81e4a commit c9002e0

File tree

1 file changed

+12
-0
lines changed

1 file changed

+12
-0
lines changed

tests/losses/test_unified_focal_loss.py

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -53,6 +53,18 @@
5353
},
5454
0.0,
5555
],
56+
# Case 2: Multi-class with background excluded
57+
[
58+
{
59+
"use_softmax": True,
60+
"include_background": False,
61+
},
62+
{
63+
"y_pred": torch.tensor([[[[logit_pos, logit_neg]], [[logit_neg, logit_pos]], [[logit_neg, logit_neg]]]]),
64+
"y_true": torch.tensor([[[[1.0, 0.0]], [[0.0, 1.0]], [[0.0, 0.0]]]]),
65+
},
66+
0.0,
67+
],
5668
]
5769

5870

0 commit comments

Comments
 (0)