class_docstr: Computes attention between a vector and a matrix using a bilinear attention function.  This
  function has a matrix of weights ``W`` and a bias ``b``, and the similarity between the vector
  ``x`` and the matrix ``y`` is computed as ``x^T W y + b``.
  
  Parameters
  ----------
  vector_dim : ``int``
      The dimension of the vector, ``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_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^T W y + b`` calculation.  Default is no
      activation.
  normalize : ``bool``, optional (default: ``True``)
      If true, we normalize the computed similarities with a softmax, to return a probability
      distribution for your attention.  If false, this is just computing a similarity score.
code: def __init__(
      self, vector_dim, matrix_dim, activation=None, normalize=True
  ):
      super(BilinearAttention, self).__init__(normalize)
      self._weight_matrix = Parameter(
          torch.Tensor(vector_dim, matrix_dim)
      )
      self._bias = Parameter(torch.Tensor(1))
      self._activation = activation or Activation.by_name("linear")()
      self.reset_parameters()
  
file_path: magnitude/pymagnitude/third_party/allennlp/modules/attention/bilinear_attention.py
imports: from __future__ import absolute_import
  import torch
  from torch.nn.parameter import Parameter
  from allennlp.modules.attention.attention import Attention
  from allennlp.nn import Activation
label_desc: Use image node_id 1 to create a new BilinearAttention object from inherited base classes: Attention with example: obj = BilinearAttention(vector_dim, matrix_dim, activation, normalize)