MAINT Speed up `test_gradients`
This pull request speeds up test_gradients by enabling fast_mode. Previously it took 109 seconds to run, now it takes 17 seconds.
fast_mode (bool, optional) – Fast mode for gradcheck and gradgradcheck is currently only implemented for R to R functions. If none of the inputs and outputs are complex a faster implementation of gradcheck that no longer computes the entire jacobian is run; otherwise, we fall back to the slow implementation.
Note that since our scattering takes in as input a real valued signal, and outputs a real valued signal, torch allows us to enable fast_mode to avoid computing additional entries of a jacobian.
This PR resolves issue #872
lol fast_mode is implemented in pytorch 1.9 but not before. Maybe this is an un-needed change?
I do believe that OLGD seemed to mention something about the tests taking a long time to finish running. perhaps this grad check business was slowing him down? Perhaps we should move this gradcheck to a seperate script+folder?
lol
fast_modeis implemented in pytorch 1.9 but not before. Maybe this is an un-needed change?
Ok and since we want to be testing 1.8 we'll have to run the slow check anyhow… One option is to just run the gradcheck on more recent torch versions. Another is to stop supporting old torch versions, but that's a separate question.
@janden in the wake of https://github.com/kymatio/kymatio/pull/892, we no longer test torch 1.8 so i believe we could reopen this and merge it for v0.4
Codecov Report
Patch and project coverage have no change.
Comparison is base (
05ae680) 96.00% compared to head (62d542f) 96.00%.
Additional details and impacted files
@@ Coverage Diff @@
## main #873 +/- ##
=======================================
Coverage 96.00% 96.00%
=======================================
Files 73 73
Lines 2575 2575
=======================================
Hits 2472 2472
Misses 103 103
| Flag | Coverage Δ | |
|---|---|---|
| jenkins_main | 96.00% <ø> (ø) |
Flags with carried forward coverage won't be shown. Click here to find out more.
:umbrella: View full report in Codecov by Sentry.
:loudspeaker: Do you have feedback about the report comment? Let us know in this issue.