class_docstr: This similarity function uses multiple "heads" to compute similarity.  That is, we take the
  input tensors and project them into a number of new tensors, and compute similarities on each
  of the projected tensors individually.  The result here has one more dimension than a typical
  similarity function.
  
  For example, say we have two input tensors, both of shape ``(batch_size, sequence_length,
  100)``, and that we want 5 similarity heads.  We'll project these tensors with a ``100x100``
  matrix, then split the resultant tensors to have shape ``(batch_size, sequence_length, 5,
  20)``.  Then we call a wrapped similarity function on the result (by default just a dot
  product), giving a tensor of shape ``(batch_size, sequence_length, 5)``.
  
  Parameters
  ----------
  num_heads : ``int``
      The number of similarity heads to compute.
  tensor_1_dim : ``int``
      The dimension of the first tensor described above.  This is ``tensor.size()[-1]`` - the
      length of the vector `before` the multi-headed projection.  We need this so we can build
      the weight matrix correctly.
  tensor_1_projected_dim : ``int``, optional
      The dimension of the first tensor `after` the multi-headed projection, `before` we split
      into multiple heads.  This number must be divisible evenly by ``num_heads``.  If not given,
      we default to ``tensor_1_dim``.
  tensor_2_dim : ``int``, optional
      The dimension of the second tensor described above.  This is ``tensor.size()[-1]`` - the
      length of the vector `before` the multi-headed projection.  We need this so we can build
      the weight matrix correctly.  If not given, we default to ``tensor_1_dim``.
  tensor_2_projected_dim : ``int``, optional
      The dimension of the second tensor `after` the multi-headed projection, `before` we split
      into multiple heads.  This number must be divisible evenly by ``num_heads``.  If not given,
      we default to ``tensor_2_dim``.
  internal_similarity : ``SimilarityFunction``, optional
      The ``SimilarityFunction`` to call on the projected, multi-headed tensors.  The default is
      to use a dot product.
code: def reset_parameters(self):
      torch.nn.init.xavier_uniform_(self._tensor_1_projection)
      torch.nn.init.xavier_uniform_(self._tensor_2_projection)
  
file_path: magnitude/pymagnitude/third_party/allennlp/modules/similarity_functions/multiheaded.py
imports: from __future__ import absolute_import
  import torch
  from torch.nn.parameter import Parameter
  from allennlp.common.checks import ConfigurationError
  from allennlp.modules.similarity_functions.similarity_function import SimilarityFunction
  from allennlp.modules.similarity_functions.dot_product import DotProductSimilarity
label_desc: Use image node_id 2 for calling the MultiHeadedSimilarity obj's underlying member method code with example usage: obj.reset_parameters() without return types