aimagelab / meshed-memory-transformer

Meshed-Memory Transformer for Image Captioning. CVPR 2020
BSD 3-Clause "New" or "Revised" License
517 stars 136 forks source link

Beamsearch #22

Closed y78h11b09 closed 4 years ago

y78h11b09 commented 4 years ago

hello, thanks for your work. (1)why input is the one array words [5,1] generated (beam size :5) at x timestep, not is the generated sequence [5,x] , and then got the last word logprob. (2) with the code beam search in our work, it 's stoped untill runing all steptimes, I think it's not reasonable for some sentences generated have been over.

These problems happened in our work with your beam search codes

Please, help me.! thanks

y78h11b09 commented 4 years ago

I test it, and I found each beam is over by ' EOS' at the early timestep
{'beam_i': [0, 1, 2, 3, 4], 'timestep': [11, 11, 11, 11, 16]}

baraldilorenzo commented 4 years ago

Hi @y78h11b09,

you might take a look at #28 for clarifications on the input shape of the beam search. Let me know if you need anything else.

Best, Lorenzo.