Rate this Page

Bilinear#

classtorch.nn.modules.linear.Bilinear(in1_features,in2_features,out_features,bias=True,device=None,dtype=None)[source]#

Applies a bilinear transformation to the incoming data:y=x1TAx2+by = x_1^T A x_2 + b.

Parameters
  • in1_features (int) – size of each first input sample, must be > 0

  • in2_features (int) – size of each second input sample, must be > 0

  • out_features (int) – size of each output sample, must be > 0

  • bias (bool) – If set toFalse, the layer will not learn an additive bias.Default:True

Shape:
Variables

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])
extra_repr()[source]#

Return the extra representation of the module.

Return type

str

forward(input1,input2)[source]#

Runs the forward pass.

Return type

Tensor

reset_parameters()[source]#

Resets parameters based on their initialization used in__init__.