i tried to re-implemented on both of them following this code 馃憤
import torch
from torch.nn import functional as F
def complex_softmax(input, dim=None):
"""Applies the complex softmax function to an input tensor.
"""
B , C , Freq,time_d = input.size()
real = F.softmax(input.real, dim=dim)
imaginary = F.softmax(input.imag, dim=dim)
magnitudes = torch.sqrt((real ** 2 + imaginary ** 2))
return (real * magnitudes).view(B*C ,Freq,time_d) * (
imaginary * magnitudes
).view(B,C ,Freq,time_d)
i tried to re-implemented on both of them following this code 馃憤