explainiverse 0.7.1__py3-none-any.whl → 0.8.0__py3-none-any.whl
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- explainiverse/__init__.py +5 -4
- explainiverse/core/registry.py +18 -0
- explainiverse/explainers/gradient/__init__.py +3 -0
- explainiverse/explainers/gradient/lrp.py +1206 -0
- {explainiverse-0.7.1.dist-info → explainiverse-0.8.0.dist-info}/METADATA +76 -13
- {explainiverse-0.7.1.dist-info → explainiverse-0.8.0.dist-info}/RECORD +8 -7
- {explainiverse-0.7.1.dist-info → explainiverse-0.8.0.dist-info}/LICENSE +0 -0
- {explainiverse-0.7.1.dist-info → explainiverse-0.8.0.dist-info}/WHEEL +0 -0
explainiverse/__init__.py
CHANGED
|
@@ -2,9 +2,10 @@
|
|
|
2
2
|
"""
|
|
3
3
|
Explainiverse - A unified, extensible explainability framework.
|
|
4
4
|
|
|
5
|
-
Supports
|
|
6
|
-
|
|
7
|
-
|
|
5
|
+
Supports 18 state-of-the-art XAI methods including LIME, SHAP, TreeSHAP,
|
|
6
|
+
Integrated Gradients, DeepLIFT, DeepSHAP, LRP, GradCAM, TCAV, Anchors,
|
|
7
|
+
Counterfactuals, Permutation Importance, PDP, ALE, SAGE, and ProtoDash
|
|
8
|
+
through a consistent interface.
|
|
8
9
|
|
|
9
10
|
Quick Start:
|
|
10
11
|
from explainiverse import default_registry
|
|
@@ -33,7 +34,7 @@ from explainiverse.adapters.sklearn_adapter import SklearnAdapter
|
|
|
33
34
|
from explainiverse.adapters import TORCH_AVAILABLE
|
|
34
35
|
from explainiverse.engine.suite import ExplanationSuite
|
|
35
36
|
|
|
36
|
-
__version__ = "0.
|
|
37
|
+
__version__ = "0.8.0"
|
|
37
38
|
|
|
38
39
|
__all__ = [
|
|
39
40
|
# Core
|
explainiverse/core/registry.py
CHANGED
|
@@ -375,6 +375,7 @@ def _create_default_registry() -> ExplainerRegistry:
|
|
|
375
375
|
from explainiverse.explainers.gradient.smoothgrad import SmoothGradExplainer
|
|
376
376
|
from explainiverse.explainers.gradient.saliency import SaliencyExplainer
|
|
377
377
|
from explainiverse.explainers.gradient.tcav import TCAVExplainer
|
|
378
|
+
from explainiverse.explainers.gradient.lrp import LRPExplainer
|
|
378
379
|
from explainiverse.explainers.example_based.protodash import ProtoDashExplainer
|
|
379
380
|
|
|
380
381
|
registry = ExplainerRegistry()
|
|
@@ -587,6 +588,23 @@ def _create_default_registry() -> ExplainerRegistry:
|
|
|
587
588
|
)
|
|
588
589
|
)
|
|
589
590
|
|
|
591
|
+
# Register LRP (Layer-wise Relevance Propagation)
|
|
592
|
+
registry.register(
|
|
593
|
+
name="lrp",
|
|
594
|
+
explainer_class=LRPExplainer,
|
|
595
|
+
meta=ExplainerMeta(
|
|
596
|
+
scope="local",
|
|
597
|
+
model_types=["neural"],
|
|
598
|
+
data_types=["tabular", "image"],
|
|
599
|
+
task_types=["classification", "regression"],
|
|
600
|
+
description="LRP - Layer-wise Relevance Propagation for decomposition-based attributions (requires PyTorch)",
|
|
601
|
+
paper_reference="Bach et al., 2015 - 'On Pixel-wise Explanations for Non-Linear Classifier Decisions by Layer-wise Relevance Propagation' (PLOS ONE)",
|
|
602
|
+
complexity="O(n_layers * forward_pass)",
|
|
603
|
+
requires_training_data=False,
|
|
604
|
+
supports_batching=True
|
|
605
|
+
)
|
|
606
|
+
)
|
|
607
|
+
|
|
590
608
|
# =========================================================================
|
|
591
609
|
# Global Explainers (model-level)
|
|
592
610
|
# =========================================================================
|
|
@@ -13,6 +13,7 @@ Explainers:
|
|
|
13
13
|
- SmoothGradExplainer: Noise-averaged gradients
|
|
14
14
|
- SaliencyExplainer: Basic gradient attribution
|
|
15
15
|
- TCAVExplainer: Concept-based explanations (TCAV)
|
|
16
|
+
- LRPExplainer: Layer-wise Relevance Propagation
|
|
16
17
|
"""
|
|
17
18
|
|
|
18
19
|
from explainiverse.explainers.gradient.integrated_gradients import IntegratedGradientsExplainer
|
|
@@ -21,6 +22,7 @@ from explainiverse.explainers.gradient.deeplift import DeepLIFTExplainer, DeepLI
|
|
|
21
22
|
from explainiverse.explainers.gradient.smoothgrad import SmoothGradExplainer
|
|
22
23
|
from explainiverse.explainers.gradient.saliency import SaliencyExplainer
|
|
23
24
|
from explainiverse.explainers.gradient.tcav import TCAVExplainer, ConceptActivationVector
|
|
25
|
+
from explainiverse.explainers.gradient.lrp import LRPExplainer
|
|
24
26
|
|
|
25
27
|
__all__ = [
|
|
26
28
|
"IntegratedGradientsExplainer",
|
|
@@ -31,4 +33,5 @@ __all__ = [
|
|
|
31
33
|
"SaliencyExplainer",
|
|
32
34
|
"TCAVExplainer",
|
|
33
35
|
"ConceptActivationVector",
|
|
36
|
+
"LRPExplainer",
|
|
34
37
|
]
|