gpflow.quadrature.gauss_hermite¶
gpflow.quadrature.gauss_hermite.gh_points_and_weights¶
- gpflow.quadrature.gauss_hermite.gh_points_and_weights(n_gh)[source]¶
Given the number of Gauss-Hermite points n_gh, returns the points z and the weights dz to perform the following uni-dimensional gaussian quadrature:
X ~ N(mean, stddev²) E[f(X)] = ∫ f(x) p(x) dx = sum_{i=1}^{n_gh} f(mean + stddev*z_i) dz_i
- Parameters
n_gh (
int
) – Number of Gauss-Hermite points- Return type
Tuple
[Tensor
,Tensor
]- Returns
Points z and weights dz, both tensors with shape [n_gh], to compute uni-dimensional gaussian expectation
gpflow.quadrature.gauss_hermite.list_to_flat_grid¶
- gpflow.quadrature.gauss_hermite.list_to_flat_grid(xs)[source]¶
- Parameters
xs (
List
[Union
[ndarray
,Tensor
,Variable
,Parameter
]]) – List with d rank-1 Tensors, with shapes N1, N2, …, Nd- Return type
Tensor
- Returns
Tensor with shape [N1*N2*…*Nd, d] representing the flattened d-dimensional grid built from the input tensors xs
gpflow.quadrature.gauss_hermite.ndgh_points_and_weights¶
- gpflow.quadrature.gauss_hermite.ndgh_points_and_weights(dim, n_gh)[source]¶
- Parameters
dim (
int
) – dimension of the multivariate normaln_gh (
int
) – number of Gauss-Hermite points per dimension
- Return type
Tensor
- Returns
points Z, Tensor with shape [n_gh**dim, dim], and weights dZ, Tensor with shape [n_gh**dim, 1]