[AI] GELU(Gaussian Error Linear Units)

JAsmine_log·2024년 8월 29일
0

GELU(Gaussian Error Linear Units)

GELU(x)=xΦ(x)GELU(x)=x∗\Phi(x)
where Φ(x)\Phi(x) is the Cumulative Distribution Function for Gaussian Distribution.

When the approximate argument is ‘tanhtanh’, Gelu is estimated with:

GELU(x)=0.5x(1+Tanh(2/π(x+0.044715x3)))GELU(x)=0.5∗x∗(1+Tanh(\sqrt{2/\pi}∗(x+0.044715∗x^3)))

  • Input: (∗), where \∗ means any number of dimensions.
  • Output: (∗), same shape as the input.


Reference
[1] https://pytorch.org/docs/stable/generated/torch.nn.GELU.html#torch.nn.GELU

profile
Everyday Research & Development

0개의 댓글