JAX-native Riemannian manifold optimization
Project description
RiemannAX
Hardware-accelerated Riemannian Manifold Optimization with JAX
Overview
RiemannAX is a library for optimization on Riemannian manifolds using JAX.
It provides implementations of various Riemannian manifolds and optimization algorithms
that leverage JAX's automatic differentiation and GPU acceleration capabilities.
Features
-
Manifold implementations with differential geometric operations:
- Sphere (S^n)
- Special Orthogonal Group (SO(n))
- More manifolds coming soon!
-
Optimization algorithms:
- Riemannian Gradient Descent (RGD)
- More algorithms coming soon!
-
Problem solving framework:
- Automatic differentiation for computing Riemannian gradients
- Support for custom gradient functions
- Flexible solver configuration
Installation
pip install riemannax
For development installation:
git clone https://github.com/riemannax/riemannax.git
cd riemannax
pip install -e ".[dev]"
Usage Example
import jax
import jax.numpy as jnp
import riemannax as rx
# 1. Define a manifold
sphere = rx.Sphere()
# 2. Define an optimization problem
def cost_fn(x):
target = jnp.array([0., 0., 1.]) # North pole
return -jnp.dot(x, target) # Find the point closest to the north pole
problem = rx.RiemannianProblem(sphere, cost_fn)
# 3. Set the initial point
key = jax.random.PRNGKey(0)
x0 = sphere.random_point(key)
# 4. Solve the problem
result = rx.minimize(
problem,
x0,
method='rsgd',
options={'learning_rate': 0.1, 'max_iterations': 100}
)
print("Optimal point:", result.x)
print("Cost function value:", result.fun)
Testing
To run the test suite:
make test
Or with coverage:
make coverage
License
This project is licensed under the Apache License 2.0 - see the LICENSE file for details.
Acknowledgements
RiemannAX is inspired by the design principles of JAX and Optax, as well as other Riemannian optimization libraries like Pymanopt and Geoopt.
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file riemannax-0.0.1.tar.gz.
File metadata
- Download URL: riemannax-0.0.1.tar.gz
- Upload date:
- Size: 17.8 kB
- Tags: Source
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.12.9
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
d2bc23413f9a6a823a7f465e405bfc37b5016f17ee76cf4a85679591afcb4a05
|
|
| MD5 |
dde253c24f18bb328cce62ae1bfe64bb
|
|
| BLAKE2b-256 |
dcb67e31759f9b9fa92999e96c6ff7708e5bd0ca69174e9ac2a81ad8eedbc0d9
|
Provenance
The following attestation bundles were made for riemannax-0.0.1.tar.gz:
Publisher:
release.yml on lv416e/riemannax
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
riemannax-0.0.1.tar.gz -
Subject digest:
d2bc23413f9a6a823a7f465e405bfc37b5016f17ee76cf4a85679591afcb4a05 - Sigstore transparency entry: 195109219
- Sigstore integration time:
-
Permalink:
lv416e/riemannax@67a9c620f53670276c5e4cbaa747652698cb4d05 -
Branch / Tag:
refs/tags/v0.0.1 - Owner: https://github.com/lv416e
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
release.yml@67a9c620f53670276c5e4cbaa747652698cb4d05 -
Trigger Event:
push
-
Statement type:
File details
Details for the file riemannax-0.0.1-py3-none-any.whl.
File metadata
- Download URL: riemannax-0.0.1-py3-none-any.whl
- Upload date:
- Size: 19.2 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.12.9
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
30cdc62628d18898ef6bcc5f7fff7fdd97dcacf9a118db305c86dc13aa7c5826
|
|
| MD5 |
6e3e78a7c79c7fd622f17c97583709d5
|
|
| BLAKE2b-256 |
84f50b49252ba0a6ecc4b8b38f82142fa5196507847ab51ffe841828af2ca809
|
Provenance
The following attestation bundles were made for riemannax-0.0.1-py3-none-any.whl:
Publisher:
release.yml on lv416e/riemannax
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
riemannax-0.0.1-py3-none-any.whl -
Subject digest:
30cdc62628d18898ef6bcc5f7fff7fdd97dcacf9a118db305c86dc13aa7c5826 - Sigstore transparency entry: 195109223
- Sigstore integration time:
-
Permalink:
lv416e/riemannax@67a9c620f53670276c5e4cbaa747652698cb4d05 -
Branch / Tag:
refs/tags/v0.0.1 - Owner: https://github.com/lv416e
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
release.yml@67a9c620f53670276c5e4cbaa747652698cb4d05 -
Trigger Event:
push
-
Statement type: