Skip to main content

XAI method to explain distances in embedded spaces

Project description

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.

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

distance_explainer-0.6.0.tar.gz (11.7 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

distance_explainer-0.6.0-py3-none-any.whl (10.4 kB view details)

Uploaded Python 3

File details

Details for the file distance_explainer-0.6.0.tar.gz.

File metadata

  • Download URL: distance_explainer-0.6.0.tar.gz
  • Upload date:
  • Size: 11.7 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.13.12

File hashes

Hashes for distance_explainer-0.6.0.tar.gz
Algorithm Hash digest
SHA256 ca113c034dc631d6a5af3499c0a6099d736d609956940004e6dd6f85bf73f69c
MD5 ebda5f8d70d97c0dbf4baed4cc475e61
BLAKE2b-256 f311454a3dbe7611e839c533cba8b86587e33ff8b44dded8db955caed11ffd82

See more details on using hashes here.

Provenance

The following attestation bundles were made for distance_explainer-0.6.0.tar.gz:

Publisher: release.yml on dianna-ai/distance_explainer

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file distance_explainer-0.6.0-py3-none-any.whl.

File metadata

File hashes

Hashes for distance_explainer-0.6.0-py3-none-any.whl
Algorithm Hash digest
SHA256 8a185d7ec3c0940602c4bddfe926ba361bdd9eddba9120f0159590d20bf661fa
MD5 365e474a87bf8d2f6e07e9094a50231a
BLAKE2b-256 12cd1b1c7c619a9551c9b67614c01ab1c74ade1b5e680073cf2a8149c8221d2e

See more details on using hashes here.

Provenance

The following attestation bundles were made for distance_explainer-0.6.0-py3-none-any.whl:

Publisher: release.yml on dianna-ai/distance_explainer

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

Supported by

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