Skip to content
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

support for stop_gradient? #2

Open
wants to merge 1 commit into
base: main
Choose a base branch
from
Open

Conversation

perara
Copy link

@perara perara commented Jun 16, 2021

I had a case where I stop_gradients in my flow. Due to this, some of my grads are zero.

I've proposed a fix for this, but I should at the same time, ask if this invalidates the method or not, or if this is the correct way of handling no gradients?

I had a case where I stop_gradients in my flow. Due to this, some of my grads are zero.

I've proposed a fix for this, but I should at the same time, ask if this invalidates the method or not, or if this is the correct way of handling no gradients?
@sayakpaul
Copy link
Owner

Thanks for the contribution. Could you provide more context as to what led to zero gradients?

If there are no gradients, the back path is generally routed as zero as well. So, this does not need to handled explicitly. Consider ReLU as an example. At 0, its derivatives are not defined so, it's simply routed as zeros.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants