sae-lens 6.1.0__tar.gz → 6.2.0__tar.gz
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- {sae_lens-6.1.0 → sae_lens-6.2.0}/PKG-INFO +5 -1
- {sae_lens-6.1.0 → sae_lens-6.2.0}/README.md +4 -0
- {sae_lens-6.1.0 → sae_lens-6.2.0}/pyproject.toml +1 -1
- {sae_lens-6.1.0 → sae_lens-6.2.0}/sae_lens/__init__.py +1 -1
- {sae_lens-6.1.0 → sae_lens-6.2.0}/sae_lens/saes/topk_sae.py +2 -1
- {sae_lens-6.1.0 → sae_lens-6.2.0}/LICENSE +0 -0
- {sae_lens-6.1.0 → sae_lens-6.2.0}/sae_lens/analysis/__init__.py +0 -0
- {sae_lens-6.1.0 → sae_lens-6.2.0}/sae_lens/analysis/hooked_sae_transformer.py +0 -0
- {sae_lens-6.1.0 → sae_lens-6.2.0}/sae_lens/analysis/neuronpedia_integration.py +0 -0
- {sae_lens-6.1.0 → sae_lens-6.2.0}/sae_lens/cache_activations_runner.py +0 -0
- {sae_lens-6.1.0 → sae_lens-6.2.0}/sae_lens/config.py +0 -0
- {sae_lens-6.1.0 → sae_lens-6.2.0}/sae_lens/constants.py +0 -0
- {sae_lens-6.1.0 → sae_lens-6.2.0}/sae_lens/evals.py +0 -0
- {sae_lens-6.1.0 → sae_lens-6.2.0}/sae_lens/llm_sae_training_runner.py +0 -0
- {sae_lens-6.1.0 → sae_lens-6.2.0}/sae_lens/load_model.py +0 -0
- {sae_lens-6.1.0 → sae_lens-6.2.0}/sae_lens/loading/__init__.py +0 -0
- {sae_lens-6.1.0 → sae_lens-6.2.0}/sae_lens/loading/pretrained_sae_loaders.py +0 -0
- {sae_lens-6.1.0 → sae_lens-6.2.0}/sae_lens/loading/pretrained_saes_directory.py +0 -0
- {sae_lens-6.1.0 → sae_lens-6.2.0}/sae_lens/pretokenize_runner.py +0 -0
- {sae_lens-6.1.0 → sae_lens-6.2.0}/sae_lens/pretrained_saes.yaml +0 -0
- {sae_lens-6.1.0 → sae_lens-6.2.0}/sae_lens/registry.py +0 -0
- {sae_lens-6.1.0 → sae_lens-6.2.0}/sae_lens/saes/__init__.py +0 -0
- {sae_lens-6.1.0 → sae_lens-6.2.0}/sae_lens/saes/batchtopk_sae.py +0 -0
- {sae_lens-6.1.0 → sae_lens-6.2.0}/sae_lens/saes/gated_sae.py +0 -0
- {sae_lens-6.1.0 → sae_lens-6.2.0}/sae_lens/saes/jumprelu_sae.py +0 -0
- {sae_lens-6.1.0 → sae_lens-6.2.0}/sae_lens/saes/sae.py +0 -0
- {sae_lens-6.1.0 → sae_lens-6.2.0}/sae_lens/saes/standard_sae.py +0 -0
- {sae_lens-6.1.0 → sae_lens-6.2.0}/sae_lens/tokenization_and_batching.py +0 -0
- {sae_lens-6.1.0 → sae_lens-6.2.0}/sae_lens/training/__init__.py +0 -0
- {sae_lens-6.1.0 → sae_lens-6.2.0}/sae_lens/training/activation_scaler.py +0 -0
- {sae_lens-6.1.0 → sae_lens-6.2.0}/sae_lens/training/activations_store.py +0 -0
- {sae_lens-6.1.0 → sae_lens-6.2.0}/sae_lens/training/mixing_buffer.py +0 -0
- {sae_lens-6.1.0 → sae_lens-6.2.0}/sae_lens/training/optim.py +0 -0
- {sae_lens-6.1.0 → sae_lens-6.2.0}/sae_lens/training/sae_trainer.py +0 -0
- {sae_lens-6.1.0 → sae_lens-6.2.0}/sae_lens/training/types.py +0 -0
- {sae_lens-6.1.0 → sae_lens-6.2.0}/sae_lens/training/upload_saes_to_huggingface.py +0 -0
- {sae_lens-6.1.0 → sae_lens-6.2.0}/sae_lens/tutorial/tsea.py +0 -0
- {sae_lens-6.1.0 → sae_lens-6.2.0}/sae_lens/util.py +0 -0
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
Metadata-Version: 2.3
|
|
2
2
|
Name: sae-lens
|
|
3
|
-
Version: 6.
|
|
3
|
+
Version: 6.2.0
|
|
4
4
|
Summary: Training and Analyzing Sparse Autoencoders (SAEs)
|
|
5
5
|
License: MIT
|
|
6
6
|
Keywords: deep-learning,sparse-autoencoders,mechanistic-interpretability,PyTorch
|
|
@@ -68,6 +68,10 @@ This library is maintained by [Joseph Bloom](https://www.jbloomaus.com/), [Curt
|
|
|
68
68
|
|
|
69
69
|
Pre-trained SAEs for various models can be imported via SAE Lens. See this [page](https://jbloomaus.github.io/SAELens/sae_table/) in the readme for a list of all SAEs.
|
|
70
70
|
|
|
71
|
+
## Migrating to SAELens v6
|
|
72
|
+
|
|
73
|
+
The new v6 update is a major refactor to SAELens and changes the way training code is structured. Check out the [migration guide](https://jbloomaus.github.io/SAELens/latest/migrating/) for more details.
|
|
74
|
+
|
|
71
75
|
## Tutorials
|
|
72
76
|
|
|
73
77
|
- [SAE Lens + Neuronpedia](tutorials/tutorial_2_0.ipynb)[](https://githubtocolab.com/jbloomAus/SAELens/blob/main/tutorials/tutorial_2_0.ipynb)
|
|
@@ -28,6 +28,10 @@ This library is maintained by [Joseph Bloom](https://www.jbloomaus.com/), [Curt
|
|
|
28
28
|
|
|
29
29
|
Pre-trained SAEs for various models can be imported via SAE Lens. See this [page](https://jbloomaus.github.io/SAELens/sae_table/) in the readme for a list of all SAEs.
|
|
30
30
|
|
|
31
|
+
## Migrating to SAELens v6
|
|
32
|
+
|
|
33
|
+
The new v6 update is a major refactor to SAELens and changes the way training code is structured. Check out the [migration guide](https://jbloomaus.github.io/SAELens/latest/migrating/) for more details.
|
|
34
|
+
|
|
31
35
|
## Tutorials
|
|
32
36
|
|
|
33
37
|
- [SAE Lens + Neuronpedia](tutorials/tutorial_2_0.ipynb)[](https://githubtocolab.com/jbloomAus/SAELens/blob/main/tutorials/tutorial_2_0.ipynb)
|
|
@@ -127,6 +127,7 @@ class TopKTrainingSAEConfig(TrainingSAEConfig):
|
|
|
127
127
|
"""
|
|
128
128
|
|
|
129
129
|
k: int = 100
|
|
130
|
+
aux_loss_coefficient: float = 1.0
|
|
130
131
|
|
|
131
132
|
@override
|
|
132
133
|
@classmethod
|
|
@@ -231,7 +232,7 @@ class TopKTrainingSAE(TrainingSAE[TopKTrainingSAEConfig]):
|
|
|
231
232
|
# top k living latents
|
|
232
233
|
recons = self.decode(auxk_acts)
|
|
233
234
|
auxk_loss = (recons - residual).pow(2).sum(dim=-1).mean()
|
|
234
|
-
return scale * auxk_loss
|
|
235
|
+
return self.cfg.aux_loss_coefficient * scale * auxk_loss
|
|
235
236
|
|
|
236
237
|
|
|
237
238
|
def _calculate_topk_aux_acts(
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|