peal.sparse_dictionaries.probe_sparse_autoencoder.ProbeSAE¶
- class peal.sparse_dictionaries.probe_sparse_autoencoder.ProbeSAE[source]¶
Bases:
SparseDictionaryDictionary whose atoms are the rows of a classifier’s last linear layer.
- Parameters:
config (
ProbeSAEConfig) – Points to the checkpoint;fc.weightis cloned intoself.Wwith shape(n_classes, feature_dim), andself.muis a zero mean vector of lengthfeature_dimso callers treating the dictionary as centered get an identity offset.
Methods
No-op: the probe weights are fixed by the checkpoint.
No-op: the probe weights are fixed by the checkpoint.
Return the atoms as columns, i.e.
W.t()of shape(D, n_classes).Restore
self.Wfrom a file written bysave_on_disk().Save
{"W": self.W}withtorch.savetopath.Attributes
config- fit_from_dataloaders(dataloaders, feature_extractor)[source]¶
No-op: the probe weights are fixed by the checkpoint.
- load_from_disk(path)[source]¶
Restore
self.Wfrom a file written bysave_on_disk().