karpathy / neuraltalk2

Efficient Image Captioning code in Torch, runs on GPU
5.49k stars 1.26k forks source link

Update LanguageModel.lua #189

Closed YuanEZhou closed 6 years ago

YuanEZhou commented 6 years ago

To remedy the bias towards short sentences during inference by length normalization. The search alone one beam stops once it encounters an END token. Breaking the loop once encountering beam_size END tokens simultaneously.