warp-ctc
warp-ctc copied to clipboard
How to return the individual loss of each sequence?
Hi,
Right now the code returns the average or total loss for the entire batch, I am wondering how should I change the source code to return loss for each individual sequence in a batch?
Thank you so much.
Hi,
You have to modify the init.py file in : warp-ctc/pytorch_binding/warpctc_pytorch. You can have a look to the _CTC function, this is where averaging is done. You might modify line 33 to 45, and process the variable "costs" differently.