gpflow.expectations.squared_exponentials#

Functions#

gpflow.expectations.squared_exponentials.square_distance#

gpflow.expectations.squared_exponentials.square_distance(X, X2)[source]#

Returns ||X - X2ᵀ||² Due to the implementation and floating-point imprecision, the result may actually be very slightly negative for entries very close to each other.

This function can deal with leading dimensions in X and X2. In the sample case, where X and X2 are both 2 dimensional, for example, X is [N, D] and X2 is [M, D], then a tensor of shape [N, M] is returned. If X is [N1, S1, D] and X2 is [N2, S2, D] then the output will be [N1, S1, N2, S2].

Parameters
  • X (Tensor) –

  • X2 (Optional[Tensor]) –

Return type

Tensor