Bilinear
- class torch.nn.Bilinear(in1_features, in2_features, out_features, bias=True, device=None, dtype=None)
Applies a bilinear transformation to the incoming data: .
Applies a bilinear transformation to the incoming data: .
Input1: where and means any number of additional dimensions including none. 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.
weight (torch.Tensor) – the learnable weights of the module of shape . The values are initialized from , where
bias – the learnable bias of the module of shape .
If bias is True, the values are initialized from
, where
Examples:
>>> m = nn.Bilinear(20, 30, 40)
>>> input1 = torch.randn(128, 20)
>>> input2 = torch.randn(128, 30)
>>> output = m(input1, input2)
>>> print(output.size())
torch.Size([128, 40])
Return the extra representation of the module.
Runs the forward pass.
Resets parameters based on their initialization used in __init__.