class_docstr: This ``Model`` implements the ESIM sequence model described in `"Enhanced LSTM for Natural Language Inference"
  <https://www.semanticscholar.org/paper/Enhanced-LSTM-for-Natural-Language-Inference-Chen-Zhu/83e7654d545fbbaaf2328df365a781fb67b841b4>`_
  by Chen et al., 2017.
  
  Parameters
  ----------
  vocab : ``Vocabulary``
  text_field_embedder : ``TextFieldEmbedder``
      Used to embed the ``premise`` and ``hypothesis`` ``TextFields`` we get as input to the
      model.
  encoder : ``Seq2SeqEncoder``
      Used to encode the premise and hypothesis.
  similarity_function : ``SimilarityFunction``
      This is the similarity function used when computing the similarity matrix between encoded
      words in the premise and words in the hypothesis.
  projection_feedforward : ``FeedForward``
      The feedforward network used to project down the encoded and enhanced premise and hypothesis.
  inference_encoder : ``Seq2SeqEncoder``
      Used to encode the projected premise and hypothesis for prediction.
  output_feedforward : ``FeedForward``
      Used to prepare the concatenated premise and hypothesis for prediction.
  output_logit : ``FeedForward``
      This feedforward network computes the output logits.
  dropout : ``float``, optional (default=0.5)
      Dropout percentage to use.
  initializer : ``InitializerApplicator``, optional (default=``InitializerApplicator()``)
      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","the","ESIM","sequence","model","described","in","`","``","Enhanced","LSTM","for","Natural","Language","Inference","''","<","https",":","\/\/www.semanticscholar.org\/paper\/Enhanced-LSTM-for-Natural-Language-Inference-Chen-Zhu\/83e7654d545fbbaaf2328df365a781fb67b841b4",">","`","_","by","Chen","et","al.",",","2017",".","Parameters","--","--","--","--","--","vocab",":","``","Vocabulary","``","text_field_embedder",":","``","TextFieldEmbedder","``","Used","to","embed","the","``","premise","``","and","``","hypothesis","``","``","TextFields","``","we","get","as","input","to","the","model",".","encoder",":","``","Seq2SeqEncoder","``","Used","to","encode","the","premise","and","hypothesis",".","similarity_function",":","``","SimilarityFunction","``","This","is","the","similarity","function","used","when","computing","the","similarity","matrix","between","encoded","words","in","the","premise","and","words","in","the","hypothesis",".","projection_feedforward",":","``","FeedForward","``","The","feedforward","network","used","to","project","down","the","encoded","and","enhanced","premise","and","hypothesis",".","inference_encoder",":","``","Seq2SeqEncoder","``","Used","to","encode","the","projected","premise","and","hypothesis","for","prediction",".","output_feedforward",":","``","FeedForward","``","Used","to","prepare","the","concatenated","premise","and","hypothesis","for","prediction",".","output_logit",":","``","FeedForward","``","This","feedforward","network","computes","the","output","logits",".","dropout",":","``","float","``",",","optional","(","default=0.5",")","Dropout","percentage","to","use",".","initializer",":","``","InitializerApplicator","``",",","optional","(","default=","``","InitializerApplicator","(",")","``",")","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 {"accuracy": self._accuracy.get_metric(reset)}
  
file_path: magnitude/pymagnitude/third_party/allennlp/models/esim.py
imports: from __future__ import division
  from __future__ import absolute_import
  import torch
  from allennlp.common.checks import check_dimensions_match
  from allennlp.data import Vocabulary
  from allennlp.models.model import Model
  from allennlp.modules import FeedForward, InputVariationalDropout
  from allennlp.modules.matrix_attention.legacy_matrix_attention import LegacyMatrixAttention
  from allennlp.modules import Seq2SeqEncoder, SimilarityFunction, TextFieldEmbedder
  from allennlp.nn import InitializerApplicator, RegularizerApplicator
  from allennlp.nn.util import get_text_field_mask, last_dim_softmax, weighted_sum, replace_masked_values
  from allennlp.training.metrics import CategoricalAccuracy
label_desc: Use image node_id 3 for calling the ESIM obj's underlying member method code with example usage: obj.get_metrics(reset) and returns: dict