Decode generating same summery
Rachnas opened this issue · comments
Hi,
Thanks for providing Pytorch implementation for summerization. I trained the model on custom data set for ~15000 iterations. On decoding, same summery is generated for all the stories. I am not sure where exactly is the problem in code, still debugging. Any help/suggestion is appreciated.
In beam_search code, there is a comment '#batch should have only one example' where as in BeamSearch constructor, bacther takes batch size same as beam_size(4). Is it correct ?
Thanks
Yes the first iteration of beam search replicate the same prediction for all 4 steps.
https://github.com/atulkum/pointer_summarizer/blob/master/training_ptr_gen/decode.py#L124
The best way to debug is to step through each line by putting breakpoint in code. An editor like pycharm would help.
In decode beam search batch should have only one example
https://github.com/atulkum/pointer_summarizer/blob/master/training_ptr_gen/decode.py#L109
https://github.com/atulkum/pointer_summarizer/blob/master/data_util/batcher.py#L226
i have 2 questions:
why beam_size must equals batch_size?why sample in one batch must same?
The whole batch is used as beam for one instance. This way the decoding is made parallel on gpu.