Distance#

class tinygp.kernels.distance.Distance[source]#

Bases: Module

An abstract base class defining a distance metric interface

abstract distance(X1: tinygp.helpers.JAXArray, X2: tinygp.helpers.JAXArray) tinygp.helpers.JAXArray[source]#

Compute the distance between two coordinates under this metric

squared_distance(X1: tinygp.helpers.JAXArray, X2: tinygp.helpers.JAXArray) tinygp.helpers.JAXArray[source]#

Compute the squared distance between two coordinates

By default this returns the squared result of tinygp.kernels.stationary.Distance.distance(), but some metrics can take advantage of these separate implementations to avoid unnecessary square roots.