Gpytorch: Document various ways GPs can be used in batch mode

Created on 26 Sep 2018  路  8Comments  路  Source: cornellius-gp/gpytorch

Batch mode (fitting and predicting) is currently a "hidden" feature as it's not very well documented and does not have a tutorial.

We should add documentation and also unit tests to make sure this works as expected (this was the cause for a lot of bugs in the past).

documentation unit tests

Most helpful comment

Thanks a lot for the comprehensive tests in your PR. We should probably make sure to write up some documentation about this - maybe even a little feature matrix showing which of the following can be combined, and what the expected train/test input dimensions and resulting output dimensions are:

  • batch training (shared hyperparameters)
  • batch training (separate hyperparameters)
  • batch evaluation (arbitrary input batch size)
  • single-task vs. multi-task
  • approximate GPs

All 8 comments

I guess this is particularly important for batch-training of GPs, b/c the standard pattern

loss = -mll(output, train_y)
loss.backward()

will fail.

If none of the hyperparameters are shared, then a straightforward way to do this is to use loss= -mll(output, train_y).sum(), but things get murkier if some parameters are shared across batches since the losses of the individual batches will not be independent w.r.t. to the model parameters.

This is related to #130

I'll work on an example notebook when I go through and fix all the other notebooks.

I'm also working on better batch mode tests r.n. as part of the batch mode PR

Thanks a lot for the comprehensive tests in your PR. We should probably make sure to write up some documentation about this - maybe even a little feature matrix showing which of the following can be combined, and what the expected train/test input dimensions and resulting output dimensions are:

  • batch training (shared hyperparameters)
  • batch training (separate hyperparameters)
  • batch evaluation (arbitrary input batch size)
  • single-task vs. multi-task
  • approximate GPs

I'll work on it!

Also problem with me. Hope this can be fixed. Thanks

There are now some docs about batch GPs: https://gpytorch.readthedocs.io/en/latest/batch_gps.html

Closing this for now, though I'm happy for any suggestions on how to improve the docs!

Was this page helpful?
0 / 5 - 0 ratings