MCPcopy
hub / github.com/GPflow/GPflow / Matern52

Class Matern52

gpflow/kernels/stationaries.py:295–313  ·  view source on GitHub ↗

The Matern 5/2 kernel. Functions drawn from a GP with this kernel are twice differentiable. The kernel equation is k(r) = σ² (1 + √5r + 5/3r²) exp{-√5 r} where: r is the Euclidean distance between the input points, scaled by the lengthscales parameter ℓ, σ² is the varianc

Source from the content-addressed store, hash-verified

293
294
295class Matern52(IsotropicStationary):
296 """
297 The Matern 5/2 kernel. Functions drawn from a GP with this kernel are twice
298 differentiable. The kernel equation is
299
300 k(r) = σ² (1 + √5r + 5/3r²) exp{-√5 r}
301
302 where:
303 r is the Euclidean distance between the input points, scaled by the lengthscales parameter ℓ,
304 σ² is the variance parameter.
305 """
306
307 @check_shapes(
308 "r: [batch..., N]",
309 "return: [batch..., N]",
310 )
311 def K_r(self, r: TensorType) -> tf.Tensor:
312 sqrt5 = np.sqrt(5.0)
313 return self.variance * (1.0 + sqrt5 * r + 5.0 / 3.0 * tf.square(r)) * tf.exp(-sqrt5 * r)
314
315
316class Cosine(AnisotropicStationary):

Calls

no outgoing calls

Used in the wild real call sites across dependent graphs

searching dependent graphs…