-
Notifications
You must be signed in to change notification settings - Fork 22
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
CTC gradient seems to be constant. #2
Comments
@mohammadpz, this is a known bug in my wrapper. If you take a look at https://github.com/sherjilozair/ctc/blob/master/python/ctc.py#L91, you will notice that I completely ignore the output_grads, because of which, the cost works only when it's the last node. Any further operations and compositions are completely ignored. I think the solution should be easy. I'll try to fix it and push it up. You are free to send in a PR with your solution as well. |
Oh, I see. You know, I want to divide the ctc cost by the batch size (which is variable). What's the quickest solution comes to your mind? |
Can I simply compute |
The quickest way would be to compute the grads, and then divide it by the batch size. That should work. |
I just replaced |
Isn't |
It is actually. In my case, I presume since it's just a division by batch size, the |
Cool. I'll test this with some other examples, and push it in. Thanks! |
I'm not 100% sure, though! |
I'm trying to define a loss as the sum of two CTC losses. Do you have an insight as to how to complete the CTC theano.Op implementation? I'll try what's presented here and if it works I'll push it to my fork of the repository, and I'll very much appreciate if you have any more information or guidance since I'm not a Theano expert. Thanks! |
I think that this would be correct: |
Hi @sherjilozair ,
Could you please run file
rnnctc.py
in my forked repo:https://github.com/mohammadpz/ctc/blob/master/examples/rnnctc.py
Variable
gradsx2
should be twice larger thangrads
. But it's not the caseAm I missing something?
The text was updated successfully, but these errors were encountered: