未验证 提交 f0e614fe 编写于 作者: F FlyingQianMM 提交者: GitHub

change print([.*].numpy()) to print([.*]) in example codes of sigmoid_focal_loss (#29094)

* rewrite the sigmoid_focal_loss code example. test=develop

* fix spelling mistake in comments of code example.test=develop

* change print([.*].numpy()) to print([.*]) in example codes of sigmoid_focal_loss. test=document_fix
上级 682cc17f
...@@ -1348,7 +1348,7 @@ def sigmoid_focal_loss(logit, ...@@ -1348,7 +1348,7 @@ def sigmoid_focal_loss(logit,
fg_label = paddle.greater_equal(label, one) fg_label = paddle.greater_equal(label, one)
fg_num = paddle.sum(paddle.cast(fg_label, dtype='float32')) fg_num = paddle.sum(paddle.cast(fg_label, dtype='float32'))
output = paddle.nn.functional.sigmoid_focal_loss(logit, label, normalizer=fg_num) output = paddle.nn.functional.sigmoid_focal_loss(logit, label, normalizer=fg_num)
print(output.numpy()) # [0.65782464] print(output) # [0.65782464]
""" """
if reduction not in ['sum', 'mean', 'none']: if reduction not in ['sum', 'mean', 'none']:
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册