leojklarner / gauche

A Library for Gaussian Processes in Chemistry
https://leojklarner.github.io/gauche/
MIT License
213 stars 22 forks source link

Add support for GPs with non-tensor inputs and 3rd party kernels #23

Closed InfProbSciX closed 2 years ago

InfProbSciX commented 2 years ago

This PR adds two classes SIGP (which is a subclass of ExactGP that avoids all data checks) and Inputs (a class with a data attribute that stores any form of input as a list).

I've not added a subclass of gpytorch's Kernel as it seems to do a lot of stuff that's irrelevant for non-tensor inputs (e.g. pairwise euclidean distance calculations, treating lengthscales for ARD, etc.). I'd recon that it's much easier to define kernels manually subclassing torch.nn.Module, and I've added such a class that just scales the kernel matrices.

The drawback of this custom kernel class is that it seems that botorch's automatic training function fails to discover all the kernel parameters (I'd argue this is a botorch bug / perhaps we're not subclassing appropriately for the autodiscovery).

The test files have examples of usage of these classes.