Skip to content

add visualization from sae-dashboard #146

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Draft
wants to merge 5 commits into
base: main
Choose a base branch
from
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 3 additions & 0 deletions delphi/config.py
Original file line number Diff line number Diff line change
Expand Up @@ -69,6 +69,9 @@ class ConstructorConfig(Serializable):
] = "co-occurrence"
"""Type of neighbours to use. Only used if non_activating_source is 'neighbours'."""

save_activation_data: bool = False
"""Whether to keep the origianl activation data in the record."""


@dataclass
class CacheConfig(Serializable):
Expand Down
2 changes: 2 additions & 0 deletions delphi/latents/constructors.py
Original file line number Diff line number Diff line change
Expand Up @@ -329,6 +329,8 @@ def constructor(
else:
raise ValueError(f"Invalid non-activating source: {source_non_activating}")
record.not_active = non_activating_examples
if constructor_cfg.save_activation_data:
record.activation_data = activation_data
return record


Expand Down
3 changes: 3 additions & 0 deletions delphi/latents/latents.py
Original file line number Diff line number Diff line change
Expand Up @@ -150,6 +150,9 @@ class LatentRecord:
extra_examples: Optional[list[Example]] = None
"""Extra examples to include in the record."""

activation_data: Optional[ActivationData] = None
"""Activation data for the latent, if it was saved."""

per_token_frequency: float = 0.0
"""Frequency of the latent. Number of activations per total number of tokens."""

Expand Down
Loading
Loading