Skip to main content

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


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

riemannax-0.0.1.tar.gz (17.8 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

riemannax-0.0.1-py3-none-any.whl (19.2 kB view details)

Uploaded Python 3

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

Hashes for riemannax-0.0.1.tar.gz
Algorithm Hash digest
SHA256 d2bc23413f9a6a823a7f465e405bfc37b5016f17ee76cf4a85679591afcb4a05
MD5 dde253c24f18bb328cce62ae1bfe64bb
BLAKE2b-256 dcb67e31759f9b9fa92999e96c6ff7708e5bd0ca69174e9ac2a81ad8eedbc0d9

See more details on using hashes here.

Provenance

The following attestation bundles were made for riemannax-0.0.1.tar.gz:

Publisher: release.yml on lv416e/riemannax

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

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

Hashes for riemannax-0.0.1-py3-none-any.whl
Algorithm Hash digest
SHA256 30cdc62628d18898ef6bcc5f7fff7fdd97dcacf9a118db305c86dc13aa7c5826
MD5 6e3e78a7c79c7fd622f17c97583709d5
BLAKE2b-256 84f50b49252ba0a6ecc4b8b38f82142fa5196507847ab51ffe841828af2ca809

See more details on using hashes here.

Provenance

The following attestation bundles were made for riemannax-0.0.1-py3-none-any.whl:

Publisher: release.yml on lv416e/riemannax

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page