nn_glu | R Documentation |
Applies the gated linear unit function
{GLU}(a, b)= a \otimes \sigma(b)
where a
is the first half
of the input matrices and b
is the second half.
nn_glu(dim = -1)
dim |
(int): the dimension on which to split the input. Default: -1 |
Input: (\ast_1, N, \ast_2)
where *
means, any number of additional
dimensions
Output: (\ast_1, M, \ast_2)
where M=N/2
if (torch_is_installed()) {
m <- nn_glu()
input <- torch_randn(4, 2)
output <- m(input)
}
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.