spd_learn.functional.transport_tangent_vector#
- spd_learn.functional.transport_tangent_vector(v, p, q, metric='airm', **kwargs)[source]#
Parallel transport of tangent vector with metric selection.
A convenience function that allows selecting the transport method via a string argument.
- Parameters:
v (torch.Tensor) – Tangent vector at p to be transported, shape (…, n, n).
p (torch.Tensor) – Source point on SPD manifold, shape (…, n, n).
q (torch.Tensor) – Target point on SPD manifold, shape (…, n, n).
metric (str, optional) – The Riemannian metric to use. Options are: - “airm”: Affine-Invariant Riemannian Metric (closed-form) - “lem” or “log_euclidean”: Log-Euclidean Metric (Frechet derivatives) - “log_cholesky”: Log-Cholesky Metric (Cholesky decomposition) - “schild”: Schild’s ladder approximation - “pole”: Pole ladder approximation Default is “airm”.
**kwargs (dict) – Additional keyword arguments passed to the transport function. For example, n_steps for schild_ladder.
- Returns:
Transported tangent vector at q, shape (…, n, n).
- Return type:
Examples
>>> import torch >>> from spd_learn.functional import transport_tangent_vector >>> n = 3 >>> A = torch.randn(n, n) >>> p = A @ A.T + torch.eye(n) >>> B = torch.randn(n, n) >>> q = B @ B.T + torch.eye(n) >>> v = torch.randn(n, n) >>> v = (v + v.T) / 2 >>> # Use different transport methods >>> v_airm = transport_tangent_vector(v, p, q, metric="airm") >>> v_lem = transport_tangent_vector(v, p, q, metric="lem") >>> v_schild = transport_tangent_vector(v, p, q, metric="schild", n_steps=10)
See also
parallel_transport_airm()Direct AIRM transport.
parallel_transport_lem()Direct LEM transport.
schild_ladder()Numerical Schild’s ladder.
pole_ladder()Numerical pole ladder.