(self, inputs)
| 40 | self.layer_norm = LayerNormalization(d_model) |
| 41 | |
| 42 | def forward(self, inputs): |
| 43 | # inputs: [b_size x len_q x d_model] |
| 44 | residual = inputs |
| 45 | output = self.relu(self.conv1(inputs.transpose(1, 2))) |
| 46 | |
| 47 | # outputs: [b_size x len_q x d_model] |
| 48 | output = self.conv2(output).transpose(1, 2) |
| 49 | output = self.dropout(output) |
| 50 | |
| 51 | return self.layer_norm(residual + output) |
| 52 | |
| 53 | class MultiHeadAttention(nn.Module): |
| 54 | def __init__(self, d_k, d_v, n_heads, dropout, d_model, visual_len, sen_len, fea_v, fea_s, pos): |
nothing calls this directly
no outgoing calls
no test coverage detected