class_docstr: KNRM model.
  
  Examples:
      >>> model = KNRM()
      >>> model.params['embedding_input_dim'] =  10000
      >>> model.params['embedding_output_dim'] =  10
      >>> model.params['embedding_trainable'] = True
      >>> model.params['kernel_num'] = 11
      >>> model.params['sigma'] = 0.1
      >>> model.params['exact_sigma'] = 0.001
      >>> model.guess_and_fill_missing_params(verbose=0)
      >>> model.build()
docstr: Build model.
docstr_tok: ["Build","model","."]
code: def build(self):
      """Build model."""
      query, doc = self._make_inputs()
  
      embedding = self._make_embedding_layer()
      q_embed = embedding(query)
      d_embed = embedding(doc)
  
      mm = keras.layers.Dot(axes=[2, 2], normalize=True)(
          [q_embed, d_embed]
      )
  
      KM = []
      for i in range(self._params["kernel_num"]):
          mu = (
              1.0 / (self._params["kernel_num"] - 1)
              + (2.0 * i) / (self._params["kernel_num"] - 1)
              - 1.0
          )
          sigma = self._params["sigma"]
          if mu > 1.0:
              sigma = self._params["exact_sigma"]
              mu = 1.0
          mm_exp = self._kernel_layer(mu, sigma)(mm)
          mm_doc_sum = keras.layers.Lambda(
              lambda x: tf.reduce_sum(x, 2)
          )(mm_exp)
          mm_log = keras.layers.Activation(tf.math.log1p)(mm_doc_sum)
          mm_sum = keras.layers.Lambda(lambda x: tf.reduce_sum(x, 1))(
              mm_log
          )
          KM.append(mm_sum)
  
      phi = keras.layers.Lambda(lambda x: tf.stack(x, 1))(KM)
      out = self._make_output_layer()(phi)
      self._backend = keras.Model(inputs=[query, doc], outputs=[out])
  
file_path: MatchZoo/matchzoo/models/knrm.py
imports: import keras
  import tensorflow
  from matchzoo.engine.base_model import BaseModel
  from matchzoo.engine.param import Param
  from matchzoo.engine import hyper_spaces
label_desc: Use image node_id 2 for calling the KNRM obj's underlying member method code with example usage: obj.build() without return types