I'd like to perform a direct/inverse Fourier transform in TensorFlow. In particular, I want to write it as a function that I can easily integrate into a neural network, which must be differentiable.
In practice, I want to be able to write something like:
x = tf.layers.conv2d(input_tensor)
x = tf.nn.relu(x)
X = fourier_transform(x)
Y = X + something_else
y = inverse_fourier_transform(Y)
z = tf.layers.conv2d(y)
z = tf.nn.relu(z)
....
I've found implementations of fft2d for the FFT, and of ifft2d and irfft2d for the inverse FFT, but I'm not sure if they are differentiable. Moreover, I don't know the difference between ifft and irfft.
Thanks,
G.