pytorch / vision

Datasets, Transforms and Models specific to Computer Vision
https://pytorch.org/vision
BSD 3-Clause "New" or "Revised" License
16.32k stars 6.97k forks source link

Request to port Torch-Signal to Pytorch #3240

Open viggi1000 opened 6 years ago

viggi1000 commented 6 years ago

Hi @soumith, As discussed today researchers dealing with 1-D signals (Biomedical mainly) would find it immensely helpful if we can get something similar to the Torch-Signal for applying cuda optimized transforms like Wavelet/FFT to 1D signals. Presently we have to apply transforms on scipy or numpy or use libraries like PytorchWavelet which too rely on cpu based libraries to apply the transform and just wrap around PyTorch's Conv1D function. It would be amazing to get a library to do the same in CUDA allowing us to integrate wavelet transforms in our training pipeline in runtime as opposed to us applying the tranform on hours long signals.

Thank you for hearing me out and thanks for the amazing presentation today.

ssnl commented 6 years ago

Agreed. Wavelet transform is something that we should have in core/torchaudio.

t-vi commented 6 years ago

What do you have in mind? I could offer to do something like this (takes coeffs from PyWavelets) for 1d/2d: https://github.com/t-vi/pytorch-tvmisc/blob/master/misc/2D-Wavelet-Transform.ipynb

viggi1000 commented 6 years ago

@t-vi That sounds good for start, PytorchWavelet is a great implementation which used nn.Conv1d and used numpy complex numbers to find wavelets. Other transforms like Gabor, Fourier would be appreciated.

gchanan commented 3 years ago

@vincentqb do we have something like this in torchaudio at this point?

vincentqb commented 3 years ago

We do have the STFT (torch.stft and torch.istft) and Spectrogram transform (in audio). These are related to the fast Fourier transform, torch.fft.

We do not have the wavelet transform in audio yet, though it is used in audio. I've opened an issue requesting use case for it in pytorch/audio#1169.

We also have a discussion ongoing in pytorch/audio#267 about where should more general time series transformation lives.

t-vi commented 3 years ago

I think the wavelet transform is relevant enough in vision to have it in PyTorch rather than audio.