class_docstr: Multi Head Attention Layer.
  
  Args:
      n_units (int): Number of input units.
      h (int): Number of attention heads.
      dropout (float): Dropout rate.
      initialW: Initializer to initialize the weight.
      initial_bias: Initializer to initialize the bias.
  
  :param int h: the number of heads
  :param int n_units: the number of features
  :param float dropout_rate: dropout rate
docstr: Initialize MultiHeadAttention.
docstr_tok: ["Initialize","MultiHeadAttention","."]
code: def __init__(
      self, n_units, h=8, dropout=0.1, initialW=None, initial_bias=None
  ):
      """Initialize MultiHeadAttention."""
      super(MultiHeadAttention, self).__init__()
      assert n_units % h == 0
      stvd = 1.0 / np.sqrt(n_units)
      with self.init_scope():
          self.linear_q = L.Linear(
              n_units,
              n_units,
              initialW=initialW(scale=stvd),
              initial_bias=initial_bias(scale=stvd),
          )
          self.linear_k = L.Linear(
              n_units,
              n_units,
              initialW=initialW(scale=stvd),
              initial_bias=initial_bias(scale=stvd),
          )
          self.linear_v = L.Linear(
              n_units,
              n_units,
              initialW=initialW(scale=stvd),
              initial_bias=initial_bias(scale=stvd),
          )
          self.linear_out = L.Linear(
              n_units,
              n_units,
              initialW=initialW(scale=stvd),
              initial_bias=initial_bias(scale=stvd),
          )
      self.d_k = n_units // h
      self.h = h
      self.dropout = dropout
      self.attn = None
  
imports: import chainer
  import chainer.functions
  import chainer.links
  import numpy
label_desc: Use image node_id 1 to create a new MultiHeadAttention object from inherited base classes: chainer with example: obj = MultiHeadAttention(n_units, h, dropout, initialW, initial_bias)