GRF_KL#
- class pinnx.fnspace.GRF_KL(T=1, kernel='RBF', length_scale=1, num_eig=10, N=100, interp='cubic')[source]#
Gaussian random field (Gaussian process) in 1D.
The random sampling algorithm is based on truncated Karhunen-Loeve (KL) expansion.
- Parameters:
T (
float) – T > 0. The domain is [0, T].kernel (
str) – The kernel function. “RBF” (radial-basis function) or “AE” (absolute exponential).length_scale (
float) – The length scale of the kernel.num_eig (
int) – The number of eigenfunctions in KL expansion to be kept.N (
int) – Each eigenfunction is discretized at N points in [0, T].interp (
str) – The interpolation to interpolate the random function. “linear”, “quadratic”, or “cubic”.
- eval_batch(features, xs)[source]#
Evaluate a list of functions at a list of points.
- Parameters:
features – A NumPy array of shape (n_functions, n_features). A list of the feature vectors of the functions to be evaluated.
xs – A NumPy array of shape (n_points, dim). A list of points to be evaluated.
- Returns:
A NumPy array of shape (n_functions, n_points). The values of different functions at different points.