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

No LayerNorm Implementation

Open Karn3003 opened this issue 1 year ago • 2 comments

Hi, Thanks for the awesome implementation. It would be great if you could add Layer Norm implementation as well.

Karn3003 avatar Jan 09 '24 15:01 Karn3003

Thanks @Karn3003 Happy to hear that you found it useful. I will add Layer Norm ASAP. If you have any specific deadline, let me know.

soumickmj avatar Jan 09 '24 15:01 soumickmj

Yeah, I am using your codebase for one of my projects and the deadline is next month. Was testing some architectures and needed layer norm for that so would be helpful if you could have implementation for that as well. Also do add following activation as well.

class ComplexGELU(nn.Module):
    def __init__(self):
        super(ComplexGELU, self).__init__()

    def forward(self, input):
        real_gelu = F.gelu(input.real)
        imag_gelu = F.gelu(input.imag)

        return torch.complex(real_gelu, imag_gelu)

Karn3003 avatar Jan 09 '24 15:01 Karn3003