sae-lens 6.1.0__py3-none-any.whl → 6.2.0__py3-none-any.whl

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/__init__.py CHANGED
@@ -1,5 +1,5 @@
1
1
  # ruff: noqa: E402
2
- __version__ = "6.1.0"
2
+ __version__ = "6.2.0"
3
3
 
4
4
  import logging
5
5
 
sae_lens/saes/topk_sae.py CHANGED
@@ -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(
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.3
2
2
  Name: sae-lens
3
- Version: 6.1.0
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)[![Open In Colab](https://colab.research.google.com/assets/colab-badge.svg)](https://githubtocolab.com/jbloomAus/SAELens/blob/main/tutorials/tutorial_2_0.ipynb)
@@ -1,4 +1,4 @@
1
- sae_lens/__init__.py,sha256=vM8ncfMn8YHyl1CHj48L2pG6FWJ54--3blxrY3WtJww,3073
1
+ sae_lens/__init__.py,sha256=ByxdNdLeg_pvK89IX1lHa6iHgs2ab-UulX55Y0hUhY4,3073
2
2
  sae_lens/analysis/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
3
3
  sae_lens/analysis/hooked_sae_transformer.py,sha256=Eyg1Y2hVIHNuiiLOCTgzstOuW6iA-7hPHqaGR8y_vMs,13809
4
4
  sae_lens/analysis/neuronpedia_integration.py,sha256=MrENqc81Mc2SMbxGjbwHzpkGUCAFKSf0i4EdaUF2Oj4,18707
@@ -20,7 +20,7 @@ sae_lens/saes/gated_sae.py,sha256=qcmM9JwBA8aZR8z_IRHV1_gQX-q_63tKewWXRnhdXuo,89
20
20
  sae_lens/saes/jumprelu_sae.py,sha256=3xkhBcCol2mEpIBLceymCpudocm2ypOjTeTXbpiXoA4,10794
21
21
  sae_lens/saes/sae.py,sha256=McpF4pTh70r6SQUbHFm0YQ9X2c2qPULBUSd_YmnEk4Y,38284
22
22
  sae_lens/saes/standard_sae.py,sha256=9UqYyYtQuThYxXKNaDjYcyowpOx2-7cShG-TeUP6JCQ,5940
23
- sae_lens/saes/topk_sae.py,sha256=CH8LGtSQOrbA_xOdqZUkDCG7TOS81CeQJeyLEpPricU,8616
23
+ sae_lens/saes/topk_sae.py,sha256=CXMBI6CFvI5829bOhoQ350VXR9d8uFHUDlULTIWHXoU,8686
24
24
  sae_lens/tokenization_and_batching.py,sha256=oUAscjy_LPOrOb8_Ty6eLAcZ0B3HB_wiWjWktgolhG0,4314
25
25
  sae_lens/training/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
26
26
  sae_lens/training/activation_scaler.py,sha256=seEE-2Qd2JMHxqgnsNWPt-DGtYGZxWPnOwCGuVNSOtI,1719
@@ -32,7 +32,7 @@ sae_lens/training/types.py,sha256=qSjmGzXf3MLalygG0psnVjmhX_mpLmL47MQtZfe7qxg,81
32
32
  sae_lens/training/upload_saes_to_huggingface.py,sha256=r_WzI1zLtGZ5TzAxuG3xa_8T09j3zXJrWd_vzPsPGkQ,4469
33
33
  sae_lens/tutorial/tsea.py,sha256=fd1am_XXsf2KMbByDapJo-2qlxduKaa62Z2qcQZ3QKU,18145
34
34
  sae_lens/util.py,sha256=mCwLAilGMVo8Scm7CIsCafU7GsfmBvCcjwmloI4Ly7Y,1718
35
- sae_lens-6.1.0.dist-info/LICENSE,sha256=DW6e-hDosiu4CfW0-imI57sV1I5f9UEslpviNQcOAKs,1069
36
- sae_lens-6.1.0.dist-info/METADATA,sha256=AjB2PWa1s8CCluq-_jjeBj7OsCSswoRP5GEGGSoNjHo,5323
37
- sae_lens-6.1.0.dist-info/WHEEL,sha256=b4K_helf-jlQoXBBETfwnf4B04YC67LOev0jo4fX5m8,88
38
- sae_lens-6.1.0.dist-info/RECORD,,
35
+ sae_lens-6.2.0.dist-info/LICENSE,sha256=DW6e-hDosiu4CfW0-imI57sV1I5f9UEslpviNQcOAKs,1069
36
+ sae_lens-6.2.0.dist-info/METADATA,sha256=Fqsq0scF5Uia0YBmeZQwVi4m4DX16_Ck-cKokbuch7U,5555
37
+ sae_lens-6.2.0.dist-info/WHEEL,sha256=b4K_helf-jlQoXBBETfwnf4B04YC67LOev0jo4fX5m8,88
38
+ sae_lens-6.2.0.dist-info/RECORD,,