I am a beginner in PyTorch and I’m working on training a cnn in the fourier domain completely to exploit advantages of the fourier domain, like the convolution theorem etc. Though PyTorch has an rfft function to get fourier representation of real images and weights etc., after taking the rfft, I would need to take the dot product of the complex tensor outputs of rfft. Similarly many other operations on complex tensors might be needed in the cnn’s functioning.
Given the lack of complex data type in PyTorch currently, would it be better to shift to Tensorflow which does support a complex data type? Also, what are the advantages and drawbacks of tensorflow over PyTorch?
Or can the complex data type supported by NumPy be used in PyTorch?
Refer to this discussion on integrating complex numbers in pytorch link.
Apart from these there is not much difference in TF and torch, except the code base. TF is lot more cluttered in the sense way too many deprecations and too complex to learn (not true for TF 2.0).
At the end I think it comes to your preference I think, fastai a very useful library is build on PyTorch. Also, you can use tensorboard on PyTorch also.
In case you want to work on cloud TPUs your only option as of now is TF (PyTorch support is coming soon).
@Kushaj Hi, thank you for your valuable solution. Is Tensorflow support complex computation completely? for example, complex valued convolution, deconvolution, gradient computation, etc…
It is of significant importance to me.
Hope for your reply.
Sorry man, I don’t have much knowledge about tensorflow.
I found this link. See the last example of the page, it shows creation of a network. Also, I think as tensorflow supports complex dtypes, can you try changing the dtypes to your model inputs.