Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

PatchTST: Add support for time features #3167

Merged
merged 7 commits into from
May 28, 2024

Conversation

rshyamsundar
Copy link
Contributor

Description of changes:
Adding support for including time features in the PachTST model. The original PatchTST paper does not talk about time-based features and there are several ways one could include them.

Here we go with this simple approach (and maintain the simplicity of the PatchTST model):

  • Similar to target time series, time series features, if provided, are converted to patches and appended to the target patches.
  • Since PatchTST is encoder only model, we combine past_time_feat and future_time_feat (this dichotomy is an artefact of gluonts) and (left) shift them by prediction_length so that the features are aligned with the target input.

Added tests for the PatchTSTEstimator with features enabled.

By submitting this pull request, I confirm that you can use, modify, copy, and redistribute this contribution, under the terms of your choice.

Please tag this pr with at least one of these labels to make our release process faster: BREAKING, new feature, bug fix, other change, dev setup

@rshyamsundar rshyamsundar requested a review from lostella May 6, 2024 06:11
@kashif
Copy link
Contributor

kashif commented May 6, 2024

@rshyamsundar the "lag-tst" model can also be tried as it allows one to take those features naturally

Copy link
Contributor

@melopeo melopeo left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@rshyamsundar rshyamsundar merged commit 0193ed7 into awslabs:dev May 28, 2024
20 checks passed
@rshyamsundar rshyamsundar deleted the patchTSTx branch May 28, 2024 11:16
kashif pushed a commit to kashif/gluon-ts that referenced this pull request Jun 15, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants