class_docstr: Match texts model with Match Pyramid.
class_docstr_tok: ["Match","texts","model","with","Match","Pyramid","."]
code: def __init__(self, config, **kwargs):
      super().__init__(config, **kwargs)
      logging.info("Initialize MatchPyramidTextClassModel ...")
  
      self.vocab_size = config["data"]["vocab_size"]
      self.num_classes = config["data"]["task"]["classes"][
          "num_classes"
      ]
      self.max_seq_len = config["data"]["task"]["max_seq_len"]
      model_config = config["model"]["net"]["structure"]
      self.dropout_rate = model_config["dropout_rate"]
      self.embedding_size = model_config["embedding_size"]
      self.emb_trainable = model_config["emb_trainable"]
      self.lstm_num_units = model_config["lstm_num_units"]
      self.fc_num_units = model_config["fc_num_units"]
      self.l2_reg_lambda = model_config["l2_reg_lambda"]
  
      # Number of convolution blocks
      self.num_blocks = model_config["num_blocks"]
      # The kernel count of the 2D convolution
      self.kernel_count = model_config["kernel_count"]
      # The kernel size of the 2D convolution of each block
      self.kernel_size = model_config["kernel_size"]
      # The max-pooling size of each block
      self.dpool_size = model_config["dpool_size"]
      # The padding mode in the convolution layer
      self.padding = model_config["padding"]
      # The activation function
      self.activation = model_config["activation"]
      self.matching_type = model_config["matching_type"]
  
      self.embed = tf.keras.layers.Embedding(
          self.vocab_size,
          self.embedding_size,
          trainable=self.emb_trainable,
          name="embdding",
          embeddings_initializer=self.embed_initializer,
      )
  
      self.embed_d = tf.keras.layers.Dropout(self.dropout_rate)
  
      self.matching_layer = MatchingLayer(
          matching_type=self.matching_type
      )
  
      self.conv = []
      for i in range(self.num_blocks):
          conv = tf.keras.layers.Conv2D(
              self.kernel_count,
              self.kernel_size,
              padding=self.padding,
              activation=self.activation,
          )
          self.conv.append(conv)
  
      self.dpool = DynamicPoolingLayer(*self.dpool_size)
  
      self.flatten = tf.keras.layers.Flatten()
  
      self.dropout = tf.keras.layers.Dropout(rate=self.dropout_rate)
      self.outlayer = tf.keras.layers.Dense(
          self.fc_num_units, activation="tanh"
      )
      self.tasktype = config["data"]["task"]["type"]
      # if self.tasktype == "Classification":
      self.final_dense = tf.keras.layers.Dense(
          self.num_classes,
          activation=tf.keras.activations.linear,
          name="final_dense",
      )
  
      logging.info("Initialize MatchPyramidTextClassModel done.")
  
file_path: delta/delta/models/text_match_model.py
imports: import pickle
  from absl import logging
  import delta.compat
  from delta.layers.dynamic_pooling import DynamicPoolingLayer
  from delta.layers.match_pyramid import MatchingLayer
  from delta.models.base_model import Model
  from delta.utils.register import registers
label_desc: Use image node_id 1 to create a new MatchPyramidTextClassModel object from inherited base classes: MatchRnn with example: obj = MatchPyramidTextClassModel(config)