Skip to main content

Universal Hyperbolic Geometry Library for PyTorch

Project description

Universal Hyperbolic Geometry Library

PyPI version License Build Status Code Coverage

A PyTorch library for Universal Hyperbolic Geometry (UHG) and Hyperbolic Graph Neural Networks. All operations are performed directly in hyperbolic space without tangent space mappings.

Installation

Basic Installation

pip install uhg

With GPU Support

pip install uhg[gpu]

CPU-Only Version

pip install uhg[cpu]

Development Version

pip install uhg[dev]

Documentation Tools

pip install uhg[docs]

Quick Start

import uhg
import torch

# Create hyperbolic tensors
manifold = uhg.LorentzManifold()
x = uhg.HyperbolicTensor([1.0, 0.0, 0.0], manifold=manifold)
y = uhg.HyperbolicTensor([0.0, 1.0, 0.0], manifold=manifold)

# Compute hyperbolic distance
dist = uhg.distance(x, y)

# Create a hyperbolic neural network
model = uhg.nn.layers.HyperbolicGraphConv(
    manifold=manifold,
    in_features=10,
    out_features=5
)

# Use hyperbolic optimizer
optimizer = uhg.optim.HyperbolicAdam(
    model.parameters(),
    manifold=manifold,
    lr=0.01
)

Features

  • Pure UHG implementation without tangent space operations
  • Hyperbolic neural network layers and models
  • Hyperbolic optimizers (Adam, SGD)
  • Hyperbolic samplers (HMC, Langevin)
  • Graph neural networks in hyperbolic space
  • Comprehensive documentation and examples

Platform Support

  • Linux (all major distributions)
  • macOS (including Apple Silicon)
  • Windows
  • Docker containers
  • Splunk environments

Documentation

Full documentation is available in the docs directory and in the GitHub repository.

License

This project is licensed under the MIT License - see the LICENSE file for details.

Citation

If you use UHG in your research, please cite:

@software{uhg2023,
  title = {UHG: Universal Hyperbolic Geometry Library},
  author = {Bovaird, Zach},
  year = {2023},
  url = {https://github.com/zachbovaird/UHG-Library}
}

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

uhg-0.1.3.tar.gz (42.0 kB view details)

Uploaded Source

Built Distribution

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

uhg-0.1.3-py3-none-any.whl (45.1 kB view details)

Uploaded Python 3

File details

Details for the file uhg-0.1.3.tar.gz.

File metadata

  • Download URL: uhg-0.1.3.tar.gz
  • Upload date:
  • Size: 42.0 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.0.1 CPython/3.9.20

File hashes

Hashes for uhg-0.1.3.tar.gz
Algorithm Hash digest
SHA256 fb8990a66ca73ca676a59c16d1fce7e97b4d6b45941e12ef7e9a790223a9e110
MD5 735255eff01ceab21e3fcbb328d5ad77
BLAKE2b-256 4ebad66739c7a74fd69562e7810e628c91d06d007806a3df916fe165a895e5e9

See more details on using hashes here.

File details

Details for the file uhg-0.1.3-py3-none-any.whl.

File metadata

  • Download URL: uhg-0.1.3-py3-none-any.whl
  • Upload date:
  • Size: 45.1 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.0.1 CPython/3.9.20

File hashes

Hashes for uhg-0.1.3-py3-none-any.whl
Algorithm Hash digest
SHA256 8eb5d16fea77b97815b40d574275e1bb22f35d6f588663ad34f997fbfcf4e7bb
MD5 f9ddff3ccf3b4d8a8af68fadc1f6feaa
BLAKE2b-256 d72eb8f5850c31c4cd9905f0a43050fb79553ee8f619ed7f33d15c1220d3902c

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