class_docstr: This ``Model`` implements BiMPM model described in `Bilateral Multi-Perspective Matching
  for Natural Language Sentences <https://arxiv.org/abs/1702.03814>`_ by Zhiguo Wang et al., 2017.
  Also please refer to the `TensorFlow implementation <https://github.com/zhiguowang/BiMPM/>`_ and
  `PyTorch implementation <https://github.com/galsang/BIMPM-pytorch>`_.
  
  Parameters
  ----------
  vocab : ``Vocabulary``
  text_field_embedder : ``TextFieldEmbedder``
      Used to embed the ``premise`` and ``hypothesis`` ``TextFields`` we get as input to the
      model.
  matcher_word : ``BiMpmMatching``
      BiMPM matching on the output of word embeddings of premise and hypothesis.
  encoder1 : ``Seq2SeqEncoder``
      First encoder layer for the premise and hypothesis
  matcher_forward1 : ``BiMPMMatching``
      BiMPM matching for the forward output of first encoder layer
  matcher_backward1 : ``BiMPMMatching``
      BiMPM matching for the backward output of first encoder layer
  encoder2 : ``Seq2SeqEncoder``
      Second encoder layer for the premise and hypothesis
  matcher_forward2 : ``BiMPMMatching``
      BiMPM matching for the forward output of second encoder layer
  matcher_backward2 : ``BiMPMMatching``
      BiMPM matching for the backward output of second encoder layer
  aggregator : ``Seq2VecEncoder``
      Aggregator of all BiMPM matching vectors
  classifier_feedforward : ``FeedForward``
      Fully connected layers for classification.
  dropout : ``float``, optional (default=0.1)
      Dropout percentage to use.
  initializer : ``InitializerApplicator``, optional (default=``InitializerApplicator()``)
      If provided, will be used to initialize the model parameters.
  regularizer : ``RegularizerApplicator``, optional (default=``None``)
      If provided, will be used to calculate the regularization penalty during training.
class_docstr_tok: ["This","``","Model","``","implements","BiMPM","model","described","in","`","Bilateral","Multi-Perspective","Matching","for","Natural","Language","Sentences","<","https",":","\/\/arxiv.org\/abs\/1702.03814",">","`","_","by","Zhiguo","Wang","et","al.",",","2017",".","Also","please","refer","to","the","`","TensorFlow","implementation","<","https",":","\/\/github.com\/zhiguowang\/BiMPM\/",">","`","_","and","`","PyTorch","implementation","<","https",":","\/\/github.com\/galsang\/BIMPM-pytorch",">","`","_",".","Parameters","--","--","--","--","--","vocab",":","``","Vocabulary","``","text_field_embedder",":","``","TextFieldEmbedder","``","Used","to","embed","the","``","premise","``","and","``","hypothesis","``","``","TextFields","``","we","get","as","input","to","the","model",".","matcher_word",":","``","BiMpmMatching","``","BiMPM","matching","on","the","output","of","word","embeddings","of","premise","and","hypothesis",".","encoder1",":","``","Seq2SeqEncoder","``","First","encoder","layer","for","the","premise","and","hypothesis","matcher_forward1",":","``","BiMPMMatching","``","BiMPM","matching","for","the","forward","output","of","first","encoder","layer","matcher_backward1",":","``","BiMPMMatching","``","BiMPM","matching","for","the","backward","output","of","first","encoder","layer","encoder2",":","``","Seq2SeqEncoder","``","Second","encoder","layer","for","the","premise","and","hypothesis","matcher_forward2",":","``","BiMPMMatching","``","BiMPM","matching","for","the","forward","output","of","second","encoder","layer","matcher_backward2",":","``","BiMPMMatching","``","BiMPM","matching","for","the","backward","output","of","second","encoder","layer","aggregator",":","``","Seq2VecEncoder","``","Aggregator","of","all","BiMPM","matching","vectors","classifier_feedforward",":","``","FeedForward","``","Fully","connected","layers","for","classification",".","dropout",":","``","float","``",",","optional","(","default=0.1",")","Dropout","percentage","to","use",".","initializer",":","``","InitializerApplicator","``",",","optional","(","default=","``","InitializerApplicator","(",")","``",")","If","provided",",","will","be","used","to","initialize","the","model","parameters",".","regularizer",":","``","RegularizerApplicator","``",",","optional","(","default=","``","None","``",")","If","provided",",","will","be","used","to","calculate","the","regularization","penalty","during","training","."]
code: def get_metrics(self, reset=False):
      return dict(
          (metric_name, metric.get_metric(reset))
          for metric_name, metric in list(self.metrics.items())
      )
  
file_path: magnitude/pymagnitude/third_party/allennlp/models/bimpm.py
imports: from __future__ import absolute_import
  import torch
  from allennlp.common.checks import check_dimensions_match
  from allennlp.data import Vocabulary
  from allennlp.modules import FeedForward, Seq2SeqEncoder, Seq2VecEncoder, TextFieldEmbedder
  from allennlp.models.model import Model
  from allennlp.nn import InitializerApplicator, RegularizerApplicator
  from allennlp.nn import util
  from allennlp.training.metrics import CategoricalAccuracy
  from allennlp.modules.bimpm_matching import BiMpmMatching
label_desc: Use image node_id 3 for calling the BiMpm obj's underlying member method code with example usage: obj.get_metrics(reset) and returns: dict