Add a predictor method to return more than one possible sequence
See original GitHub issueWould be possible to add to this library a predictor_n
(or to modify the current predictor
) method to return more than one sequence as result? I think it would be a great tool to have when using beam search (with TopKDecoder
).
I coded a first attempt to do that (it seems to work, https://github.com/juan-cb/pytorch-seq2seq/commit/442431001b122fa15c4b6476a9d7411570f53f20), but I’m not sure if it is the best way to implement that or is completely correct. The desired behavior is to return the n
most probable sequences given an src_seq
.
Thanks in advance
Issue Analytics
- State:
- Created 6 years ago
- Comments:6 (6 by maintainers)
Top Results From Across the Web
Making Predictions with Sequences - Machine Learning Mastery
Sequence -to-sequence prediction involves predicting an output sequence given an input sequence. For example: Given: 1, 2, 3, 4, 5. Predict: 6, ...
Read more >What will happen if a Function is tried to return more than one ...
This article focuses on discussing the scenario when more than one values are returned via return statements. Predict the Output:.
Read more >Ensemble methods: bagging, boosting and stacking
As we already mentioned, the idea of stacking is to learn several different weak learners and combine them by training a meta-model to...
Read more >SEQUENCE function in Excel - auto generate number series
See how to use the Excel SEQUENCE function to create a number series starting at a specific value.
Read more >FORECAST and FORECAST.LINEAR functions
The syntax and usage of the two functions are the same, but the older FORECAST function will eventually be deprecated. It's still available...
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
Hi @juan-cb, sorry for the late reply. Please find my changes to your
predict_n
below. It should work, and let’s make a pr.I think it’s nice feature to have and thanks for the attempted implementation.
I noticed that you use
other["sequence"]
, which contains sequences for the input batch rather than the beams of each input. Instead, as noted here, theother['topk_sequence']
should be used to get the beam sequences.Please feel free to make a pr from this, we can discuss from there.