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
5f29d123
"src/git@developer.sourcefind.cn:renzhc/diffusers_dcu.git" did not exist on "3d02c92187044393d90cc4768f9d0a0939322833"
Commit
5f29d123
authored
Mar 02, 2018
by
Myle Ott
Committed by
Sergey Edunov
Mar 05, 2018
Browse files
Small fixes
parent
56f9ec3c
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
2 additions
and
2 deletions
+2
-2
fairseq/criterions/label_smoothed_cross_entropy.py
fairseq/criterions/label_smoothed_cross_entropy.py
+1
-1
fairseq/sequence_scorer.py
fairseq/sequence_scorer.py
+1
-1
No files found.
fairseq/criterions/label_smoothed_cross_entropy.py
View file @
5f29d123
...
@@ -38,7 +38,7 @@ class LabelSmoothedNLLLoss(torch.autograd.Function):
...
@@ -38,7 +38,7 @@ class LabelSmoothedNLLLoss(torch.autograd.Function):
ctx
.
grad_input
=
grad_input
ctx
.
grad_input
=
grad_input
if
reduce
:
if
reduce
:
return
input
.
new
([
grad_input
.
view
(
-
1
).
dot
(
input
.
view
(
-
1
))
])
return
grad_input
.
view
(
-
1
).
dot
(
input
.
view
(
-
1
))
else
:
else
:
return
grad_input
*
input
return
grad_input
*
input
...
...
fairseq/sequence_scorer.py
View file @
5f29d123
...
@@ -46,7 +46,7 @@ class SequenceScorer(object):
...
@@ -46,7 +46,7 @@ class SequenceScorer(object):
'alignment'
:
alignment
,
'alignment'
:
alignment
,
'positional_scores'
:
pos_scores_i
,
'positional_scores'
:
pos_scores_i
,
}]
}]
# return results in the same format as SequenceGene
ne
rator
# return results in the same format as SequenceGenerator
yield
id
,
src
,
ref
,
hypos
yield
id
,
src
,
ref
,
hypos
def
score
(
self
,
sample
):
def
score
(
self
,
sample
):
...
...
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