pytorch-complex icon indicating copy to clipboard operation
pytorch-complex copied to clipboard

Mistake in function of Hyperbolic Tangent of Complex Number aka cTanh

Open Weijie-ZHAO opened this issue 1 year ago • 0 comments

https://github.com/soumickmj/pytorch-complex/blob/f5d0c3511a3f3c7cb7f138ee7f42a699d3f8209a/torchcomplex/nn/functional.py#L334

Hi there,

firstly thanks for your contribution in complex-valued cnn, but it seems that tanh function regarding complex number was defined wrong in your code, it should be

imag = torch.sin(2 * b) / denominator

Best

Weijie-ZHAO avatar Aug 22 '23 14:08 Weijie-ZHAO