06 Kernel-based active subspaces

In order to extend the methodology to cases which don't have an Active Subspace, we can consider searching for a kernel-based Active Subspace.

As is common practice in Machine Learning to project the inputs from $\chi\subset\mathbb{R}^{m}$ to a Reproducing Kernel Hilbert Space (RKHS), the inputs are immersed with a feature space map $\phi$ into a supposedly infinite-dimensional Hilbert space $\phi(\chi)\subset\mathbb{H}$. Then the model function of interest factorizes over this feature map $\phi$ and a new model function $\bar{f}$ with domain the feature space

$$ f:\chi\subset\mathbb{R}^{m}\rightarrow\mathbb{R},\quad \phi:\chi\subset\mathbb{R}^{m}\rightarrow\mathbb{H}\approx\mathbb{R}^{D},\quad\bar{f}:\phi(\chi)\subset\mathbb{H}\rightarrow\mathbb{R}\\ $$$$ f = \bar{f}\circ\phi $$

the RKHS $\mathbb{H}$ is approximated with a discrete feature space $\mathbb{R}^{D}$.

Searching for a kernel-based Active Subspace then reduces to finding an Active Subspace of the new model function $\bar{f}:\chi\subset\mathbb{H}\rightarrow\mathbb{R}$. In this tutorial we will consider the design of one-dimensional response functions with Gaussian process regression. A scheme of the procedure is shown below

To look more in to the details of the procedure see Kernel-based Active Subspaces with application to CFD parametric problems using Discontinuous Galerkin method. The feature map we adopt was introduced in Gaussian Process Modeling and Supervised Dimensionality Reduction Algorithms via Stiefel Manifold Learning.

Some samples (xx, f, df) will be used for the tuning phase of the kernel-based active subspaces proceure, the remaining (y, t, dt) represents the test dataset.

Active subspaces

An active subspace is searched for, but due to the radial symmetry of the model there is no preferred direction of variation. The same result could be obtained changing the generatrix of the model. These are cases where linear active subspaces are not present and other methods should be taken in consideration.

Kernel-based active subspaces

Define the feature map and pass it to the KernelActiveSubspaces class. The feature map is defined as

$$ \phi(\mathbf{x})=\sqrt{\frac{2}{D}}\,\sigma_f\,\cos(W\mathbf{x}+\mathbf{b}),\\ \cos(W\mathbf{x}+\mathbf{b}):=\frac{1}{\sqrt{D}}(\cos(W[1, :] \cdot \mathbf{x} +b_1),\dots, \cos(W[D, :] \cdot \mathbf{x} +b_D))^T $$

where $\sigma_f$ cooresponds to the empirical variance of the model, $W\in \mathcal{M}(D\times m,\mathbb{R})$ is the projection matrix whose rows are sampled from a probability distribution on $\mathbb{R}^m$ and $\mathbf{b}\in \mathbb{R}^D$ is a bias term whose components are sampled independently and uniformly in the interval $[0, 2\pi]$.

The list of implemented distributions to chose from is the following, the number of parameters to tune for each distribution is reported in the documentation.

The feature map hyperparameters are to be tuned. Different methods are available, see the documentation. In this tutorial we will use Bayesian stochastic optimization.