-
Notifications
You must be signed in to change notification settings - Fork 676
[ENH] Implementing TimeXer
model from thuml
#1797
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
base: main
Are you sure you want to change the base?
Conversation
Codecov ReportAttention: Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## main #1797 +/- ##
=======================================
Coverage ? 82.40%
=======================================
Files ? 49
Lines ? 5581
Branches ? 0
=======================================
Hits ? 4599
Misses ? 982
Partials ? 0
Flags with carried forward coverage won't be shown. Click here to find out more. ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
@fkiraly the implementation of |
FYI @agobbifbk, @benHeid |
A couple of comment:
|
Hi @agobbifbk thanks for the review!
Yes, I think I forgot to credit the original authors. Will do :).
I had similar questions with how this model would handle quantile predictions, the original architecture doesn't seem to be handling this, so I just decided to patch it up this line of code (which might be a bad approach). I am not very aware of what changes I should make to fix this? Could you help me here?
It is multi-output indeed, the _forecast_multi method is native to the |
Sure, usually it is sufficient to increase the number of output channels. Suppose the model ends with something in the shape My suggestion is to start from the implementation of the quantile loss and check the definition (in DSIPTS there is a multioutput version of it, just summing the contribution of each channel) and then play with the output shape of the model! Let me know if it is sufficient to finish the job :-) |
Thanks for the suggestion! I will try to make these changes. |
@agobbifbk , I've made changes to the output layer by adding the quantiles as a separate dimension in the |
Nice! enc_out = torch.reshape(
enc_out, (-1, n_vars, enc_out.shape[-2], enc_out.shape[-1])
) this code is hard to understand, I suggest to give some names to the variables (context_length?) so the next time anyone reads this will immediately understand the shapes of those tensors, what do you think? I still have a a doubt on the quantile loss, this is more a general PTF question. prediction = self.transform_output(
prediction=prediction, target_scale=x["target_scale"]
)
return self.to_network_output(prediction=prediction) Also in this case instead of using Wrapping up: clean a little bit the code, ensure the output is in a correct form, try to train the model and plot the outputs to see if it is giving correctly the confidence intervals. |
Description
This PR works on #1793 and aims to align and implement the
TimeXer
model within PTF's design. It is currently a draft.Checklist
pre-commit install
.To run hooks independent of commit, execute
pre-commit run --all-files
Make sure to have fun coding!