nlgm.manifolds Module#
- class nlgm.manifolds.BasicManifold(dimension: int, curvature: float, base_point: Tensor = None)[source]#
Base manifold class with shared geometry attributes.
- Parameters:
- dimensionint
Dimension of the manifold.
- curvaturefloat
Scalar curvature of the manifold.
- base_pointtorch.Tensor, optional
Origin point of the tangent space. If omitted, a zero vector of length
dimensionis used.
Methods
distance(point_x, point_y)Compute geodesic distance between two points on the manifold.
exponential_map(tangent_vector)Map a tangent-space vector onto the manifold.
- class nlgm.manifolds.EuclideanManifold(dimension: int, curvature: float, base_point: Tensor = None)[source]#
Methods
distance(point_x, point_y)Compute Euclidean distance between two points.
exponential_map(tangent_vector)Map a tangent vector in Euclidean space.
- class nlgm.manifolds.HyperbolicManifold(dimension: int, curvature: float, base_point: Tensor = None)[source]#
Methods
distance(point_x, point_y)Compute hyperbolic geodesic distance between two points.
exponential_map(tangent_vector)Map a tangent vector onto a hyperbolic manifold.
- class nlgm.manifolds.ProductManifold(curvatures: List[float])[source]#
Product manifold assembled from fixed-size component manifolds.
- Parameters:
- curvatureslist[float]
Curvatures for each component manifold.
Methods
distance(point_x, point_y)Compute product-manifold distance between two points.
exponential_map(latent_vector)Apply per-component exponential maps and concatenate the result.
Notes
Each component manifold is assumed to have dimension 2.
- distance(point_x: Tensor, point_y: Tensor) Tensor[source]#
Compute product-manifold distance between two points.
- Parameters:
- point_xtorch.Tensor
First point in product-manifold coordinates.
- point_ytorch.Tensor
Second point in product-manifold coordinates.
- Returns:
- torch.Tensor
Distance between
point_xandpoint_y.
- exponential_map(latent_vector: Tensor) Tensor[source]#
Apply per-component exponential maps and concatenate the result.
- Parameters:
- latent_vectortorch.Tensor
Latent vector in Euclidean space. Its last dimension should match the sum of component manifold dimensions.
- Returns:
- torch.Tensor
Projection of
latent_vectorinto the product manifold space.
- class nlgm.manifolds.SphericalManifold(dimension: int, curvature: float, base_point: Tensor = None)[source]#
Methods
distance(point_x, point_y)Compute spherical geodesic distance between two points.
exponential_map(tangent_vector)Map a tangent vector onto a spherical manifold.