File tree Expand file tree Collapse file tree 2 files changed +6
-4
lines changed Expand file tree Collapse file tree 2 files changed +6
-4
lines changed Original file line number Diff line number Diff line change @@ -22,6 +22,7 @@ torchvision.ops
22
22
.. autofunction :: roi_pool
23
23
.. autofunction :: ps_roi_pool
24
24
.. autofunction :: deform_conv2d
25
+ .. autofunction :: sigmoid_focal_loss
25
26
26
27
.. autoclass :: RoIAlign
27
28
.. autoclass :: PSRoIAlign
Original file line number Diff line number Diff line change 3
3
4
4
5
5
def sigmoid_focal_loss (
6
- inputs ,
7
- targets ,
6
+ inputs : torch . Tensor ,
7
+ targets : torch . Tensor ,
8
8
alpha : float = 0.25 ,
9
9
gamma : float = 2 ,
10
10
reduction : str = "none" ,
11
11
):
12
12
"""
13
13
Original implementation from https://github.com/facebookresearch/fvcore/blob/master/fvcore/nn/focal_loss.py .
14
14
Loss used in RetinaNet for dense detection: https://arxiv.org/abs/1708.02002.
15
- Args:
15
+
16
+ Arguments:
16
17
inputs: A float tensor of arbitrary shape.
17
18
The predictions for each example.
18
19
targets: A float tensor with the same shape as inputs. Stores the binary
19
- classification label for each element in inputs
20
+ classification label for each element in inputs
20
21
(0 for the negative class and 1 for the positive class).
21
22
alpha: (optional) Weighting factor in range (0,1) to balance
22
23
positive vs negative examples or -1 for ignore. Default = 0.25
You can’t perform that action at this time.
0 commit comments