-
Notifications
You must be signed in to change notification settings - Fork 631
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
Tensor Dimension Error When Applying TFT to Multiple Groups in Own Data #85
Comments
After looking at the Stallion data, I presume there is no need to make sure all groups have the same length data, given the stallion data grouped by agency has counts such as
|
On the other hand, the data all has the same max time_idx:
|
Also odd because running with That's what makes me thing I'm doing something really subtle and stupid haha 😬 |
Ugh, when I add in all 50 states the model fails on the very first epoch with a very similar error as above:
New notebook for all 50 states: https://drive.google.com/file/d/1N2GBs8PDksE-dGSs31hMZZOZ8oAZZZGJ/view?usp=sharing |
I got past the "fail on epoch one" bit by setting
|
THAT SOLVED IT (at least I believe, as it worked for my example dataframe with a few states and the model with all 50 states is going past epoch 1)! 🎉 |
Update: the model finished training with all 50 states 🎉 That being said, I'm wondering if some kind of Please feel free to close this, @jdb78, pending your review. Hopefully this helps others who hit this problem or leads to a note being added to the docs about lowering |
Hm, this looks like a real bug to me - particularly because the issue seems to be in the interpretation. There is currently only an assert that will throw an error if no timeseries are left to work with. Another assert to alert already if one timeseries is removed would be useful though. |
Wow, really happy to hear that I wasn't just being a dunce, lol. Really appreciate that feedback! |
The issue seems to be stacking variable length tensors - surprised it did not come up earlier. Fixing in #108 now. Performance of the TFT is pretty bad in the notebook. Might have a look and see if can be fixed if I have time. |
Update: Easy fix: there were no covariates given including the target variable as an unknown time varying real variable. |
Hi @jdb78,
After getting the TFT model working well for one group of data based on our last convo (and updating to the latest version of the library), I'm getting an odd tensor dimension error when I try to train my model across multiple groups on my data. Specifically on epoch 15 I get this error/trace:
At first I thought this could be because not every state has the same amount of data available. For example, for select states, the number of days for which data exist are:
So I tried just getting the last 218 observations for each state and resetting time_idx, but the same tensor error was raised.
Right now I'm only including the state as a group variable and am doing univariate time series modeling, so no other data are in the TFT.
Also, the learning rate finder works, this is just the training that's failing. Really odd.
I've made my code available here: https://drive.google.com/file/d/1r1w2tHZJrr8iXVqw7U5_qL1x4iOUsauk/view?usp=sharing. The data I'm playing with are on COVID, and the notebook includes a pd.read_csv() call that read in all the data for you from an online source, so you should be able to run it on your own without any issues.
Any thoughts? Again, I greatly appreciate your feedback as I'm new to deep learning on time series data.
Thanks in advance!
Best,
Alex
The text was updated successfully, but these errors were encountered: