kymatio icon indicating copy to clipboard operation
kymatio copied to clipboard

Shorten duration of `test_gradients`

Open MuawizChaudhary opened this issue 3 years ago • 4 comments

test_gradients takes a long time to finish running. I propose we look into making the test take a smaller amount of time to finish running, or switch over to using a modulus that doesn't implement a custom backwards.

MuawizChaudhary avatar Jun 11 '22 16:06 MuawizChaudhary

Would be nice. Maybe there are some settings there to tweak.

But yes, if we can use a stock modulus, that would be better… Maybe now that Torch has complex numbers that should be possible?

janden avatar Jun 13 '22 21:06 janden

@janden are we wanting to keep supporting torch 1.7? One thing we could do in that case to make the sqrt operation differentiable is adding a small epsilon.

MuawizChaudhary avatar Jun 14 '22 00:06 MuawizChaudhary

@janden are we wanting to keep supporting torch 1.7?

I'm not sure. That's a separate discussion.

One thing we could do in that case to make the sqrt operation differentiable is adding a small epsilon.

That would break all the tests, so it'd be nice to avoid that…

janden avatar Jun 14 '22 05:06 janden

Another option here is to test our modulus separately (using test_gradients) and only verify that we can run backward on the output of scattering (i.e., not test the gradient of the full transform).

janden avatar Jun 22 '22 05:06 janden

Given that we merged #873 I believe this discussion is no longer needed.

We no longer support the earlier versions of torch, and thus we no longer use the long version of test_gradients.

MuawizChaudhary avatar Sep 12 '23 19:09 MuawizChaudhary