add length penalty in reward + tracker avg positive & negative token length #1301
+336
−4
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 PR adds a length penalty option, along with the tracker for average positive and negative token length.
The length penalty is calculated using the formula: ((5 + length) / 6) ^ alpha.
This is based on the formula used in Google Neural Machine Translation paper [https://arxiv.org/pdf/1609.08144]
This is to follow my previous PR: tracker average token lengths for both positive and negative samples #1225
@vermouth1992 could you please review this?