Closed v0lta closed 1 year ago
https://github.com/v0lta/PyTorch-Wavelet-Toolbox/pull/50 has the separable conv transforms for v.0.1.5 (work in progress).
Thanks, Felix. Not having a publicly available function might be better since we do not support n-dimensional inputs anywhere else. The toolbox feels more consistent this way.
It bugged me that the separable
attribute of WaveletPacket2D
was ignored for convolutional transforms, so I added support for it. However I am not really happy with the necessary conversions between the [Tensor, Tuple[Tensor, ...]]
and [Tensor, Dict[str, Tensor]]
formats.
Btw: I have no clue why one test failed for cc74842
Currently, the default for WaveletPacket2D
are non-separable transforms. Should we switch that to separable as well or keep it at non-separable?
I think the default should ensure results are consistent with the pywt-packets. Looking at https://github.com/v0lta/PyTorch-Wavelet-Toolbox/blob/d4263467be00b64ae3074681e6593550a42d7540/src/ptwt/packets.py#L257 tells me we can keep the reflect default and have separable equal True. I think that makes lots of sense. Great Idea, @felixblanke !
Ah, I see you added support for separable conv transforms for the 2D packets. Thank you! In this case, I would leave the defaults unchanged because I expect most users to want pywt-compatible results.
The jit tests run just fine with torch 2.0 . I have tested this. https://github.com/v0lta/PyTorch-Wavelet-Toolbox/issues/51 is now closed. We should merge. Other changes should go into future releases.
What's new:
wavedec3
and 1D-matrix transformation code.separable_conv_transform
module now provides support for separable padded transforms.wavedec2
now have the shape [batch, height, width] instead of [batch, 1, height, width].test/test_jit.py
for more details.Breaking changes:
wavedec2
andMatrixWavedec2
to produce identical coefficients in theHaar
case, setseparable
toFalse
._get_pad
is now private.pywt
the padded analysis transforms argument order has changed. The order is now alwaysdata, wavelet, mode, level
.