Applies a bilinear transformation to the incoming data
Shape
Input1:
and means any number of additional dimensions. All but the last dimension of the inputs should be the same.Input2:
where .Output:
where and all but the last dimension are the same shape as the input.
Attributes
weight: the learnable weights of the module of shape
. The values are initialized from , wherebias: the learnable bias of the module of shape
. Ifbias
isTRUE
, the values are initialized from , where
Examples
if (torch_is_installed()) {
m <- nn_bilinear(20, 30, 50)
input1 <- torch_randn(128, 20)
input2 <- torch_randn(128, 30)
output <- m(input1, input2)
print(output$size())
}
#> [1] 128 50