Closed al-jshen closed 1 year ago
This is unfortunately extremely slow compared to torchinterp1d
(~100x slower on the forward pass for length 5000 tensors) and I am not too sure why. I have everything running with @torch.jit.script
and I've followed this PyTorch guide to parallelize the inner loop.
Is it slow for single spectra or batches of spectra?
Both.
Hi @al-jshen. How can I make this faster? Thanks!
Replaces
torchinterp1d
with a newinterp1d
function inspender/util.py
The main motivation is that
torchinterp1d
seems to have some issues with backprop (at least on my machine, also see https://github.com/aliutkus/torchinterp1d/issues/16 and https://github.com/aliutkus/torchinterp1d/issues/17).The new implementation also clamps at the edges instead of extrapolating.