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
wangsen
paddle_dbnet
Commits
f96797e1
Unverified
Commit
f96797e1
authored
Oct 28, 2021
by
xiaoting
Committed by
GitHub
Oct 28, 2021
Browse files
Merge pull request #4463 from Topdu/dygraph
modify data type to adaptive
parents
bbf4625e
81f0a83e
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
1 addition
and
1 deletion
+1
-1
ppocr/losses/rec_nrtr_loss.py
ppocr/losses/rec_nrtr_loss.py
+1
-1
No files found.
ppocr/losses/rec_nrtr_loss.py
View file @
f96797e1
...
...
@@ -22,7 +22,7 @@ class NRTRLoss(nn.Layer):
log_prb
=
F
.
log_softmax
(
pred
,
axis
=
1
)
non_pad_mask
=
paddle
.
not_equal
(
tgt
,
paddle
.
zeros
(
tgt
.
shape
,
dtype
=
'int64'
))
tgt
.
shape
,
dtype
=
tgt
.
dtype
))
loss
=
-
(
one_hot
*
log_prb
).
sum
(
axis
=
1
)
loss
=
loss
.
masked_select
(
non_pad_mask
).
mean
()
else
:
...
...
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