Natural gradient descent adapts each update to the geometry of the loss. In a variational Gaussian process, this matters because variational parameters describe probability distributions, while ordinary parameters occupy Euclidean space. section 12.3
Figure 12.14 An example of how the loss to be minimized might behave very differently with respect to a regular parameter and a variational parameter. This gives rise to the need to take into account the geometry of the loss.
A loss can respond very differently to changes in a regular parameter and a variational parameter; treating both as ordinary Euclidean coordinates can misrepresent the useful step. section 12.3
Mini-batch gradient descent can eventually reduce the ELBO loss, but natural gradient descent uses the variational geometry to reach an effective minimum in fewer iterations. It updates variational parameters, while mini-batch gradient descent updates regular parameters such as length and output scales. section 12.5 section 12.3
Figure 12.15 An illustration of gradient descent, mini-batch gradient descent, and natural gradient descent within a loss “valley,” where the center of the valley gives the lowest loss. By accounting for the geometry of the loss function, natural gradient descent reaches the loss minimum more quickly than mini-batch.
Within a narrow loss valley, geometry-aware steps reach the center faster than ordinary or mini-batch gradient steps. section 12.3
A practical GPyTorch training setup separates the two parameter groups:
- Construct the variational distribution with NaturalVariationalDistribution and place it in a VariationalStrategy. section 12.3
- Create an NGD optimizer for model.variational_parameters(), supplying the dataset size and learning rate. section 12.3
- Create an Adam optimizer for model and likelihood parameters, compute the negative VariationalELBO, backpropagate, and step both optimizers. section 12.3
- Switch the model and likelihood to evaluation mode after training. section 12.3
Housing-price variational Gaussian process
Build a variational Gaussian process with Matérn 5/2 covariance, ARD, 100 inducing points, and a likelihood whose noise is at least 0.1. Train it for 10 iterations with natural gradient descent and compare its duration with an ordinarily trained Gaussian process using batches of 100. section 12.4
