Skip to content
This repository was archived by the owner on Jul 7, 2023. It is now read-only.

changed beam decoder stopping condition #965

Merged

Conversation

mirkobronzi
Copy link
Contributor

stopping condition of the beam decoder now works as follows:

-- case return only the first beam (stop_early=True): it will stop when the first beam is 'unbeatable' by the other alive beams. (basically the previous behavior)

-- case return all beams (stop_early=False): it will stop when all the first N beams are 'unbeatable' by the other alive beams.
Note that checking that the last beam (in the top N) is unbeatable implies that all the top N beams are unbeatable as well.

Note w.r.t. the test changes: I duplicated testNotGreedyBeamTwo so that there is now a version with stop_early=True and one with stop_early=False. The first checks only the first beam, the latter will check all the beams.

Other two tests changed as well: they were checking the beam output length (checking it was equal to INPUT_LENGTH + decode_length) - disabled these checks given that this is not true anymore.

@googlebot googlebot added the cla: yes PR author has signed CLA label Aug 1, 2018
@mirkobronzi mirkobronzi changed the title WIP: checking CLA changed beam decoder stopping condition Aug 1, 2018
@KasparPeterson
Copy link

Speeds things up considerably for our team. Great job!
Can this be merged soon so that we can continue using the master branch version?

@mirkobronzi
Copy link
Contributor Author

happy to help @KasparPeterson
again, it is my first MR, not sure how to proceed to get it accepted.

@rsepassi , any procedure that should be followed?

@afrozenator
Copy link
Contributor

Taking a look, sorry didn't spot this sooner - @mirkobronzi @KasparPeterson

@afrozenator
Copy link
Contributor

Many thanks @mirkobronzi -- this is awesome!

@afrozenator afrozenator merged commit 36e9131 into tensorflow:master Nov 15, 2018
tensorflow-copybara pushed a commit that referenced this pull request Nov 15, 2018
PiperOrigin-RevId: 221694493
@mirkobronzi
Copy link
Contributor Author

great! thanks @afrozenator :)

@shakier
Copy link

shakier commented Nov 23, 2018

Thanks for taking care of this issue! Is this currently working? I install from the codes and tried the decoding with returning multiple beams, but it still takes long time. Is there anything I missed? Do I need to set any parameters? Thanks!

@mirkobronzi
Copy link
Contributor Author

@shakier : no, it should now use the new code when you ask for multiple beams in the results.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
cla: yes PR author has signed CLA
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants