Sphere
\(\operatorname{Sphere}(n, r)\) is the sphere in \(\mathbb{R}^n\) with radius \(r\):
Warning
In mathematics, \(\mathbb{S}^n\) represents the \(n\)-dimensional sphere. With this notation, \(\operatorname{Sphere}(n, 1.) = \mathbb{S}^{n-1}\).
- class geotorch.Sphere(size, radius=1.0)[source]
Sphere as a map from the tangent space onto the sphere using the exponential map.
- Parameters
size (torch.size) – Size of the tensor to be parametrized
radius (float) – Optional. Radius of the sphere. A positive number. Default:
1.
- in_manifold(x, eps=1e-05)[source]
Checks that a vector is on the sphere.
For tensors with more than 2 dimensions the first dimensions are treated as batch dimensions.
- Parameters
X (torch.Tensor) – The vector to be checked.
eps (float) – Optional. Threshold at which the norm is considered to be equal to
1
. Default:1e-5
- class geotorch.SphereEmbedded(size, radius=1.0)[source]
Sphere as the orthogonal projection from \(\mathbb{R}^n\) to \(\mathbb{S}^{n-1}\), that is, \(x \mapsto \frac{x}{\lVert x \rVert}\).
- Parameters
size (torch.size) – Size of the tensor to be parametrized
radius (float) – Optional. Radius of the sphere. A positive number. Default:
1.
- in_manifold(x, eps=1e-05)[source]
Checks that a vector is on the sphere.
For tensors with more than 2 dimensions the first dimensions are treated as batch dimensions.
- Parameters
X (torch.Tensor) – The vector to be checked.
eps (float) – Optional. Threshold at which the norm is considered to be equal to
1
. Default:1e-5