Skip to content

Commit

Permalink
Fix indentions for website documentation (#705)
Browse files Browse the repository at this point in the history
Summary:
Pull Request resolved: #705

Fix indentions for website documentation.

Indention is a bit off on the web site. Fixing it.
https://captum.ai/api/concept.html#tcav

Reviewed By: vivekmig

Differential Revision: D29533256

fbshipit-source-id: f5dd91ca0340f3b26164a46f374dac19c06a9f34
  • Loading branch information
NarineK authored and facebook-github-bot committed Jul 2, 2021
1 parent 5c30abb commit 400b928
Showing 1 changed file with 7 additions and 7 deletions.
14 changes: 7 additions & 7 deletions captum/concept/_core/tcav.py
Original file line number Diff line number Diff line change
Expand Up @@ -110,7 +110,7 @@ class TCAV(ConceptInterpreter):
This class implements ConceptInterpreter abstract class using an
approach called Testing with Concept Activation Vectors (TCAVs),
as described in the paper:
https://arxiv.org/pdf/1711.11279.pdf
https://arxiv.org/pdf/1711.11279.pdf
TCAV scores for a given layer, a list of concepts and input example
are computed using the dot product between prediction's layer
Expand All @@ -126,23 +126,23 @@ class TCAV(ConceptInterpreter):
CAVs are represented as a learned weight matrix with the dimensionality
C X F, where:
F represents the number of input features in the classifier.
C is the number of concepts used for the classification. Concept
ids are used as labels for concept examples during the training.
F represents the number of input features in the classifier.
C is the number of concepts used for the classification. Concept
ids are used as labels for concept examples during the training.
We can use any layer attribution algorithm to compute layer sensitivities
of a model prediction.
For example, the gradients of an output prediction w.r.t. the outputs of
the layer.
The CAVs and the Sensitivities (SENS) are used to compute the TCAV score:
0. TCAV = CAV • SENS, a dot product between those two vectors
0. TCAV = CAV • SENS, a dot product between those two vectors
The final TCAV score can be computed by aggregating the TCAV scores
for each input concept based on the sign or magnitude of the tcav scores.
1. sign_count_score = | TCAV > 0 | / | TCAV |
2. magnitude_score = SUM(ABS(TCAV * (TCAV > 0))) / SUM(ABS(TCAV))
1. sign_count_score = | TCAV > 0 | / | TCAV |
2. magnitude_score = SUM(ABS(TCAV * (TCAV > 0))) / SUM(ABS(TCAV))
"""

def __init__(
Expand Down

0 comments on commit 400b928

Please sign in to comment.