  Out-of-distribution (OOD) generalization has long been a challenging problem
that remains largely unsolved. Gaussian processes (GP), as popular
probabilistic model classes, especially in the small data regime, presume
strong OOD generalization abilities. Surprisingly, their OOD generalization
abilities have been under-explored before compared with other lines of GP
research. In this paper, we identify that GP is not free from the problem and
propose a domain invariant learning algorithm for Gaussian processes (DIL-GP)
with a min-max optimization on the likelihood. DIL-GP discovers the
heterogeneity in the data and forces invariance across partitioned subsets of
data. We further extend the DIL-GP to improve Bayesian optimization's
adaptability on changing environments. Numerical experiments demonstrate the
superiority of DIL-GP for predictions on several synthetic and real-world
datasets. We further demonstrate the effectiveness of the DIL-GP Bayesian
optimization method on a PID parameters tuning experiment for a quadrotor. The
full version and source code are available at:
https://github.com/Billzxl/DIL-GP.
