secondmind-labs / GPflux

Deep GPs built on top of TensorFlow/Keras and GPflow
https://secondmind-labs.github.io/GPflux/
Apache License 2.0
120 stars 24 forks source link

Quadrature Fourier features #56

Closed ltiao closed 2 years ago

ltiao commented 2 years ago

Significant refactoring and introduction of class hierarchies and abstract bases classes to better support the implementation of quadrature Fourier features (QFFs) and the different variants of random Fourier features (RFFs) with minimal code repetition.

Noteworthy changes

  1. Instead of directly specifying the output_dim, the user now supplies the number of samples drawn from the kernel's spectral density in the case of RFFs or the number of quadrature points to utilize in the case of QFFs. The effective output dimensions for all the supported types of basis functions are:
    • RandomFourierFeaturesCosine: output_dim = n_components
    • RandomFourierFeatures: output_dim = 2 * n_components
    • QuadratureFourierFeatures: output_dim = 2 * n_components**input_dim
  2. The notebooks depending on random Fourier features have been updated to use RandomFourierFeaturesCosine for now to keep the necessary set of changes minimal (to use RandomFourierFeatures in these notebooks, we are required to update various parts of the notebook to reflect the fact that the output_dim is now different.)