MCPcopy Create free account
hub / github.com/kwuking/TimeMixer / DataEmbedding_inverted

Class DataEmbedding_inverted

layers/Embed.py:159–173  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

157 return self.dropout(x)
158
159class 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
176class DataEmbedding_wo_pos(nn.Module):

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected