Skip to main content

Heat geodesic embeddings

Project description

Start with HeatGeo

The Heat-Geodesic embedding preserves the heat-geodesic dissimilarity defined as

d_t(x_i,x_j) = \bigg[ -4t \log (\mathbf{H}_t)_{ij} - \sigma 4 t \log(\mathbf{V})_{ij} \bigg] ^{1/2},

where $\mathbf{H}_t$ is a heat kernel on a graph, and $\mathbf{V}$ is a volume regularization term. This dissimilarity is inspired by Varadhan’s formula which relates the heat kernel to the geodesic distance on a manifold. For more details on the heat-geodesic dissimilarity read our preprint A Heat Diffusion Perspective on Geodesic Preserving Dimensionality Reduction.

Note

We are currently updating this repository to provide examples and improve the documentation.

Install

The package is not yet available with pip or conda. To install it, you can clone this repo and install from setup.py.

git clone https://github.com/KrishnaswamyLab/HeatGeo.git
cd HeatGeo
pip install -e .

To reproduce the results in experiments/ or try the embeddings with different graph constructions, you need additional packages that can be installed via the development version. In this case run

cd HeatGeo
pip install -e '.[dev]'

We provide an example below.

How to use

Google colab example on the swiss roll Run in Google Colab

The directory experiments contains code to reproduce our main results. We used hydra, the parameters can be changed in config or directly in the CLI. In notebooks, we provide examples on toy datasets.

Contributing

We are using nbdev for this package and the documentation. See this introduction to start using nbdev. The code and documentation should be modified in the notebooks nbs/, then run nbdev_prepare before a commit. This command will export the notebooks to .py files in heatgeo, it will also clean the metadata, and run some test. The page will then automatically be deployed through GitHub actions.

Acknowledgements

This repository is a simplified version of a larger codebase used for development. It loses the original commit history which contains contributions from other authors of the paper. This repository uses or modify code from the PHATE implementation, and the Chebychev polynomials implementation of the paper Fast Multiscale Diffusion on Graphs.

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

heatgeo-0.0.1.tar.gz (18.4 kB view details)

Uploaded Source

Built Distribution

heatgeo-0.0.1-py3-none-any.whl (18.9 kB view details)

Uploaded Python 3

File details

Details for the file heatgeo-0.0.1.tar.gz.

File metadata

  • Download URL: heatgeo-0.0.1.tar.gz
  • Upload date:
  • Size: 18.4 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/4.0.2 CPython/3.10.6

File hashes

Hashes for heatgeo-0.0.1.tar.gz
Algorithm Hash digest
SHA256 8aa51f9e3f2c8618633d6e6189f2ea7cb0fb42aad08affb77eed4e7878eb1be3
MD5 c250026d33318d534f692a4caf7c436b
BLAKE2b-256 1f86b9d77f604dcd3bcd139751a3467c3069cb9cde3fe669b2b84e1a56befb65

See more details on using hashes here.

File details

Details for the file heatgeo-0.0.1-py3-none-any.whl.

File metadata

  • Download URL: heatgeo-0.0.1-py3-none-any.whl
  • Upload date:
  • Size: 18.9 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/4.0.2 CPython/3.10.6

File hashes

Hashes for heatgeo-0.0.1-py3-none-any.whl
Algorithm Hash digest
SHA256 5f84a876f84cd946281f265d879a2e0712ae043af8dbb52ce14687a2afdb46d5
MD5 3bd2226c79ae2cfd02919017dfe0dea9
BLAKE2b-256 3c26093ecccdf1cc6db5473cf971a22f6b681570d0c1b724111faa0dde13285a

See more details on using hashes here.

Supported by

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