Skip to content

Commit

Permalink
Restructure (#77)
Browse files Browse the repository at this point in the history
* remove t argument from everywhere

* update changelog

* update changelog

* update readme

* delete some shit

* start with polishing Base class

* make tests worling for R manifold

* sphere works

* refactor sphere to be with optional projector, and tests as well

* canonical stiefel

* euclidean stiefel

* add poincare with tests

* remove t from docs and readme

* reversibility check

* green tests

* working tests in docker

* test sensitive cases with float64

* special methods for tensor

* fix typo

* euclidean manifold is now really euclidean, CC @ndrizza

* euclidean manifold is now really euclidean, CC @ndrizza

* changelog

* run float 64 tests only

* float64 tests

* black

* fix typo in tests

* fix failing test

* remove underscore names

* add make tuple util

* black
  • Loading branch information
ferrine committed Jun 18, 2019
1 parent 589ccb0 commit 89df0b6
Show file tree
Hide file tree
Showing 24 changed files with 941 additions and 1,009 deletions.
1 change: 1 addition & 0 deletions CHANGELOG.rst
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@ geoopt v0.1.0 (unreleased)
Breaking Changes
----------------
* better public api, refactored developer api a lot (#40). See the corresponding PR for more details
* refactored internal design, caused another api change (#77)
* Removed ``t`` argument from everywhere (#76). The argument just scaled tangent vectors but
appeared to be very problematic in maintenance

Expand Down
4 changes: 2 additions & 2 deletions README.rst
Original file line number Diff line number Diff line change
Expand Up @@ -56,9 +56,9 @@ points on a certain manifold
projected, they are assumed to be already projected.
- ``.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, *more, u)`` – transport vector ``v`` (and possibly
- ``.transp(v, u, *more)`` – transport vector ``v`` (and possibly
more vectors) with direction ``u``
- ``.retr_transp(v, *more, u)`` – transport ``self``, vector ``v``
- ``.retr_transp(v, u, *more)`` – transport ``self``, vector ``v``
(and possibly more vectors) with direction ``u``
(returns are plain tensors)

Expand Down
6 changes: 0 additions & 6 deletions docs/devguide.rst
Original file line number Diff line number Diff line change
Expand Up @@ -10,9 +10,3 @@ The common base class for all manifolds is :class:`geoopt.manifolds.base.Manifol
:private-members:
:members:
:noindex:

Metaclass
---------

.. autoclass:: geoopt.manifolds.base.ManifoldMeta

1 change: 0 additions & 1 deletion docs/extended/poincare.rst
Original file line number Diff line number Diff line change
Expand Up @@ -114,4 +114,3 @@ Numerical stability is a pain in this model. It is strongly recommended to work
so expect adventures in ``float32`` (but this is not certain).

.. autofunction:: geoopt.manifolds.poincare.math.project
.. autofunction:: geoopt.manifolds.poincare.math.clip_tangent
6 changes: 2 additions & 4 deletions docs/manifolds.rst
Original file line number Diff line number Diff line change
Expand Up @@ -4,11 +4,9 @@ Manifolds
.. currentmodule:: geoopt.manifolds


All manifolds share same API. In order not to duplicate the same information, the complete public API is provided only for :class:`geoopt.manifolds.Manifold` in the end of this file.
All manifolds share same API. Some manifols may have several implementations of retraction operation, every implementation has a corresponding class.

.. automodule:: geoopt.manifolds
:members: Euclidean, Stiefel, Sphere, SphereSubspaceComplementIntersection, SphereSubspaceIntersection, PoincareBall
:members: Euclidean, Stiefel, CanonicalStiefel, EuclideanStiefel, EuclideanStiefelExact, Sphere, SphereExact, PoincareBall, PoincareBallExact

.. autoclass:: geoopt.manifolds.base.Manifold
:members:

8 changes: 6 additions & 2 deletions geoopt/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -7,11 +7,15 @@
from .tensor import ManifoldParameter, ManifoldTensor
from .manifolds import (
Stiefel,
EuclideanStiefelExact,
CanonicalStiefel,
EuclideanStiefel,
Euclidean,
R,
Sphere,
SphereSubspaceIntersection,
SphereSubspaceComplementIntersection,
SphereExact,
PoincareBall,
PoincareBallExact,
)

__version__ = "0.0.1"
12 changes: 4 additions & 8 deletions geoopt/manifolds/__init__.py
Original file line number Diff line number Diff line change
@@ -1,10 +1,6 @@
from .base import Manifold
from .euclidean import Euclidean
from .stiefel import Stiefel, EuclideanStiefel, CanonicalStiefel
from .sphere import (
Sphere,
SphereSubspaceComplementIntersection,
SphereSubspaceIntersection,
)
from .poincare import PoincareBall
from .euclidean import Euclidean, R
from .stiefel import Stiefel, EuclideanStiefel, CanonicalStiefel, EuclideanStiefelExact
from .sphere import Sphere, SphereExact
from .poincare import PoincareBall, PoincareBallExact
from . import poincare
Loading

0 comments on commit 89df0b6

Please sign in to comment.