peal.sparse_dictionaries.orthogonal_procrustes_dictionary.OrthogonalProcrustesDictionaryConfig

class peal.sparse_dictionaries.orthogonal_procrustes_dictionary.OrthogonalProcrustesDictionaryConfig[source]

Bases: SparseDictionaryConfig

Config of OrthogonalProcrustesDictionary.

Parameters:
  • n_components (int or None) – Number of output directions K. None infers it from the targets (number of columns of a multi-hot y or max(y) + 1 for indices).

  • sparse_dictionaries_type (str) – Fixed to "OrthogonalProcrustesDictionary" for the factory.

  • ending (str) – File ending of the saved weights.

  • task (dict or None) – TaskConfig fields applied to the datasets while extracting features, so batch[1] yields the attributes to fit on.

  • orthogonal (bool) – True solves the orthogonal Procrustes problem (one orthonormal set of atoms); False fits each attribute direction independently as the unit-norm class-mean-difference direction. See the attribute note below for why the free fit is preferable with many attributes.

Methods

Attributes

ending

n_components

orthogonal

fit every attribute direction on its own (the row of the cross-covariance Y^T X, i.e. the class-mean-difference direction, unit norm) instead of one orthonormal set.

sparse_dictionaries_type

task

n_components: int | None = 2
sparse_dictionaries_type: str = 'OrthogonalProcrustesDictionary'
ending: str = '.npz'
task: None | dict = None
orthogonal: bool = True

fit every attribute direction on its own (the row of the cross-covariance Y^T X, i.e. the class-mean-difference direction, unit norm) instead of one orthonormal set. Orthonormality distorts the atoms once K is large: with 40 CelebA attributes the orthogonal Male atom has cosine 0.61 to the Male atom of the 2-attribute fit, and its edit flips the student 14% of the time where the 2-attribute atom flips 59% (2026-09-14). The 2-attribute fit is unaffected either way.

Type:

False