fbcotter / pytorch_wavelets

Pytorch implementation of 2D Discrete Wavelet (DWT) and Dual Tree Complex Wavelet Transforms (DTCWT) and a DTCWT based ScatterNet
Other
943 stars 146 forks source link

replace nn.Parameter with buffers #19

Closed cfinlay closed 3 years ago

cfinlay commented 3 years ago

It's very unlikely that the wavelet filters will ever be updated. Thus it's probably best to treat them as module buffers rather than nn.Parameters.

This change prevents the user from doing something silly like turning on requires_grad for all parameters in the network, and then inadvertently updating the wavelet filters with a backwards call.

fbcotter commented 3 years ago

Thanks @cfinlay. This is definitely better than turning off grads. Can you also bump the version number?

cfinlay commented 3 years ago

Sure thing, version bumped :-)