Skip to content
This repository has been archived by the owner on Dec 16, 2022. It is now read-only.

Add per node beam size option to beam search #1835

Merged
merged 2 commits into from Sep 28, 2018

Conversation

epwalsh
Copy link
Member

@epwalsh epwalsh commented Sep 27, 2018

I added an option to the beam search classes called per_node_beam_size, which sets the maximum number of candidates to consider, at each step, from the same action history. In vanilla beam search, per_node_beam_size = beam_size, which is left as the default behavior. As discovered in Beam Search Strategies for Neural Machine Translation, setting per_node_beam_size to a value smaller than beam_size can result in better predictions, as it introduces more diversity into the search.

Copy link
Member Author

@epwalsh epwalsh left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

For some reason this file had executable permissions, so I just chmod -x'ed it

Copy link
Contributor

@matt-gardner matt-gardner left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks for this, LGTM.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants