Arctan2 in Theano

Hey Duserzym,
thanks for your answer! Interesting approach, I’ ll try it. But I guess it will be difficult because the function has scalars and TheanoTensor Variables as input.
Sadly I can’ t post my code here since it’s not solely written by me… But I work with a customized function which would return complex values. But since pymc3 does not support complex inference I need to split every value into real and imaginary part via complex roots and build the argument.
Using tt.arctan2(x,y) I get my model to run but sampling is still not possible. I am not sure yet if this because of the arctan2 or if I have another problem somewhere. But one problem about using a tensor function is that the inference now only works within the context of the pymc3 model.
I also tried to bypass the arctan2 mathematicaly by using the sign function. This sadly does not work because python regards it as ‘not stable’. Difficult problem…

Looking forward to your opinion!