class_docstr: Computes attention between two matrices using a bilinear attention function.  This function has
  a matrix of weights ``W`` and a bias ``b``, and the similarity between the two matrices ``X``
  and ``Y`` is computed as ``X W Y^T + b``.
  
  Parameters
  ----------
  matrix_1_dim : ``int``
      The dimension of the matrix ``X``, described above.  This is ``X.size()[-1]`` - the length
      of the vector that will go into the similarity computation.  We need this so we can build
      the weight matrix correctly.
  matrix_2_dim : ``int``
      The dimension of the matrix ``Y``, described above.  This is ``Y.size()[-1]`` - the length
      of the vector that will go into the similarity computation.  We need this so we can build
      the weight matrix correctly.
  activation : ``Activation``, optional (default=linear (i.e. no activation))
      An activation function applied after the ``X W Y^T + b`` calculation.  Default is no
      activation.
  use_input_biases : ``bool``, optional (default = False)
      If True, we add biases to the inputs such that the final computation
      is equivelent to the original bilinear matrix multiplication plus a
      projection of both inputs.
code: def __init__(
      self,
      matrix_1_dim,
      matrix_2_dim,
      activation=None,
      use_input_biases=False,
  ):
      super(BilinearMatrixAttention, self).__init__()
      if use_input_biases:
          matrix_1_dim += 1
          matrix_2_dim += 1
      self._weight_matrix = Parameter(
          torch.Tensor(matrix_1_dim, matrix_2_dim)
      )
  
      self._bias = Parameter(torch.Tensor(1))
      self._activation = activation or Activation.by_name("linear")()
      self._use_input_biases = use_input_biases
      self.reset_parameters()
  
file_path: magnitude/pymagnitude/third_party/allennlp/modules/matrix_attention/bilinear_matrix_attention.py
imports: from __future__ import absolute_import
  import torch
  from torch.nn.parameter import Parameter
  from allennlp.modules.matrix_attention.matrix_attention import MatrixAttention
  from allennlp.nn import Activation
label_desc: Use image node_id 1 to create a new BilinearMatrixAttention object from inherited base classes: MatrixAttention with example: obj = BilinearMatrixAttention(matrix_1_dim, matrix_2_dim, activation, use_input_biases)