(self, d_model, patch_len, stride, dropout)
| 159 | |
| 160 | class PatchEmbedding(nn.Module): |
| 161 | def __init__(self, d_model, patch_len, stride, dropout): |
| 162 | super(PatchEmbedding, self).__init__() |
| 163 | # Patching |
| 164 | self.patch_len = patch_len |
| 165 | self.stride = stride |
| 166 | self.padding_patch_layer = ReplicationPad1d((0, stride)) |
| 167 | |
| 168 | # Backbone, Input encoding: projection of feature vectors onto a d-dim vector space |
| 169 | self.value_embedding = TokenEmbedding(patch_len, d_model) |
| 170 | |
| 171 | # Positional embedding |
| 172 | # self.position_embedding = PositionalEmbedding(d_model) |
| 173 | |
| 174 | # Residual dropout |
| 175 | self.dropout = nn.Dropout(dropout) |
| 176 | |
| 177 | def forward(self, x): |
| 178 | # do patching |
nothing calls this directly
no test coverage detected