class_docstr: Apply a self-attention layer and a semantic composite fuse gate
  to compute the encoding result of one tensor.
  
  :param initial_keep_rate: the initial_keep_rate parameter of
      DecayingDropoutLayer.
  :param decay_interval: the decay_interval parameter of
      DecayingDropoutLayer.
  :param decay_rate: the decay_rate parameter of DecayingDropoutLayer.
  :param kwargs: standard layer keyword arguments.
  
  Example:
      >>> import matchzoo as mz
      >>> layer = mz.contrib.layers.EncodingLayer(1.0, 10000, 0.977)
      >>> num_batch, left_len, num_dim = 5, 32, 10
      >>> layer.build([num_batch, left_len, num_dim])
docstr: The computation logic of EncodingLayer.
  
  :param inputs: an input tensor.
code: def call(self, inputs, **kwargs):
      """
      The computation logic of EncodingLayer.
  
      :param inputs: an input tensor.
      """
      # Scalar dimensions referenced here:
      #   b = batch size
      #   p = inputs.shape()[1]
      #   d = inputs.shape()[2]
  
      # The input shape is [b, p, d]
      # shape = [b, 1, p, d]
      x = tf.expand_dims(inputs, 1) * 0
      # shape = [b, 1, d, p]
      x = tf.transpose(x, (0, 1, 3, 2))
      # shape = [b, p, d, p]
      mid = x + tf.expand_dims(inputs, -1)
      # shape = [b, p, d, p]
      up = tf.transpose(mid, (0, 3, 2, 1))
      # shape = [b, p, 3d, p]
      inputs_concat = tf.concat([up, mid, up * mid], axis=2)
  
      # Self-attention layer.
      # shape = [b, p, p]
      A = K.dot(self._w_itr_att, inputs_concat)
      # shape = [b, p, p]
      SA = tf.nn.softmax(A, axis=2)
      # shape = [b, p, d]
      itr_attn = K.batch_dot(SA, inputs)
  
      # Semantic composite fuse gate.
      # shape = [b, p, 2d]
      inputs_attn_concat = tf.concat([inputs, itr_attn], axis=2)
      concat_dropout = DecayingDropoutLayer(
          initial_keep_rate=self._initial_keep_rate,
          decay_interval=self._decay_interval,
          decay_rate=self._decay_rate,
      )(inputs_attn_concat)
      # shape = [b, p, d]
      z = tf.tanh(K.dot(concat_dropout, self._w1) + self._b1)
      # shape = [b, p, d]
      r = tf.sigmoid(K.dot(concat_dropout, self._w2) + self._b2)
      # shape = [b, p, d]
      f = tf.sigmoid(K.dot(concat_dropout, self._w3) + self._b3)
      # shape = [b, p, d]
      encoding = r * inputs + f * z
  
      return encoding
  
file_path: MatchZoo/matchzoo/contrib/layers/semantic_composite_layer.py
imports: import tensorflow
  from keras import backend
  from keras.engine import Layer
  from matchzoo.contrib.layers import DecayingDropoutLayer
label_desc: Use image node_id 3 for calling the EncodingLayer obj's underlying member method code with example usage: obj.call(inputs) and returns: encoding