Skip to content

support for stop_gradient?#2

Open
perara wants to merge 1 commit into
sayakpaul:mainfrom
perara:patch-1
Open

support for stop_gradient?#2
perara wants to merge 1 commit into
sayakpaul:mainfrom
perara:patch-1

Conversation

@perara

@perara perara commented Jun 16, 2021

Copy link
Copy Markdown

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
Copy Markdown
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