(self, d_model, dim_feedforward=2048, dropout=0.0,
activation="relu", normalize_before=False)
| 132 | class FFNLayer(nn.Module): |
| 133 | |
| 134 | def __init__(self, d_model, dim_feedforward=2048, dropout=0.0, |
| 135 | activation="relu", normalize_before=False): |
| 136 | super().__init__() |
| 137 | # Implementation of Feedforward model |
| 138 | self.linear1 = nn.Linear(d_model, dim_feedforward) |
| 139 | self.dropout = nn.Dropout(dropout) |
| 140 | self.linear2 = nn.Linear(dim_feedforward, d_model) |
| 141 | |
| 142 | self.norm = nn.LayerNorm(d_model) |
| 143 | |
| 144 | self.activation = _get_activation_fn(activation) |
| 145 | self.normalize_before = normalize_before |
| 146 | |
| 147 | self._reset_parameters() |
| 148 | |
| 149 | def _reset_parameters(self): |
| 150 | for p in self.parameters(): |
nothing calls this directly
no test coverage detected