FastWLK
Quick Links
What does fastwlk do?
fastwlk is a Python package that implements a fast version of the Weisfeiler-Lehman kernel. It manages to outperform current state-of-the-art implementations on sparse graphs by implementing a number of improvements compared to vanilla implementations:
It parallelizes the execution of Weisfeiler-Lehman hash computations since each graph’s hash can be computed independently prior to computing the kernel.
It parallelizes the computation of similarity of graphs in RKHS by computing batches of the inner products independently.
When comparing graphs, lots of computations are spent processing positions/hashes that do not actually overlap between Weisfeiler-Lehman histograms. As such, we manually loop over the overlapping keys, outperforming numpy dot product-based implementations on collections of sparse graphs.
This implementation works best when graphs have relatively few connections compared to the number of possible connections and are reasonably dissimilar from one another. If you are not sure the graphs you are using are either sparse or dissimilar enough, try to benchmark this package with others out there using this script.
How fast is fastwlk?
Running the benchmark script in examples/benchmark.py shows that for the graphs in data/graphs.pkl, we get an approximately 80% speed improvement over other implementations like grakel. The example dataset contains 2-nn graphs extracted from 100 random proteins from the human proteome from the AlphaFold EBI database.
To see how much faster this implementation is for your use case:
$ git clone git://github.com/pjhartout/fastwlk
$ poetry install
$ poetry run python examples/benchmark.py
You will need to swap out the provided graphs.pkl with a pickled iterable of graphs from the database you are interested in.
Metadata
Release files for fastwlk 0.2.14
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | Provenance | Actions |
|---|---|---|---|---|
| fastwlk-0.2.14.tar.gz | 9.1 kB | Without provenance | Details for fastwlk-0.2.14.tar.gz |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Actions Reset |
|---|---|---|---|---|
| fastwlk-0.2.14-py3-none-any.whl | Python 3 | none | any | Details for fastwlk-0.2.14-py3-none-any.whl |
Total release size: 17.7 kB
Release files / fastwlk-0.2.14.tar.gz
| Download URL | fastwlk-0.2.14.tar.gz |
|---|---|
| Size | 9.1 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
da305d0bf74f80ec54ab5c73844b0274f1a421e5c7caadd3fa83d2d8cb0d0d70
|
|
BLAKE2b-256 checksum How to use checksums |
aed7fd2033b4fa3ad2f6b7ae96bc5eb4eeae624414d96ca4ad5978d114b813ed
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/4.0.0 CPython/3.9.12
|
Release files / fastwlk-0.2.14-py3-none-any.whl
| Download URL | fastwlk-0.2.14-py3-none-any.whl |
|---|---|
| Size | 8.6 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
9d0b3bc8268cbbf9decc70d22e6b8e51e503f50be6ccd44e182680114a1b2720
|
|
BLAKE2b-256 checksum How to use checksums |
69839f46b558d5fa484e1338f1f516d1037b9131ac45c193f08d025dbb0c45fa
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/4.0.0 CPython/3.9.12
|
Security for fastwlk 0.2.14
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
No provenance found
None of the files in this release were uploaded with provenance metadata.
A note on package security
PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.
To learn more about protecting yourself from malicious actors, visit our package security documentation.