question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Compatibility of TopKDecoder with DecoderRNN

See original GitHub issue

The 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:closed
  • Created 6 years ago
  • Comments:5 (3 by maintainers)

github_iconTop GitHub Comments

1reaction
kylegao91commented, Oct 9, 2017

@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 in info['topk_sequence']. It is documented at here.

0reactions
zephyrzillacommented, Oct 9, 2017

I looked up scripts/integration_test.py in topk branch, but the Predictor does not return top-k sequences when the Seq2Seq object with TopKDecoder is used.

How do I get topk predictions using the updated TopKDecoder?

Read more comments on GitHub >

github_iconTop 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 >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found