Why gradient does not scale linearly with CTCloss?
See original GitHub issueI am trying to use CTCLoss with another loss, and want coefficients of CTCLoss smaller. But when I tried different
This is the extreme cases for small CTCLoss. (CTCLoss coefficient = 0)
criterion = CTCLoss()
loss = 0*criterion(out, targets, sizes, target_sizes)
model.zero_grad()
loss.backward()
optimizer.step()
for param in model.parameters():
if param.grad is not None:
grad_norm += param.grad.norm().data[0]
In above example, loss is always 0. However, fairly large gradient value still exists even CTCLoss coefficient is 0.
Can anyone explain why gradient does not scale linearly with CTCLoss?
Issue Analytics
- State:
- Created 6 years ago
- Comments:11 (8 by maintainers)
Top Results From Across the Web
Developers - Why gradient does not scale linearly with CTCloss? -
I am trying to use CTCLoss with another loss, and want coefficients of CTCLoss smaller. But when I tried different. This is the...
Read more >CTCLoss performance of PyTorch 1.0.0 - #39 by phtephanx - nlp
My acoustic model does not converge using the nn.CTCLoss function. The model used 4 BiLSTM layers and one linear layer. When I looked...
Read more >BEN CHEN's Homepage - ctc loss - Google Sites
Sometimes, the calculated ctc loss has an infinity element and infinity gradient. This is common when the input sequence is not too much...
Read more >Sequence Modeling with CTC - Distill.pub
The CTC loss function is differentiable with respect to the per time-step output probabilities since it's just sums and products of them. Given ......
Read more >Scaling DeepSpeech using Mixed Precision and KubeFlow
A crucial portion of our audio pipeline is our automatic speech recognition ... dynamic loss scaling was crucial to ensure that our gradients...
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
nn.CTCLoss
doesn’t have the softmax in it. We need to give an explicit log softmax of the input probs to it. I’ve tested but this isn’t making the difference. I guess the most difference was happened by the gradient connection inbackward()
This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions.