Compatibility of TopKDecoder with DecoderRNN
See original GitHub issueThe codebase contains a TopKDecoder
which can be used to do beam search while generating sentences. According to the docstring, the __init__
method takes as input a DecoderRNN
object but the code is accessing attributes like .lang
and .SOS_token_id
which are not present in the DecoderRNN
class.
Also my understanding is that the TopKDecoder
can be used to generate sentences after the DecoderRNN
has been trained. Is this understanding correct.
Issue Analytics
- State:
- Created 6 years ago
- Comments:5 (3 by maintainers)
Top Results From Across the Web
pytorch-seq2seq/TopKDecoder.py at master - GitHub
An open source framework for seq2seq models in PyTorch. - pytorch-seq2seq/TopKDecoder.py at master · IBM/pytorch-seq2seq.
Read more >Models — pytorch-seq2seq 0.1.6 documentation
TopKDecoder ¶ · decoder_rnn (DecoderRNN) – An object of DecoderRNN used for decoding. · k (int) – Size of the beam.
Read more >An open source framework for seq2seq models in PyTorch.
Compatible with PyTorch 0.4; Added support for pre-trained word embedding ... it would be a great tool to have when using beam search...
Read more >
Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free
Top Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
@surajit-techie Sorry the documentation hasn’t been updated yet. Supposed you call the topk decoder as
outputs, hidden, info = model(...)
, the top K sequences are stored ininfo['topk_sequence']
. It is documented at here.I looked up
scripts/integration_test.py
intopk
branch, but thePredictor
does not return top-k sequences when theSeq2Seq
object withTopKDecoder
is used.How do I get
topk
predictions using the updatedTopKDecoder
?