Skip to content

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.

2 participants