File tree Expand file tree Collapse file tree 1 file changed +7
-3
lines changed Expand file tree Collapse file tree 1 file changed +7
-3
lines changed Original file line number Diff line number Diff line change @@ -15,13 +15,17 @@ We also provide a [demonstration](https://github.com/adamkarvonen/dictionary_lea
1515
1616# Using trained dictionaries
1717
18- You can load and used a pretrained dictionary as follows
18+ You can load and used a pretrained dictionary as follows.
19+ Also, look in utils.py to see more useful functions in order to load SAEs.
1920``` python
20- from dictionary_learning import AutoEncoder
21+ from dictionary_learning import AutoEncoder, utils
2122
22- # load autoencoder
23+ # load autoencoder (This specifically loads standard SAE, not other architectures)
2324ae = AutoEncoder.from_pretrained(" path/to/dictionary/weights" )
2425
26+ # or you can use this method from utils to load any architecture
27+ ae, config = utils.load_dictionary(" path/to/dictionary/weights" , device = device)
28+
2529# get NN activations using your preferred method: hooks, transformer_lens, nnsight, etc. ...
2630# for now we'll just use random activations
2731activations = torch.randn(64 , activation_dim)
You can’t perform that action at this time.
0 commit comments