nn_geglu | R Documentation |
This module implements the Gaussian Error Linear Unit Gated Linear Unit (GeGLU) activation function.
It computes \text{GeGLU}(x, g) = x \cdot \text{GELU}(g)
where \(x\) and \(g\) are created by splitting the input tensor in half along the last dimension.
nn_geglu()
Shazeer N (2020). “GLU Variants Improve Transformer.” 2002.05202, https://arxiv.org/abs/2002.05202.
x = torch::torch_randn(10, 10)
glu = nn_geglu()
glu(x)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.