class_docstr: Multi-Head Attention
class_docstr_tok: ["Multi-Head","Attention"]
code: def __init__(
      self, d_key, d_value, d_model, n_head=1, dropout_rate=0.0
  ):
      super(MultiHeadAttention, self).__init__()
      self.n_head = n_head
      self.d_key = d_key
      self.d_value = d_value
      self.d_model = d_model
      self.dropout_rate = dropout_rate
      self.q_fc = paddle.nn.Linear(
          in_features=d_model,
          out_features=d_key * n_head,
          bias_attr=False,
      )
      self.k_fc = paddle.nn.Linear(
          in_features=d_model,
          out_features=d_key * n_head,
          bias_attr=False,
      )
      self.v_fc = paddle.nn.Linear(
          in_features=d_model,
          out_features=d_value * n_head,
          bias_attr=False,
      )
      self.proj_fc = paddle.nn.Linear(
          in_features=d_value * n_head,
          out_features=d_model,
          bias_attr=False,
      )
  
imports: from __future__ import absolute_import
  from __future__ import division
  from __future__ import print_function
  import math
  import paddle
  from paddle import ParamAttr, nn
  from paddle import nn, ParamAttr
  from paddle.nn import functional
  import numpy
label_desc: Use image node_id 1 to create a new MultiHeadAttention object from inherited base classes: nn with example: obj = MultiHeadAttention(d_key, d_value, d_model, n_head, dropout_rate)