Skip to content

Instantly share code, notes, and snippets.

View rmsander's full-sized avatar

Ryan Sander rmsander

View GitHub Profile
class CompositeBatchedGP(ExactGP):
"""Class for creating batched Gaussian Process Regression models. Ideal candidate if
using GPU-based acceleration such as CUDA for training.
This kernel produces a composite kernel that multiplies actions times states,
i.e. we have a different kernel for both the actions and states. In turn,
the composite kernel is then multiplied by a Scale kernel.
Parameters:
train_x (torch.tensor): The training features used for Gaussian Process
@rmsander
rmsander / batchedgp.py
Last active January 25, 2021 15:58
Batched GP GPyTorch
class BatchedGP(ExactGP):
"""Class for creating batched Gaussian Process Regression models. Ideal candidate if
using GPU-based acceleration such as CUDA for training.
Parameters:
train_x (torch.tensor): The training features used for Gaussian Process
Regression. These features will take shape (B * YD, N, XD), where:
(i) B is the batch dimension - minibatch size
(ii) N is the number of data points per GPR - the neighbors considered
(iii) XD is the dimension of the features (d_state + d_action)