gpflow.quadrature.gauss_hermite#

Functions#

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[Any, Any], 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 normal

  • n_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]

gpflow.quadrature.gauss_hermite.repeat_as_list#

gpflow.quadrature.gauss_hermite.repeat_as_list(x, n)[source]#
Parameters
  • x (Union[ndarray[Any, Any], Tensor, Variable, Parameter]) – Array/Tensor to be repeated

  • n (int) – Integer with the number of repetitions

Return type

Tensor

Returns

List of n repetitions of Tensor x

gpflow.quadrature.gauss_hermite.reshape_Z_dZ#

gpflow.quadrature.gauss_hermite.reshape_Z_dZ(zs, dzs)[source]#
Parameters
  • zs (List[Union[ndarray[Any, Any], Tensor, Variable, Parameter]]) – List with d rank-1 Tensors, with shapes N1, N2, …, Nd

  • dzs (List[Union[ndarray[Any, Any], Tensor, Variable, Parameter]]) – List with d rank-1 Tensors, with shapes N1, N2, …, Nd

Return type

Tensor

Returns

points Z, Tensor with shape [N1*N2*…*Nd, d], and weights dZ, Tensor with shape [N1*N2*…*Nd, 1]