Skip to main content

DOI workflow pypi badge Documentation

distance_explainer

XAI method to explain distances in embedded spaces.

overview schema

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:

@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)

Source distribution for distance-explainer 0.6.0
File Size Uploaded
distance_explainer-0.6.0.tar.gz 11.7 kB Details

Built distribution (wheel)

Table of built distributions (wheels) for distance-explainer 0.6.0
File Interpreter ABI Platform
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 log

Release 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

Release history Release notifications | RSS feed

This release

0.6.0 This release

2 release files

0.5.1

2 release files

0.5.0

2 release files

0.4.0

2 release files

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page