Stiefel Manifold
\(\operatorname{St}(n,k)\) is the Stiefel manifold, that is, the rectangular matrices with orthonormal columns for \(n \geq k\):
If \(n < k\), then we consider the space of matrices with orthonormal rows, that is, \(X^\intercal \in \operatorname{St}(n,k)\).
- class geotorch.Stiefel(size, triv='expm')[source]
Manifold of rectangular orthogonal matrices parametrized as a projection onto the first \(k\) columns from the space of square orthogonal matrices \(\operatorname{SO}(n)\). The metric considered is the canonical.
- Parameters
size (torch.size) – Size of the tensor to be parametrized
triv (str or callable) – Optional. A map that maps skew-symmetric matrices onto the orthogonal matrices surjectively. It can be one of
["expm", "cayley"]
or a custom callable. Default:"expm"
- sample(distribution='uniform', init_=None)[source]
Returns a randomly sampled orthogonal matrix according to the specified
distribution
. The options are:"uniform"
: Samples a tensor distributed according to the Haar measure on \(\operatorname{SO}(n)\)"torus"
: Samples a block-diagonal skew-symmetric matrix. The blocks are of the form \(\begin{pmatrix} 0 & b \\ -b & 0\end{pmatrix}\) where \(b\) is distributed according toinit_
. This matrix will be then projected onto \(\operatorname{SO}(n)\) usingself.triv
- Parameters
distribution (string) – Optional. One of
["uniform", "torus"]
. Default:"uniform"
init_ (callable) – Optional. To be used with the
"torus"
option. A function that takes a tensor and fills it in place according to some distribution. See torch.init. Default: \(\operatorname{Uniform}(-\pi, \pi)\)