Manifold aware pytorch.optim
.
Unofficial implementation for "Riemannian Adaptive Optimization Methods" at ICLR2019 and more.
Guthub page: https://github.com/geoopt/geoopt
pip install git+https://github.com/geoopt/geoopt.git
pip install geopt
The preferred way to install geoopt will change once stable project stage is achieved. Now, pypi is behind master as we actively develop and implement new features.
Geoopt officially supports 2 latest stable versions of pytorch upstream or the latest major release.
Work is in progress but you can already use this. Note that API might change in future releases.
geoopt.ManifoldTensor
-- just as torch.Tensor with additional manifold
keyword argument.
geoopt.ManifoldParameter
-- same as above, recognized in torch.nn.Module.parameters as correctly subclassed.
All above containers have special methods to work with them as with points on a certain manifold
.proj_()
-- inplace projection on the manifold..proju(u)
-- project vector u
on the tangent space. You need to project all vectors for all methods below..egrad2rgrad(u)
-- project gradient u
on Riemannian manifold.inner(u, v=None)
-- inner product at this point for two tangent vectors at this point. The passed vectors are not.retr(u)
-- retraction map following vector u
.expmap(u)
-- exponential map following vector u
(if expmap is not available in closed form, best approximation is used).transp(v,u)
-- transport vector v
with direction u
.retr_transp(v,u)
-- transport self
, vector v
(and possibly more vectors) with direction u
(returns are plain tensors)geoopt.Euclidean
-- unconstrained manifold in R
with Euclidean metricgeoopt.Stiefel
-- Stiefel manifold on matrices A in R^{n x p} : A^t A=I, n >= p
geoopt.Sphere
-- Sphere manifold ||x||=1
geoopt.BirkhoffPolytope
-- manifold of Doubly Stochastic matricesgeoopt.Stereographic
-- Constant curvature stereographic projection modelgeoopt.SphereProjection
-- Sphere stereographic projection modelgeoopt.PoincareBall
-- Poincare ball modelgeoopt.Lorentz
-- Hyperboloid modelgeoopt.ProductManifold
-- Product manifold constructorgeoopt.Scaled
-- Scaled version of the manifold. Similar to Learning Mixed-Curvature Representations in Product Spaces if combined with ProductManifold
geoopt.SymmetricPositiveDefinite
-- SPD matrix manifoldgeoopt.UpperHalf
-- Siegel Upper half manifold. Supports Riemannian and Finsler metrics, as in Symmetric Spaces for Graph Embeddings: A Finsler-Riemannian Approachgeoopt.BoundedDomain
-- Siegel Bounded domain manifold. Supports Riemannian and Finsler metrics.All manifolds implement methods necessary to manipulate tensors on manifolds and tangent vectors to be used in general purpose. See more in `documentation`.
geoopt.optim.RiemannianSGD
-- a subclass of torch.optim.SGD
with the same API and a Sparse versiongeoopt.optim.RiemannianAdam
-- a subclass of torch.optim.Adam
and a Sparse versiongeoopt.samplers.RSGLD
-- Riemannian Stochastic Gradient Langevin Dynamicsgeoopt.samplers.RHMC
-- Riemannian Hamiltonian Monte-Carlogeoopt.samplers.SGRHMC
-- Stochastic Gradient Riemannian Hamiltonian Monte-CarloIf you find this project useful in your research, please kindly add this bibtex entry in references and cite.
@misc{geoopt2020kochurov,
title={Geoopt: Riemannian Optimization in PyTorch},
author={Max Kochurov and Rasul Karimov and Serge Kozlukov},
year={2020},
eprint={2005.02819},
archivePrefix={arXiv},
primaryClass={cs.CG}
}
Cookies help us deliver our services. By using our services, you agree to our use of cookies.