Beam Search for text recognition

Hey, I want to use beam search for inference in text recognition. I have understood the theory behind it but implementing it seems difficult. I looked at various codes but they all were difficult to understand. Can anyone guide to a simplified and well documented code of beam search. Or can anyone explain the code in this link.

This code seems pretty nice and usable, can you point out to the line where you’re not able to understand.

Check if this helps:

I didn’t understand the line no. 77. Can you elaborate what’s happening inside the logsumexp() function.

logsumexp() is nothing but taking the softmax for the arguments passed to it.

What is the need of softmax? Shouldn’t we just add the log probabilities.
For eg. in line no. 77 instead of logsumexp() can we write
n_p_b = p_b + p
And also logsumexp() doesn’t look like a softmax function.

Maybe they’re using logsumexp() in order to encounter the underflow here. Read more about this
I’m not so sure about this, but in the repo, author has given two links for the reference, maybe you can go through them once. Link1 Link2