distance_explainer
XAI method to explain distances in embedded spaces.
Installation
There are 2 ways to install distance_explainer. To install distance_explainer from PyPI (recommended) run:
pip install distance_explainer
To instead install distance_explainer from the GitHub repository, run:
git clone git@github.com:dianna-ai/distance_explainer.git
cd distance_explainer
python3 -m pip install .
How to use
See our documentation and tutorial notebook for how to use this package. In short:
image1 = np.random.random((100, 100, 3))
image2 = np.random.random((100, 100, 3))
image2_embedded = model(image2)
explainer = DistanceExplainer(axis_labels={2: 'channels'})
attribution_map = explainer.explain_image_distance(model, image1, image2_embedded)
If you use, please cite
If you use Distance Explainer for your research, please cite our method paper and the software itself:
- Method paper: "Explainable embeddings with Distance Explainer" — arXiv:2505.15516 (to appear in the XAI26 proceedings)
- Software:
distance_explainer— doi:10.5281/zenodo.10018768
@article{meijer2025explainable,
title={Explainable embeddings with {D}istance {E}xplainer},
author={Meijer, Christiaan and Bos, E. G. Patrick},
journal={arXiv preprint arXiv:2505.15516},
year={2025},
note={To appear in the XAI26 proceedings}
}
@software{meijer2023distance,
title={distance_explainer},
author={Meijer, Christiaan and Bos, Patrick},
doi={10.5281/zenodo.10018768},
year={2023}
}
Contributing
If you want to contribute to the development of distance_explainer, have a look at the contribution guidelines.
Credits
This package was created with Cookiecutter and the NLeSC/python-template.
Metadata
Release files for distance-explainer 0.6.0
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | |
|---|---|---|---|
| distance_explainer-0.6.0.tar.gz | 11.7 kB | Details |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Reset |
|---|---|---|---|---|
| distance_explainer-0.6.0-py3-none-any.whl | Python 3 | none | any | Details |
Total release size: 22.1 kB
Release files / distance_explainer-0.6.0.tar.gz
| Download URL | distance_explainer-0.6.0.tar.gz |
|---|---|
| Size | 11.7 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
ca113c034dc631d6a5af3499c0a6099d736d609956940004e6dd6f85bf73f69c
|
|
BLAKE2b-256 checksum How to use checksums |
f311454a3dbe7611e839c533cba8b86587e33ff8b44dded8db955caed11ffd82
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
Yes |
| Uploaded via |
twine/6.1.0 CPython/3.13.12
|
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.
PyPI Publish Attestation
PyPI verified that this artifact, at this checksum, originated from the publisher listed below.
Signed by GitHub Actions, verified by PyPI on Jul 9, 2026.
Transparency logRelease files / distance_explainer-0.6.0-py3-none-any.whl
| Download URL | distance_explainer-0.6.0-py3-none-any.whl |
|---|---|
| Size | 10.4 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
8a185d7ec3c0940602c4bddfe926ba361bdd9eddba9120f0159590d20bf661fa
|
|
BLAKE2b-256 checksum How to use checksums |
12cd1b1c7c619a9551c9b67614c01ab1c74ade1b5e680073cf2a8149c8221d2e
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
Yes |
| Uploaded via |
twine/6.1.0 CPython/3.13.12
|
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.
PyPI Publish Attestation
PyPI verified that this artifact, at this checksum, originated from the publisher listed below.
Signed by GitHub Actions, verified by PyPI on Jul 9, 2026.
Transparency log