class_docstr: DRMM Model.
  
  Examples:
      >>> model = DRMM()
      >>> model.params['mlp_num_layers'] = 1
      >>> model.params['mlp_num_units'] = 5
      >>> model.params['mlp_num_fan_out'] = 1
      >>> model.params['mlp_activation_func'] = 'tanh'
      >>> model.guess_and_fill_missing_params(verbose=0)
      >>> model.build()
      >>> model.compile()
docstr: Build model structure.
code: def build(self):
      """Build model structure."""
  
      # Scalar dimensions referenced here:
      #   B = batch size (number of sequences)
      #   D = embedding size
      #   L = `input_left` sequence length
      #   R = `input_right` sequence length
      #   H = histogram size
      #   K = size of top-k
  
      # Left input and right input.
      # query: shape = [B, L]
      # doc: shape = [B, L, H]
      # Note here, the doc is the matching histogram between original query
      # and original document.
      query = keras.layers.Input(
          name="text_left", shape=self._params["input_shapes"][0]
      )
      match_hist = keras.layers.Input(
          name="match_histogram", shape=self._params["input_shapes"][1]
      )
  
      embedding = self._make_embedding_layer()
      # Process left input.
      # shape = [B, L, D]
      embed_query = embedding(query)
      # shape = [B, L]
      atten_mask = tf.not_equal(query, self._params["mask_value"])
      # shape = [B, L]
      atten_mask = tf.cast(atten_mask, K.floatx())
      # shape = [B, L, D]
      atten_mask = tf.expand_dims(atten_mask, axis=2)
      # shape = [B, L, D]
      attention_probs = self.attention_layer(embed_query, atten_mask)
  
      # Process right input.
      # shape = [B, L, 1]
      dense_output = self._make_multi_layer_perceptron_layer()(
          match_hist
      )
  
      # shape = [B, 1, 1]
      dot_score = keras.layers.Dot(axes=[1, 1])(
          [attention_probs, dense_output]
      )
  
      flatten_score = keras.layers.Flatten()(dot_score)
  
      x_out = self._make_output_layer()(flatten_score)
      self._backend = keras.Model(
          inputs=[query, match_hist], outputs=x_out
      )
  
file_path: MatchZoo/matchzoo/models/drmm.py
imports: import typing
  import keras
  import keras.backend
  import tensorflow
  from matchzoo.engine.base_model import BaseModel
  from matchzoo.engine.param import Param
  from matchzoo.engine.param_table import ParamTable
label_desc: Use image node_id 2 for calling the DRMM obj's underlying member method code with example usage: obj.build() without return types