class_docstr: MatchingHistogramUnit Class.
  
  :param bin_size: The number of bins of the matching histogram.
  :param embedding_matrix: The word embedding matrix applied to calculate
                           the matching histogram.
  :param normalize: Boolean, normalize the embedding or not.
  :param mode: The type of the historgram, it should be one of 'CH', 'NG',
               or 'LCH'.
  
  Examples:
      >>> embedding_matrix = np.array([[1.0, -1.0], [1.0, 2.0], [1.0, 3.0]])
      >>> text_left = [0, 1]
      >>> text_right = [1, 2]
      >>> histogram = MatchingHistogram(3, embedding_matrix, True, 'CH')
      >>> histogram.transform([text_left, text_right])
      [[3.0, 1.0, 1.0], [1.0, 2.0, 2.0]]
docstr: The constructor.
docstr_tok: ["The","constructor","."]
code: def __init__(
      self,
      bin_size: int = 30,
      embedding_matrix=None,
      normalize=True,
      mode: str = "LCH",
  ):
      """The constructor."""
      self._hist_bin_size = bin_size
      self._embedding_matrix = embedding_matrix
      if normalize:
          self._normalize_embedding()
      self._mode = mode
  
imports: import numpy
  from .unit import Unit
label_desc: Use image node_id 1 to create a new MatchingHistogram object from inherited base classes: Unit with example: obj = MatchingHistogram(bin_size, embedding_matrix, normalize, mode)