Created
April 28, 2019 10:19
-
-
Save ChunML/1b327a54f0edacc65120056e6852e9b9 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# MIDDLE MULTIHEAD SUB LAYER | |
mid_sub_in = bot_sub_out | |
mid_sub_out = [] | |
for j in range(mid_sub_in.shape[1]): | |
attention = self.attention_mid[i]( | |
tf.expand_dims(mid_sub_in[:, j, :], axis=1), encoder_output) | |
mid_sub_out.append(attention) | |
mid_sub_out = tf.concat(mid_sub_out, axis=1) | |
mid_sub_out = mid_sub_out + mid_sub_in | |
mid_sub_out = self.attention_mid_norm[i](mid_sub_out) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment