nn_reglu | R Documentation |
Rectified Gated Linear Unit (ReGLU) module.
Computes the output as \text{ReGLU}(x, g) = x \cdot \text{ReLU}(g)
where \(x\) and \(g\) are created by splitting the input tensor in half along the last dimension.
nn_reglu()
Shazeer N (2020). “GLU Variants Improve Transformer.” 2002.05202, https://arxiv.org/abs/2002.05202.
x = torch::torch_randn(10, 10)
reglu = nn_reglu()
reglu(x)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.