(self, d_in, d_hid, dropout=0.1)
| 6 | |
| 7 | class PositionwiseFeedForward(nn.Module): |
| 8 | def __init__(self, d_in, d_hid, dropout=0.1): |
| 9 | super().__init__() |
| 10 | self.w_1 = nn.Conv1d(d_in, d_hid, 1) |
| 11 | self.w_2 = nn.Conv1d(d_hid, d_in, 1) |
| 12 | self.layer_norm = nn.LayerNorm(d_in) |
| 13 | self.dropout = nn.Dropout(dropout) |
| 14 | |
| 15 | def forward(self, x): |
| 16 | residual = x |