[ENH] Add LightTS model implementation (v2)#2135
[ENH] Add LightTS model implementation (v2)#2135Sylver-Icy wants to merge 14 commits intosktime:mainfrom
Conversation
Codecov Report❌ Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## main #2135 +/- ##
=======================================
Coverage ? 86.63%
=======================================
Files ? 169
Lines ? 9884
Branches ? 0
=======================================
Hits ? 8563
Misses ? 1321
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:
|
phoeenniixx
left a comment
There was a problem hiding this comment.
Thanks!
Please add docstrings to each class and atleast to all the public methods.
|
Thanks for the feedback! I’ll add docstrings And good point about |
|
@phoeenniixx I kept _IEBlock inside the lightts module for now since it’s currently a private helper used only by lightts. In this repo it looks like layers is mainly used for reusable/shared components across multiple models since no other model is using it yet, I thought keeping it local would keep things a bit simpler for now xd |
please move it to the layers folders, all layer modules are meant to be a part of it regardless of whether it is shared or not. |
phoeenniixx
left a comment
There was a problem hiding this comment.
Added some doubts and suggestions
| Reshape model output to match v2 prediction format. | ||
| """ | ||
| if self.n_quantiles is None: | ||
| return output |
There was a problem hiding this comment.
I have a doubt, if n_quantiles is 0 then what will be the shape here? I think for point prediction losses the shape should be (batch,time,1) - as much as I remember. @PranavBhatP please correct me if I am wrong here
There was a problem hiding this comment.
n_quantiles cannot actually be 0 in this implementation. It is either
None or
len(self.loss.quantiles) when using QuantileLoss
There was a problem hiding this comment.
I think for point prediction losses the shape should be (batch,time,1) - as much as I remember.
No, point prediction losses simply expect (batch_size, timesteps) - a 2d tensor.
There was a problem hiding this comment.
i meant the output format of the forward it was 3D no? When using a PP loss
Reference Issues/PRs
#2126
What does this implement?
This PR adds an implementation of the LightTS model for the PyTorch Forecasting v2 model framework.
Implemented the LightTS architecture based on the original paper.
The implementation follows the same design and integration patterns used by existing models such as DLinear.
Did you add any tests for the change?
Yes.
Added
tests/test_models/test_lightts_v2.pywhich includes tests for:Any other comments?
The implementation aims to stay consistent with existing v2 model implementations (e.g., DLinear) in structure and integration patterns.
Feedback on architectural alignment with the original LightTS design is welcome.