batra-mlp-lab / visdial-rl

PyTorch code for Learning Cooperative Visual Dialog Agents using Deep Reinforcement Learning
170 stars 39 forks source link

Beam search backtracking #5

Open shubhamagarwal92 opened 6 years ago

shubhamagarwal92 commented 6 years ago

Hi,

Thank you providing this code.

Could you explain your code for backtracking in beam search.

In particular how do you handle the dropped sequences that have seen EOS earlier during forward phase as done in this implementation.

nirbhayjm commented 6 years ago

The main beam search function has details about how dropped sequences are handles and how backtracking is performed.

Briefly, the sequences which see EOS are handled by this variable which keeps track of all sequences which have not yet seen EOS. The beamTokensTable variable stores all the tokens generated as beam search progresses, with the corresponding back-track indices stored in the backIndices table (updated after each time step here).

shubhamagarwal92 commented 6 years ago

Thanks for the prompt reply. :)