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

Irregular Sampling #15

Open
vincehass opened this issue May 13, 2023 · 2 comments
Open

Irregular Sampling #15

vincehass opened this issue May 13, 2023 · 2 comments

Comments

@vincehass
Copy link

Hello in the previous @aldro61 talk given at MS Montreal office, we have discussed the irregular sampling code portion, is it possible for you to added to the repo, I found it very interesting.
Thank you!

@aldro61
Copy link
Collaborator

aldro61 commented May 25, 2023

Hello @vincehass, thanks for your interest! I will get back to you with more details next week.

@aldro61
Copy link
Collaborator

aldro61 commented Jun 1, 2023

Hello again,

@vincehass, here's an update about this. The code was significantly refactored since the submission to arrive to this "cleaner implementation" of TACTiS. The implementation for the unaligned time series and irregular sampling is only available in the previous version of the code, which is not compatible with the current one.

If you'd like to implement it, here's what would need to be changed:

  • The TemporalEncoder class (see here) is based on the Temporal Transformer architecture of Tashiro et al. (2021). In the code, you can see that it alternates between doing self-attention over the series and the time steps, which only works for aligned time series. If you'd like to make a version of TACTiS that supports unaligned series, you should replace this with a regular Transformer and pass it as argument to the TACTiS class's constructor. This will come at the cost of reduced scalability.
  • Data Loader: The positional encoding class that is used by TACTiS assumes that the timesteps are integers. The dataloader attributes those integers to each time step (see here). This would need to be adapted so that these integers account for all time steps, even those that are not observed in a given time series. For example, let's say that series 1 has observations at the following timestamps: 1pm, 2pm, 4pm, but series 2 has observations at: 1pm, 3pm, 4pm, the integers for each of those time stamps should be 1pm (0), 2pm (1), 3pm (2), 4pm (3). Then, you could assign integer time stamps to each time step of each series, obtaining a 2D array of time stamps. The TACTiS code would then be able to process this without problems (see here).

Given these two modifications, you would obtain a version of TACTiS that works with unaligned and non-uniformely sampled time series. If you would like to implement this, we would be happy to guide you and receive your contribution via a pull request!

Let me know if you'd like additional details.

Alex

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

No branches or pull requests

2 participants