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

Method forward

models/TimeMixer.py:513–527  ·  view source on GitHub ↗
(self, x_enc, x_mark_enc, x_dec, x_mark_dec, mask=None)

Source from the content-addressed store, hash-verified

511 return dec_out
512
513 def forward(self, x_enc, x_mark_enc, x_dec, x_mark_dec, mask=None):
514 if self.task_name == 'long_term_forecast' or self.task_name == 'short_term_forecast':
515 dec_out = self.forecast(x_enc, x_mark_enc, x_dec, x_mark_dec)
516 return dec_out
517 if self.task_name == 'imputation':
518 dec_out = self.imputation(x_enc, x_mark_enc, mask)
519 return dec_out # [B, L, D]
520 if self.task_name == 'anomaly_detection':
521 dec_out = self.anomaly_detection(x_enc)
522 return dec_out # [B, L, D]
523 if self.task_name == 'classification':
524 dec_out = self.classification(x_enc, x_mark_enc)
525 return dec_out # [B, N]
526 else:
527 raise ValueError('Other tasks implemented yet')

Callers

nothing calls this directly

Calls 4

forecastMethod · 0.95
imputationMethod · 0.95
anomaly_detectionMethod · 0.95
classificationMethod · 0.95

Tested by

no test coverage detected