Is there a form of interpolate with parameters? torch.nn.functional.interpolate — PyTorch 1.10.1 documentation
I’m using the interpolate function to interpolate a small length tensor to a long length tensor, and I use the same to de-interpolate from long back to short. This results in a little bit of an error introduced (I’m using mode='trilinear').
What sort of layers with learnable parameters could I be using for a learnable de-interpolation? Conv?
Either I can do:
import torch.nn.functional as F

# strategy 1: parameter-free interpolate, parameter-free deinterpolate

x_long = F.interpolate(x_short, size=(long_size), mode='trilinear')
x_short_recon = F.interpolate(x_long, size=(short_size), mode='trilinear')

# strategy 2: parameter-free interpolate, learned deinterpolate

x_long = F.interpolate(x_short, size=(long_size), mode='trilinear')
x_short_recon = Conv(...)(x_long)