Skip to content

Commit e9599c9

Browse files
vivekmigfacebook-github-bot
authored andcommitted
RST File Cleanup (#219)
Summary: This PR cleans up the RST files defining documentation, adding all new methods, with the following improvements: 1. Since the change of file structure, the layer and neuron documentation has not been generated appropriately and is not currently available on captum.ai. This fixes the paths to generate appropriately. 2. Paths displayed in each documentation follow our shortcut syntax as opposed to the full paths (e.g. captum.attr.saliency as opposed to captum.attr._core.saliency). 3. Some redundant / unnecessary definitions for automodule and autofunction were removed, these are generally covered by simply declaring autoclass with members. 4. Utilities and base classes have been split, and methods have been grouped to more closely match the algorithm description. The new API hierarchy is shown below: <img width="533" alt="Screen Shot 2019-12-22 at 12 15 45 PM" src="https://user-images.githubusercontent.com/11067177/71378710-af469680-257d-11ea-9462-fd893266d780.png"> <img width="499" alt="Screen Shot 2019-12-22 at 12 15 54 PM" src="https://user-images.githubusercontent.com/11067177/71378714-b2418700-257d-11ea-89ae-1f18ee415ded.png"> Pull Request resolved: #219 Differential Revision: D19231057 Pulled By: vivekmig fbshipit-source-id: 84fedde397d852920f12fea1943ae2fd1f721155
1 parent c7375f8 commit e9599c9

19 files changed

+168
-121
lines changed

captum/attr/__init__.py

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -38,6 +38,7 @@
3838
) # noqa
3939
from ._utils.attribution import Attribution # noqa
4040
from ._utils.attribution import GradientAttribution # noqa
41+
from ._utils.attribution import PerturbationAttribution # noqa
4142
from ._utils.attribution import LayerAttribution # noqa
4243
from ._utils.attribution import NeuronAttribution # noqa
4344
from ._utils import visualization # noqa
@@ -48,6 +49,7 @@
4849
__all__ = [
4950
"Attribution",
5051
"GradientAttribution",
52+
"PerturbationAttribution",
5153
"NeuronAttribution",
5254
"LayerAttribution",
5355
"IntegratedGradients",

sphinx/source/attribution.rst

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
Attribution
2+
====================
3+
.. toctree::
4+
5+
integrated_gradients
6+
saliency
7+
deep_lift
8+
deep_lift_shap
9+
gradient_shap
10+
input_x_gradient
11+
guided_backprop
12+
guided_grad_cam
13+
deconvolution
14+
feature_ablation
15+
occlusion

sphinx/source/base_classes.rst

Lines changed: 32 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,32 @@
1+
Base Classes
2+
==========
3+
4+
Attribution
5+
^^^^^^^^^^^^
6+
7+
.. autoclass:: captum.attr.Attribution
8+
:members:
9+
10+
Layer Attribution
11+
^^^^^^^^^^^^^^^^^
12+
13+
.. autoclass:: captum.attr.LayerAttribution
14+
:members:
15+
16+
Neuron Attribution
17+
^^^^^^^^^^^^^^^^^^^
18+
19+
.. autoclass:: captum.attr.NeuronAttribution
20+
:members:
21+
22+
Gradient Attribution
23+
^^^^^^^^^^^^^^^^^^^^^
24+
25+
.. autoclass:: captum.attr.GradientAttribution
26+
:members:
27+
28+
Perturbation Attribution
29+
^^^^^^^^^^^^^^^^^^^^^
30+
31+
.. autoclass:: captum.attr.PerturbationAttribution
32+
:members:

sphinx/source/deconvolution.rst

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
Deconvolution
2+
=========
3+
4+
.. autoclass:: captum.attr.Deconvolution
5+
:members:

sphinx/source/deep_lift.rst

Lines changed: 1 addition & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,5 @@
11
DeepLift
22
=========
33

4-
.. automodule:: captum.attr._core.deep_lift
5-
6-
.. autoclass:: DeepLift
4+
.. autoclass:: captum.attr.DeepLift
75
:members:
8-
9-
.. autofunction:: attribute
10-
.. autofunction:: _backward_hook

sphinx/source/deep_lift_shap.rst

Lines changed: 1 addition & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,5 @@
11
DeepLiftShap
22
=============
33

4-
.. automodule:: captum.attr._core.deep_lift
5-
6-
.. autoclass:: DeepLiftShap
4+
.. autoclass:: captum.attr.DeepLiftShap
75
:members:
8-
9-
.. autofunction:: attribute
10-
.. autofunction:: nonlinear

sphinx/source/feature_ablation.rst

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
Feature Ablation
2+
=========
3+
4+
.. autoclass:: captum.attr.FeatureAblation
5+
:members:

sphinx/source/gradient_shap.rst

Lines changed: 2 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,8 @@
11
GradientShap
22
============
33

4-
.. automodule:: captum.attr._core.gradient_shap
5-
6-
.. autoclass:: GradientShap
4+
.. autoclass:: captum.attr.GradientShap
75
:members:
86

9-
.. autofunction:: attribute
10-
11-
.. autoclass:: InputBaselineXGradient
7+
.. autoclass:: captum.attr.InputBaselineXGradient
128
:members:

sphinx/source/guided_backprop.rst

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
Guided Backprop
2+
=========
3+
4+
.. autoclass:: captum.attr.GuidedBackprop
5+
:members:

sphinx/source/guided_grad_cam.rst

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
Guided GradCAM
2+
=========
3+
4+
.. autoclass:: captum.attr.GuidedGradCAM
5+
:members:

0 commit comments

Comments
 (0)