function

transport.samples.kernels.streaming_sqeuclid.shifted_to_standard_potentials

def shifted_to_standard_potentials(f_hat: torch.Tensor, g_hat: torch.Tensor, alpha: torch.Tensor, beta: torch.Tensor) -> tuple[torch.Tensor, torch.Tensor]

Convert shifted potentials back to standard form.

Args: f_hat: Shifted source potential [n] g_hat: Shifted target potential [m] alpha: Source squared norms [n] = cost_scale * ||x||² beta: Target squared norms [m] = cost_scale * ||y||² Returns: f: Standard source potential [n] = f_hat + alpha g: Standard target potential [m] = g_hat + beta

Source: torchmatch/transport/samples/kernels/streaming_sqeuclid.py:1511