peal.sparse_dictionaries.splice_decomposition.SpLICEDecompositionConfig

class peal.sparse_dictionaries.splice_decomposition.SpLICEDecompositionConfig[source]

Bases: SparseDictionaryConfig

Configuration for SpLICE-based sparse decomposition.

Uses a pretrained CLIP model and SpLICE vocabulary to decompose image embeddings into sparse concept weights. No training required.

Parameters:
  • clip_model (str) – SpLICE model name of the CLIP backbone ("clip:ViT-L/14"); it must be the encoder the generator conditions on.

  • vocabulary (str) – Name of the SpLICE concept vocabulary ("laion").

  • vocabulary_size (int) – Number of vocabulary entries to keep; -1 uses the full vocabulary.

  • l1_penalty (float) – LASSO sparsity penalty of the SpLICE solver.

  • solver (str) – "skl" (scikit-learn) or "admm".

  • ending (str) – File extension of the saved state.

  • n_components (int or None) – Set from the vocabulary size once the SpLICE model is loaded.

  • component_strings (list or None) – Concept names DiDAE should target when editing.

  • opposite_component_strings (list or None) – Opposite concepts used for DDPM-inversion benchmarking.

  • benchmark_ddpm_inversion (bool) – If True the explainer edits with text prompts instead of z_sem.

Methods

Attributes

sparse_dictionaries_type: str = 'SpLICEDecomposition'
clip_model: str = 'clip:ViT-L/14'
vocabulary: str = 'laion'
vocabulary_size: int = -1
l1_penalty: float = 0.15
solver: str = 'skl'
ending: str = '.pt'
n_components: int | None = None
component_strings: list | None = None
opposite_component_strings: list | None = None
benchmark_ddpm_inversion: bool = False