Skip to content

Conversation

@caogang
Copy link
Contributor

@caogang caogang commented May 6, 2017

[WIP] Add high order gradient support for sigmoid function, solving the issue #1483

  • sigmoid

This comment was marked as off-topic.

This comment was marked as off-topic.

This comment was marked as off-topic.

This comment was marked as off-topic.

@apaszke
Copy link
Contributor

apaszke commented May 6, 2017

@pytorchbot test this please

This comment was marked as off-topic.

This comment was marked as off-topic.

This comment was marked as off-topic.

This comment was marked as off-topic.

@apaszke
Copy link
Contributor

apaszke commented May 7, 2017

@pytorchbot test this please

@fmassa
Copy link
Member

fmassa commented May 7, 2017

Are there tests for double backprop that could be easily added?

@apaszke
Copy link
Contributor

apaszke commented May 7, 2017

per-op double backprop tests are unnecessary. We only use first-order jacobian vector product functions to compute grads of any order, so as long as first-order is correct it should be all good (assuming autograd code is correct, but we have separate tests for that).

@apaszke apaszke merged commit e3f41a4 into pytorch:master May 7, 2017
@fmassa
Copy link
Member

fmassa commented May 7, 2017

That's not true for code that has a different behavior if the grad is volatile, as in this PR.

@soumith
Copy link
Contributor

soumith commented May 7, 2017

i think we should add gradgradcheck, just like gradcheck. We dont know if new-style functions have been written correctly for grad of grad out of the box (for example, user may have rewrapped a Variable somewhere and thought it was okay)

@apaszke
Copy link
Contributor

apaszke commented May 7, 2017

gradcheck runs tests only on volatile grads, so this case is covered

@apaszke
Copy link
Contributor

apaszke commented May 7, 2017

I think that instead of computing a full hessian of each op (these tests would be soooo slooow) we could just add some simple clauses to gradcheck that make sure that there exists a path from grad_input.grad_fn to grad_output's grad accumulator. This should be enough.

caogang added a commit to caogang/pytorch that referenced this pull request May 8, 2017
* master:
  Add F.normalize (pytorch#1467)
  Expose custom attributes from C++ functions (pytorch#1430)
  Add high order gradient support for Sigmoid (pytorch#1496)
Jiaming-Liu pushed a commit to Jiaming-Liu/pytorch that referenced this pull request May 18, 2017
jjsjann123 pushed a commit to jjsjann123/pytorch that referenced this pull request Mar 2, 2022
* Minor fix for trivial reductions.


Co-authored-by: Naoya Maruyama <[email protected]>
jagadish-amd pushed a commit to jagadish-amd/pytorch that referenced this pull request Sep 5, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants