transport.samples.kernels.cg_dense.CachedDenseHVP.__init__
def __init__(self, x: torch.Tensor, y: torch.Tensor, f_hat: torch.Tensor, g_hat: torch.Tensor, eps: float, rho_x: float | None = None, rho_y: float | None = None, tau2: float = 1e-05, max_cg_iter: int = 100, cg_rtol: float = 1e-06, cg_atol: float = 1e-06)Initialize cached HVP context.
Parameters
| Name | Type | Description |
|---|---|---|
| x | torch.Tensor | Source points (n, d) |
| y | torch.Tensor | Target points (m, d) |
| f_hat | torch.Tensor | Source raw-form potential (n,) |
| g_hat | torch.Tensor | Target raw-form potential (m,) |
| eps | float | Entropy regularization |
| rho_x = None | float | None | Source marginal KL penalty (None = balanced) |
| rho_y = None | float | None | Target marginal KL penalty (None = balanced) |
| tau2 = 1e-05 | float | Tikhonov regularization |
| max_cg_iter = 100 | int | Maximum inner CG iterations |
| cg_rtol = 1e-06 | float | Relative CG tolerance |
| cg_atol = 1e-06 | float | Absolute CG tolerance |
Source: torchmatch/transport/samples/kernels/cg_dense.py:405