explainable-attention
Implementation of various tools for multi-head attention explainability from transformers.
Self-Attention Attribution
from explainable_attention.self_attention_attribution import compute
...
def objective(batch):
x, y = batch
y = model(x)
loss = loss_fn(x, y)
return loss
attribution = saa.compute(
model.transformer_encoder.layers,
objective,
batch,
integration_steps=20)
Metadata
Release files for explainable-attention 0.0.2
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | |
|---|---|---|---|
| explainable_attention-0.0.2.tar.gz | 4.4 kB | Details |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Reset |
|---|---|---|---|---|
| explainable_attention-0.0.2-py3-none-any.whl | Python 3 | none | any | Details |
Total release size: 9.9 kB
Release files / explainable_attention-0.0.2.tar.gz
| Download URL | explainable_attention-0.0.2.tar.gz |
|---|---|
| Size | 4.4 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
25320056a6bfa486a73575fb61e4d8cec3bfe5598605529dd54e9428196ab501
|
|
BLAKE2b-256 checksum How to use checksums |
8cd8b1a3c53f22250b2ce15e64a93f0245c5b7a47074da7545b0277277fadf8a
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/6.1.0 CPython/3.12.8
|
Release files / explainable_attention-0.0.2-py3-none-any.whl
| Download URL | explainable_attention-0.0.2-py3-none-any.whl |
|---|---|
| Size | 5.4 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
88923d20e9891fd421a7dbee8924c77b1ec007889c2fba8aa6b4a4131d27a51f
|
|
BLAKE2b-256 checksum How to use checksums |
e14dae0b16c7c12a0e71962b4f7f3002262efda468d2fcc3160b8253a67bd252
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/6.1.0 CPython/3.12.8
|