cornellius-gp / gpytorch

A highly efficient implementation of Gaussian Processes in PyTorch
MIT License
3.58k stars 562 forks source link

Is it possible to use tensor inputs to predict multiple time series with deep GP? #1262

Closed ideasrule closed 4 years ago

ideasrule commented 4 years ago

I'm trying to use GPyTorch for COVID-19 prediction by training a deep GP. Let's say I'm trying to predict daily deaths in C counties for the next N days, and I have the following time series as predictors:

  1. The number of deaths per county per day
  2. The number of cases per county per day
  3. The day of the week

Is it possible to train a single deep GP (not one per county) to predict the number of deaths per day per county for the next N days, using the input data I mentioned? After reading through the docs and playing around with gpytorch, I can use it to predict one time series (i.e. the number of deaths per day in one county), but not multiple time series at once. If this is possible, how would I go about doing it?

Thanks for any help!

gpleiss commented 4 years ago

Hi @ideasrule - check out our multitask GP example. This learns a multi-output GP - where the output is N x C (N days \times C countries). The multitask GP learns correlations between the C output dimensions.

If you need to use approximate inference, you can also check out the docs for variational multitask GPs.

Hope this helps!

ideasrule commented 4 years ago

Hi @gpleiss,

Thanks for the prompt reply. I should have said that I want to use deep GP with gpytorch, not regular GP (I already got multitask GP working). I updated the question to reflect this. The reason is that I want a neural net to pick up on patterns between different counties that can't be specified by a single covariance kernel.

I was following this tutorial: https://docs.gpytorch.ai/en/v1.1.1/examples/05_Deep_Gaussian_Processes/Deep_Gaussian_Processes.html

but I can't find a way to adapt it to tensor inputs and vector outputs, so I was wondering whether such a thing is even possible under gpytorch.

Cheers,

ideasrule

gpleiss commented 4 years ago

Sorry - do you want to use a deep gaussian process or a neural net (i.e. deep kernel learning)?

ideasrule commented 4 years ago

I want to use a deep GP.

gpleiss commented 4 years ago

Currently we don't have an example notebook for this. We'll work on getting one up soon.

jacobrgardner commented 4 years ago

For vector outputs it should be as simple as having the last layers num_outputs be an integer >1 instead of None -- I guess we could also make an example notebook that correlates the outputs with LCM?

gpleiss commented 4 years ago

Closing this actually because it's as duplicate of #1240