Skip to content
GitLab
Menu
Projects
Groups
Snippets
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
Menu
Open sidebar
ModelZoo
SOLOv2-pytorch
Commits
cedd8a82
Commit
cedd8a82
authored
Oct 05, 2018
by
Kai Chen
Browse files
remove useless loss
parent
5266dea0
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
1 addition
and
11 deletions
+1
-11
mmdet/core/losses/losses.py
mmdet/core/losses/losses.py
+1
-11
No files found.
mmdet/core/losses/losses.py
View file @
cedd8a82
...
...
@@ -36,7 +36,7 @@ def sigmoid_focal_loss(pred,
weight
=
(
alpha
*
target
+
(
1
-
alpha
)
*
(
1
-
target
))
*
weight
weight
=
weight
*
pt
.
pow
(
gamma
)
return
F
.
binary_cross_entropy_with_logits
(
pred
,
target
,
weight
,
size_average
=
reduction
)
pred
,
target
,
weight
,
reduction
=
reduction
)
def
weighted_sigmoid_focal_loss
(
pred
,
...
...
@@ -61,16 +61,6 @@ def mask_cross_entropy(pred, target, label):
pred_slice
,
target
,
reduction
=
'elementwise_mean'
)[
None
]
def
weighted_mask_cross_entropy
(
pred
,
target
,
weight
,
label
):
num_rois
=
pred
.
size
()[
0
]
num_samples
=
torch
.
sum
(
weight
>
0
).
float
().
item
()
+
1e-6
assert
num_samples
>=
1
inds
=
torch
.
arange
(
0
,
num_rois
).
long
().
cuda
()
pred_slice
=
pred
[
inds
,
label
].
squeeze
(
1
)
return
F
.
binary_cross_entropy_with_logits
(
pred_slice
,
target
,
weight
,
size_average
=
False
)[
None
]
/
num_samples
def
smooth_l1_loss
(
pred
,
target
,
beta
=
1.0
,
reduction
=
'elementwise_mean'
):
assert
beta
>
0
assert
pred
.
size
()
==
target
.
size
()
and
target
.
numel
()
>
0
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment