class_docstr: A neural network model for entity matching.
  
  Refer to the
  `Matching Models tutorial <https://nbviewer.jupyter.org/github/sidharthms/deepmatcher/blob/master/examples/matching_models.ipynb>`_
  for details on how to customize a `MatchingModel`. A brief intro is below:
  
  This network consists of the following components:
  
  #. Attribute Summarizers
  
  #. Attribute Comparators
  
  #. A Classifier
  
  Creating a MatchingModel instance does not immediately construct the neural network.
  The network will be constructed just before training based on metadata from the
  training set:
  
  #. For each attribute (e.g., Product Name, Address, etc.), an Attribute Summarizer is
     constructed using the specified `attr_summarizer` template.
  #. For each attribute, an Attribute Comparator is constructed using the specified
     `attr_summarizer` template.
  #. A Classifier is constructed based on the specified `classifier` template.
  
  Args:
      attr_summarizer (string or :class:`AttrSummarizer` or callable):
          The attribute summarizer. Takes in two word embedding sequences and summarizes
          the information in them to produce two summary vectors as output.
          Options `listed here <https://nbviewer.jupyter.org/github/sidharthms/deepmatcher/blob/master/examples/matching_models.ipynb#attr_summarizer-can-be-set-to-one-of-the-following:>`__.
          Defaults to 'hybrid', i.e., the :class:`~deepmatcher.attr_summarizers.Hybrid`
          model.
      attr_comparator (string or :class:`~deepmatcher.modules.Merge` or callable):
          The attribute comparator. Takes as input the two summary vectors and applies a
          comparison function over those summaries to obtain the final similarity
          representation of the two attribute values. Argument must specify a
          :ref:`merge-op` operation. Default is selected based on `attr_summarizer`
          choice.
      attr_condense_factor (string or int):
          The factor by which to condense each attribute similarity vector. E.g. if
          `attr_condense_factor` is set to 3 and the attribute similarity vector size is
          300, then each attribute similarity vector is transformed to a 100 dimensional
          vector using a linear transformation. The purpose of condensing is to reduce
          the number of parameters in the classifier module. This parameter can be set
          to a number or 'auto'. If 'auto', then the condensing factor is set to be
          equal to the number attributes, but if there are more than 6 attributes, then
          the condensing factor is set to 6. Defaults to 'auto'.
      attr_merge (string or :class:`~deepmatcher.modules.Merge` or callable):
          The operation used to merge the (optionally condensed) attribute similarity
          vectors to obtain the input to the classifier. Argument must specify a
          :ref:`merge-op` operation. Defaults to 'concat', i.e., concatenate all
          attribute similarity vectors to form the classifier input.
      classifier (string or :class:`Classifier` or callable):
          The neural network to perform match / mismatch classification
          based on attribute similarity representations.
          Options `listed here <https://nbviewer.jupyter.org/github/sidharthms/deepmatcher/blob/master/examples/matching_models.ipynb#classifier-can-be-set-to-one-of-the-following:>`__.
          Defaults to '2-layer-highway', i.e., use a two layer highway network followed
          by a softmax layer for classification.
      hidden_size (int):
          The hidden size to use for the `attr_summarizer` and the `classifier` modules,
          if they are string arguments. If a module or :attr:`callable` input is specified
          for a component, this argument is ignored for that component.
class_docstr_tok: ["A","neural","network","model","for","entity","matching",".","Refer","to","the","`","Matching","Models","tutorial","<","https",":","\/\/nbviewer.jupyter.org\/github\/sidharthms\/deepmatcher\/blob\/master\/examples\/matching_models.ipynb",">","`","_","for","details","on","how","to","customize","a","`","MatchingModel","`",".","A","brief","intro","is","below",":","This","network","consists","of","the","following","components",":","#",".","Attribute","Summarizers","#",".","Attribute","Comparators","#",".","A","Classifier","Creating","a","MatchingModel","instance","does","not","immediately","construct","the","neural","network",".","The","network","will","be","constructed","just","before","training","based","on","metadata","from","the","training","set",":","#",".","For","each","attribute","(","e.g.",",","Product","Name",",","Address",",","etc",".",")",",","an","Attribute","Summarizer","is","constructed","using","the","specified","`","attr_summarizer","`","template",".","#",".","For","each","attribute",",","an","Attribute","Comparator","is","constructed","using","the","specified","`","attr_summarizer","`","template",".","#",".","A","Classifier","is","constructed","based","on","the","specified","`","classifier","`","template",".","Args",":","attr_summarizer","(","string","or",":","class",":","`","AttrSummarizer","`","or","callable",")",":","The","attribute","summarizer",".","Takes","in","two","word","embedding","sequences","and","summarizes","the","information","in","them","to","produce","two","summary","vectors","as","output",".","Options","`","listed","here","<","https",":","\/\/nbviewer.jupyter.org\/github\/sidharthms\/deepmatcher\/blob\/master\/examples\/matching_models.ipynb","#","attr_summarizer-can-be-set-to-one-of-the-following",":",">","`","__",".","Defaults","to","'hybrid","'",",","i.e.",",","the",":","class",":","`","~deepmatcher.attr_summarizers.Hybrid","`","model",".","attr_comparator","(","string","or",":","class",":","`","~deepmatcher.modules.Merge","`","or","callable",")",":","The","attribute","comparator",".","Takes","as","input","the","two","summary","vectors","and","applies","a","comparison","function","over","those","summaries","to","obtain","the","final","similarity","representation","of","the","two","attribute","values",".","Argument","must","specify","a",":","ref",":","`","merge-op","`","operation",".","Default","is","selected","based","on","`","attr_summarizer","`","choice",".","attr_condense_factor","(","string","or","int",")",":","The","factor","by","which","to","condense","each","attribute","similarity","vector",".","E.g",".","if","`","attr_condense_factor","`","is","set","to","3","and","the","attribute","similarity","vector","size","is","300",",","then","each","attribute","similarity","vector","is","transformed","to","a","100","dimensional","vector","using","a","linear","transformation",".","The","purpose","of","condensing","is","to","reduce","the","number","of","parameters","in","the","classifier","module",".","This","parameter","can","be","set","to","a","number","or","'auto","'",".","If","'auto","'",",","then","the","condensing","factor","is","set","to","be","equal","to","the","number","attributes",",","but","if","there","are","more","than","6","attributes",",","then","the","condensing","factor","is","set","to","6",".","Defaults","to","'auto","'",".","attr_merge","(","string","or",":","class",":","`","~deepmatcher.modules.Merge","`","or","callable",")",":","The","operation","used","to","merge","the","(","optionally","condensed",")","attribute","similarity","vectors","to","obtain","the","input","to","the","classifier",".","Argument","must","specify","a",":","ref",":","`","merge-op","`","operation",".","Defaults","to","'concat","'",",","i.e.",",","concatenate","all","attribute","similarity","vectors","to","form","the","classifier","input",".","classifier","(","string","or",":","class",":","`","Classifier","`","or","callable",")",":","The","neural","network","to","perform","match","\/","mismatch","classification","based","on","attribute","similarity","representations",".","Options","`","listed","here","<","https",":","\/\/nbviewer.jupyter.org\/github\/sidharthms\/deepmatcher\/blob\/master\/examples\/matching_models.ipynb","#","classifier-can-be-set-to-one-of-the-following",":",">","`","__",".","Defaults","to","'","2-layer-highway","'",",","i.e.",",","use","a","two","layer","highway","network","followed","by","a","softmax","layer","for","classification",".","hidden_size","(","int",")",":","The","hidden","size","to","use","for","the","`","attr_summarizer","`","and","the","`","classifier","`","modules",",","if","they","are","string","arguments",".","If","a","module","or",":","attr",":","`","callable","`","input","is","specified","for","a","component",",","this","argument","is","ignored","for","that","component","."]
docstr: Load the model state from a file in a certain path.
  
  Args:
      path (string): The path to load the model state from.
code: def load_state(self, path, map_location=None):
      r"""Load the model state from a file in a certain path.
  
      Args:
          path (string): The path to load the model state from.
      """
      state = torch.load(
          path, pickle_module=dill, map_location=map_location
      )
      for k, v in six.iteritems(state):
          if k != "model":
              self._train_buffers.add(k)
              setattr(self, k, v)
  
      if hasattr(self, "state_meta"):
          train_info = copy.copy(self.state_meta)
  
          # Handle metadata manually.
          # TODO (Sid): Make this cleaner.
          train_info.metadata = train_info.orig_metadata
          MatchingDataset.finalize_metadata(train_info)
  
          self.initialize(train_info, self.state_meta.init_batch)
  
      self.load_state_dict(state["model"])
  
imports: import copy
  import logging
  from collections import Mapping
  import dill
  import six
  import deepmatcher
  import torch
  import torch.nn
  from .None import _utils
  from ..data import MatchingDataset, MatchingIterator
  from ..runner import Runner
  from ..utils import Bunch, tally_parameters
label_desc: Use image node_id 11 for calling the MatchingModel obj's underlying member method code with example usage: obj.load_state(path, map_location) without return types