peal.sparse_dictionaries¶
Sparse dictionaries: concept bases over an encoder’s activation space.
A SparseDictionary (interfaces) is fitted on the activations of a
feature extractor (the diffusion autoencoder’s semantic encoder, CLIP, DINO,
…) and exposes its atoms through get_components so that DiDAE can
sweep, rank and edit along them. Implementations: probe SAEs, BatchTopK,
the MSAE (Matryoshka) and RA-SAE decompositions of published checkpoints,
SpLiCE, plain and SAE-filtered SVD and the supervised orthogonal Procrustes
dictionary. sparse_dictionary_factory.get_sparse_dictionary builds one
from its config, activation_cache memoises extracted activations,
sae_evaluation matches atoms to ground-truth attributes and utils
holds shared plotting helpers.
Submodules
Optional on-disk cache for encoder activations. |
|
BatchTopK sparse autoencoder as a PEAL sparse dictionary. |
|
PEAL's own batch top-K sparse autoencoder, its trainer and an activation source. |
|
Base config and interface shared by every PEAL sparse dictionary. |
|
Wrapper around the MSAE (Matryoshka Sparse Autoencoder) release for PEAL. |
|
Supervised concept dictionary fitted by orthogonal Procrustes analysis. |
|
Sparse dictionary made of the weight rows of a pretrained linear probe. |
|
Pretrained RA-SAE (Relaxed Archetypal SAE) dictionaries of DINOv2 token space. |
|
Ground-truth evaluation of sparse dictionaries (SAE / MSAE / SVD-filtered). |
|
Truncated SVD (PCA) as the simplest PEAL sparse dictionary. |
|
Factory that builds a |
|
SpLICE concept dictionary over CLIP image embeddings. |
|
SVD-prefiltered sparse autoencoders. |
|
Plotting helpers for evaluating sparse dictionaries against known attributes. |