| 157 | return self.dropout(x) |
| 158 | |
| 159 | class DataEmbedding_inverted(nn.Module): |
| 160 | def __init__(self, c_in, d_model, embed_type='fixed', freq='h', dropout=0.1): |
| 161 | super(DataEmbedding_inverted, self).__init__() |
| 162 | self.value_embedding = nn.Linear(c_in, d_model) |
| 163 | self.dropout = nn.Dropout(p=dropout) |
| 164 | |
| 165 | def forward(self, x, x_mark): |
| 166 | x = x.permute(0, 2, 1) |
| 167 | # x: [Batch Variate Time] |
| 168 | if x_mark is None: |
| 169 | x = self.value_embedding(x) |
| 170 | else: |
| 171 | x = self.value_embedding(torch.cat([x, x_mark.permute(0, 2, 1)], 1)) |
| 172 | # x: [Batch Variate d_model] |
| 173 | return self.dropout(x) |
| 174 | |
| 175 | |
| 176 | class DataEmbedding_wo_pos(nn.Module): |
nothing calls this directly
no outgoing calls
no test coverage detected