Refactor, integrate penalties and global scorer into fast translation #1270
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
This changes default behavior!
return logprobs.clone()
).alpha=0
, so None in the default case). Now-length_penalty
must be specified for that behavior (see This below).Most of the scores below are boring. The bolded names show the interesting ones. The slow coverage penalty scores change (both stepwise and not) because of (1). The fast length penalty unspecified scores change because of (2). The This fast length penalty Wu shows that the length penalty scores for the fast code are the same when
-length_penalty wu
is specified.709e27
Default
Length penalty Wu
Length penalty avg
Coverage penalty Wu (see #1267 )
Coverage penalty summary
Coverage penalty summary stepwise penalty
Fast default
Fast length penalty unspecified with alpha (uses Wu)
Fixed Master
Default
Length penalty Wu
Length penalty avg
Coverage penalty Wu
Coverage penalty summary
Coverage penalty summary stepwise penalty
Fast default
Fast unspecified with alpha (uses Wu)
This
Default
Length penalty Wu
Length penalty avg
Coverage penalty Wu
Coverage penalty summary
Coverage penalty summary stepwise penalty
Fast default
Fast length penalty with alpha (uses None)
Fast length penalty Wu