Skip to content

Commit

Permalink
Only consider nonzero acts in viz pipeline to hide dead latents
Browse files Browse the repository at this point in the history
  • Loading branch information
liambai committed Oct 22, 2024
1 parent 63f4a96 commit 8c04b9f
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion plm_interpretability/make_viz_files/__main__.py
Original file line number Diff line number Diff line change
Expand Up @@ -112,7 +112,8 @@ def make_viz_files(checkpoint_files: list[str], sequences_file: str):
sae_dim_acts = sae_acts[:, dim]
# Use the max activation across the sequence for ranking
max_act = np.max(sae_dim_acts)
hidden_dim_to_seqs[dim].push((max_act, seq_idx, sae_dim_acts))
if max_act > 0:
hidden_dim_to_seqs[dim].push((max_act, seq_idx, sae_dim_acts))

dim_to_examples = {}
for dim in range(sae_dim):
Expand Down

0 comments on commit 8c04b9f

Please sign in to comment.