I did a test, and the snippet above actually works! modulo this bug: https://github.com/pytorch/pytorch/issues/31557 13
This is cool and opens a way towards easy experimentation of CTC modifications! It would be cool if there was a switch of ctc_loss so that we don’t have to do lot_probs.exp() (also not sure if it’s best to do F.log_softmax(...).exp() or do F.softmax(...) again)
My test and impl: https://gist.github.com/vadimkantorov/73e1915178f444b64f9ef01a1e96c1e4 12
Also, what would be your thoughts about factoring CTC Viterbi path aglorithm out of existing CTC implementation? Should that be doable? Or easier to recode it from scratch?