Diffusion based distances in PyTorch
Project description
heatdist
Implementation of diffusion-based distances in torch.
from torchheat.heat_kernel import HeatKernelGaussian, HeatKernelKNN
import torch
data = torch.randn(100, 5)
# Heat kernel for a gaussian affinity matrix
heat_op = HeatKernelGaussian(sigma=1.0, t=1.0)
dist = heat_op.fit(data, dist_type="var") # ["var", "phate", "diff"]
# Heat kernel for a k-nearest neighbor affinity matrix
heat_op = HeatKernelKNN(k=5, t=1.0)
dist = heat_op.fit(data, dist_type="var") # ["var", "phate", "diff"]
Below is an example of distance matrices from a line embedded in two dimensions. The Euclidean distance between the two sets of points highlighted in green does not reflect the true distances on the one dimensional line.
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
torchheat-0.2.0.tar.gz
(7.3 kB
view details)
Built Distribution
File details
Details for the file torchheat-0.2.0.tar.gz
.
File metadata
- Download URL: torchheat-0.2.0.tar.gz
- Upload date:
- Size: 7.3 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/5.0.0 CPython/3.12.3
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 22d9838f5dfda7c0756c3e4d5ff12ede77c11b1823ffb26e05ab63ba7dd6333b |
|
MD5 | b3d897b07665ac0802d9c89ef52a8ac3 |
|
BLAKE2b-256 | 6cd62ff623db053c89157003a1fcd4ce6ee38648eb3f83ee48fafcf570eb5c2c |
File details
Details for the file torchheat-0.2.0-py3-none-any.whl
.
File metadata
- Download URL: torchheat-0.2.0-py3-none-any.whl
- Upload date:
- Size: 5.7 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/5.0.0 CPython/3.12.3
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 31a67b060888591e63b4d1a390978fe7192e501c5c7c7fe931a88c3853dafba2 |
|
MD5 | d546ddd3dbacab1e81658989b986c97e |
|
BLAKE2b-256 | eb2c0a4cb0ea3f45580d92d7c86db480209d2ab9d5f5853a970d7bfd90460ec5 |