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
OpenDAS
Fairseq
Commits
ee46c63b
Commit
ee46c63b
authored
Sep 10, 2018
by
Sergey Edunov
Committed by
Myle Ott
Sep 25, 2018
Browse files
Fix adaptive loss logging
parent
e775877f
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
1 addition
and
0 deletions
+1
-0
fairseq/criterions/adaptive_loss.py
fairseq/criterions/adaptive_loss.py
+1
-0
No files found.
fairseq/criterions/adaptive_loss.py
View file @
ee46c63b
...
@@ -74,6 +74,7 @@ class AdaptiveLoss(FairseqCriterion):
...
@@ -74,6 +74,7 @@ class AdaptiveLoss(FairseqCriterion):
sample_size
=
sum
(
log
.
get
(
'sample_size'
,
0
)
for
log
in
logging_outputs
)
sample_size
=
sum
(
log
.
get
(
'sample_size'
,
0
)
for
log
in
logging_outputs
)
agg_output
=
{
agg_output
=
{
'loss'
:
loss_sum
/
sample_size
/
math
.
log
(
2
),
'loss'
:
loss_sum
/
sample_size
/
math
.
log
(
2
),
'nll_loss'
:
loss_sum
/
sample_size
/
math
.
log
(
2
),
'ntokens'
:
ntokens
,
'ntokens'
:
ntokens
,
'nsentences'
:
nsentences
,
'nsentences'
:
nsentences
,
'sample_size'
:
sample_size
,
'sample_size'
:
sample_size
,
...
...
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