-
Notifications
You must be signed in to change notification settings - Fork 3.6k
changed beam decoder stopping condition #780
changed beam decoder stopping condition #780
Conversation
…urning all the beams) - also fixed the related tests
…into dev/improve_transformer_decoder_speed Conflicts: tensor2tensor/models/transformer_test.py
Any update on this PR? |
@f-lng - It seems to fail the pylint check. I think the code is working though - all the tests are passing. Not sure who should take a look in accepting/commenting the MR... |
Pylint test fails because of https://travis-ci.org/tensorflow/tensor2tensor/jobs/392427948#L1727 |
…into dev/improve_transformer_decoder_speed
thanks @martinpopel - there are other parameters there that are not used in that method. There is now a problem with an autoencoder unit test: but it seems a problem unrelated to this PR - see last comment here: |
We found a Contributor License Agreement for you (the sender of this pull request), but were unable to find agreements for all the commit author(s) or Co-authors. If you authored these, maybe you used a different email address in the git commits than was used to sign the CLA (login here to double check)? If these were authored by someone else, then they will need to sign a CLA as well, and confirm that they're okay with these being contributed to Google. |
closing for CLA problems - re-opened here: #965 |
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.