Skip to main content

Hyperbolic Deep Learning in JAX

Project description

Hyperbolix

Hyperbolic Deep Learning in JAX

Tests Python JAX License

Pure JAX implementation of hyperbolic deep learning with manifold operations, neural network layers, and Riemannian optimizers. Built with Flax NNX and Optax.

Features

  • 🌐 4 Manifolds: Euclidean, Poincaré Ball, Hyperboloid, Proper Velocity
  • 🧠 20+ Neural Network Layers: Linear, convolutional, regression, attention, positional encoding, PV
  • 5 Hyperbolic Activations: ReLU, Leaky ReLU, Tanh, Swish, GELU
  • 📈 Riemannian Optimizers: RAdam and RSGD with automatic manifold detection
  • 🚀 Pure JAX/Flax NNX: vmap-native API, JIT-compatible (10-100x speedup)
  • 1,400+ tests passing with comprehensive benchmark suite

Quick Start

import jax.numpy as jnp
from hyperbolix.manifolds import poincare
from hyperbolix.nn_layers import HypLinearPoincare
from flax import nnx

# Manifold operations
x = jnp.array([0.1, 0.2])
y = jnp.array([0.3, -0.1])
distance = poincare.dist(x, y, c=1.0, version_idx=0)

# Neural network layer
layer = HypLinearPoincare(
    manifold_module=poincare,
    in_dim=128,
    out_dim=64,
    rngs=nnx.Rngs(0)
)
output = layer(x_batch, c=1.0)

Installation

git clone https://github.com/hyperbolix/hyperbolix.git
cd hyperbolix
uv sync  # or: pip install -e .

Requirements: Python 3.12+, JAX 0.4.20+, Flax 0.8.0+, Optax 0.1.7+

Documentation

📖 Full Documentation

Build docs locally: uv run mkdocs serve

Key Concepts

Pure functional design: No stateful classes, curvature passed at call time

import hyperbolix.manifolds.poincare as poincare
dist = poincare.dist(x, y, c=1.0, version_idx=0)  # (dim,) → scalar

vmap-native API: Functions operate on single points, use jax.vmap for batching

# Batch operations
distances = jax.vmap(poincare.dist, in_axes=(0, 0, None, None))(
    x_batch, y_batch, 1.0, 0
)

Citation

@software{hyperbolix2026,
  title = {Hyperbolix: Hyperbolic Deep Learning in JAX},
  author = {Klein, Timo and Lang, Thomas},
  year = {2026},
  url = {https://github.com/hyperbolix/hyperbolix}
}

References

Implements methods from:

  • Ganea et al. (2018): Hyperbolic Neural Networks
  • Bécigneul & Ganea (2019): Riemannian Adaptive Optimization
  • Nagano et al. (2019): Wrapped Normal Distribution on Hyperbolic Space
  • Shimizu et al. (2020): Hyperbolic Neural Networks++
  • Bdeir et al. (2023): Fully Hyperbolic CNNs
  • Bdeir et al. (2025): Robust Hyperbolic Learning
  • Klis et al. (2026): Fast and Geometrically Grounded Lorentz Neural Networks
  • Chen et al. (2026): Proper Velocity Neural Networks

See individual module docstrings for detailed references.

Contributing

Contributions welcome! See DEVELOPER_GUIDE.md for setup and guidelines.

For bugs or questions, open an issue.

License

MIT License. See LICENSE for details.

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

hyperbolix-0.6.0.tar.gz (84.0 kB view details)

Uploaded Source

Built Distribution

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

hyperbolix-0.6.0-py3-none-any.whl (117.1 kB view details)

Uploaded Python 3

File details

Details for the file hyperbolix-0.6.0.tar.gz.

File metadata

  • Download URL: hyperbolix-0.6.0.tar.gz
  • Upload date:
  • Size: 84.0 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: uv/0.11.7 {"installer":{"name":"uv","version":"0.11.7","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"Ubuntu","version":"24.04","id":"noble","libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":true}

File hashes

Hashes for hyperbolix-0.6.0.tar.gz
Algorithm Hash digest
SHA256 b3a59e6215c18e726c313d7939c78412c8d78054c1da1ae8eb7852b1e0a818dd
MD5 9058597f442dcfe01671fed3f4a2be50
BLAKE2b-256 5b860d05731fe513edbc3cbfb91557f4832d12684ab1ca8d428d705f52f15824

See more details on using hashes here.

File details

Details for the file hyperbolix-0.6.0-py3-none-any.whl.

File metadata

  • Download URL: hyperbolix-0.6.0-py3-none-any.whl
  • Upload date:
  • Size: 117.1 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: uv/0.11.7 {"installer":{"name":"uv","version":"0.11.7","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"Ubuntu","version":"24.04","id":"noble","libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":true}

File hashes

Hashes for hyperbolix-0.6.0-py3-none-any.whl
Algorithm Hash digest
SHA256 7e6dea321177da943a40f7b827fa4c1c4fcf0d92ce160e300cdae9bbe2ef7e04
MD5 57122dc3720aa677b86da4edf0555970
BLAKE2b-256 f2bd5ea9e0b49b452a2be3acf3e60c59ff706bf50d4e65681bbff43674db28e7

See more details on using hashes here.

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