Skip to content

Commit 9600e28

Browse files
craymichaelfacebook-github-bot
authored andcommitted
No gridlines on token attr plots+typo fix (#1355)
Summary: Pull Request resolved: #1355 Gridlines can make negative signs and numbers harder to read. Removing them to ease readability. Also relevant to aesthetics: D63039687 Reviewed By: csauper Differential Revision: D63062341 fbshipit-source-id: db4442d2a9198f7c49fa1885efb11af98838171c
1 parent 4f8caeb commit 9600e28

File tree

1 file changed

+5
-2
lines changed

1 file changed

+5
-2
lines changed

captum/attr/_core/llm_attr.py

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -88,6 +88,9 @@ def plot_token_attr(
8888

8989
fig, ax = plt.subplots()
9090

91+
# Hide the grid
92+
ax.grid(False)
93+
9194
# Plot the heatmap
9295
data = token_attr.numpy()
9396

@@ -119,7 +122,7 @@ def plot_token_attr(
119122

120123
# Create colorbar
121124
cbar = fig.colorbar(im, ax=ax) # type: ignore
122-
cbar.ax.set_ylabel("Token Attribuiton", rotation=-90, va="bottom")
125+
cbar.ax.set_ylabel("Token Attribution", rotation=-90, va="bottom")
123126

124127
# Show all ticks and label them with the respective list entries.
125128
shortened_tokens = [
@@ -204,7 +207,7 @@ def plot_seq_attr(
204207
color="#d0365b",
205208
)
206209

207-
ax.set_ylabel("Sequence Attribuiton", rotation=90, va="bottom")
210+
ax.set_ylabel("Sequence Attribution", rotation=90, va="bottom")
208211

209212
if show:
210213
plt.show()

0 commit comments

Comments
 (0)