v0lta / PyTorch-Wavelet-Toolbox

Differentiable fast wavelet transforms in PyTorch with GPU support.
https://pytorch-wavelet-toolbox.readthedocs.io
European Union Public License 1.2
279 stars 36 forks source link

Allow specification of odd length boundary padding in MatrixWavedec #97

Closed felixblanke closed 3 months ago

felixblanke commented 3 months ago

Addresses #90.

In sparse-matrix based wavelet decompositions, we require all transformed approximations coefficients to be of even length. This is enforced by padding a single value along all axes with odd lengths.

Currently, this is always done by zero padding. This PR adds the option to specify a different padding type.

This also makes it easier to document the padding behaviour.

felixblanke commented 3 months ago

I find the naming of the argument boundary of the matrix transforms very confusing, in particular as another argument of type BoundaryMode is introduced. I would therefore suggest to rename boundary to boundary_orthogonalization

v0lta commented 3 months ago

Could we just call it orthogonalization instead of boundary? boundary_orthogonalization is too much to type.

v0lta commented 3 months ago

I have made a few changes. What do you think?

felixblanke commented 3 months ago

I also added the deprecation warning to the packets and added more tests

felixblanke commented 3 months ago

I did some minor tweaks for consistency and renamed _is_boundary_mode_supported to _is_orthogonalize_method_supported.

I think this PR is good to go.