ott.geometry.costs.SoftDTW.twist_operator

ott.geometry.costs.SoftDTW.twist_operator#

SoftDTW.twist_operator(vec, dual_vec, variable)#

Twist inverse operator of the cost function.

Given a cost function \(c\), the twist operator returns \(\nabla_{1}c(x, \cdot)^{-1}(z)\) if variable is 0, and \(\nabla_{2}c(\cdot, y)^{-1}(z)\) if variable is 1, for \(x=y\) equal to vec and \(z\) equal to dual_vec.

Parameters:
  • vec (Array) – [p,] point at which the twist inverse operator is evaluated.

  • dual_vec (Array) – [q,] point to invert by the operator.

  • variable (bool) – apply twist inverse operator on first (i.e. value set to 0 or equivalently False) or second (1 or True) variable.

Return type:

Array

Returns:

A vector.