src.config module

Configuration dataclasses for the pipeline.

Defines configuration dataclasses for model loading, image generation, concept history, and result management.

class src.config.ConceptHistoryConfig(n_best_concepts: int, n_random_concepts: int)[source]

Bases: object

Configuration for concept history initialization.

n_best_concepts

Number of top-activating control concepts to include initially.

Type:

int

n_random_concepts

Number of random control concepts to include initially.

Type:

int

n_best_concepts: int
n_random_concepts: int
class src.config.HistoryManagingConfig(save_images: bool, save_histories: bool, save_directory: str)[source]

Bases: object

Configuration for saving experiment results.

save_images

Whether to save generated images to disk.

Type:

bool

save_histories

Whether to save generation and concept history to disk.

Type:

bool

save_directory

Directory path where results will be saved.

Type:

str

save_directory: str
save_histories: bool
save_images: bool
class src.config.ImageGenerationConfig(n_images: int, prompt_text: str)[source]

Bases: object

Configuration for image generation.

n_images

Number of images to generate per concept.

Type:

int

prompt_text

Base prompt text for image generation.

Type:

str

n_images: int
prompt_text: str
class src.config.LoadConfig(language_model_id: str, text_to_image_model_id: str, explained_model_id: str, language_model_kwargs: Mapping[str, Any], text_to_image_model_kwargs: Mapping[str, Any], explained_model_kwargs: Mapping[str, Any], model_swapping: bool)[source]

Bases: object

Configuration for loading machine learning models.

language_model_id

Identifier for the language model.

Type:

str

text_to_image_model_id

Identifier for the text-to-image model.

Type:

str

explained_model_id

Identifier for the model to explain.

Type:

str

language_model_kwargs

Additional arguments for language model initialization.

Type:

Mapping[str, Any]

text_to_image_model_kwargs

Additional arguments for text-to-image model initialization.

Type:

Mapping[str, Any]

explained_model_kwargs

Additional arguments for explained model initialization.

Type:

Mapping[str, Any]

model_swapping

Whether to enable GPU/CPU model swapping for memory efficiency.

Type:

bool

explained_model_id: str
explained_model_kwargs: Mapping[str, Any]
language_model_id: str
language_model_kwargs: Mapping[str, Any]
model_swapping: bool
text_to_image_model_id: str
text_to_image_model_kwargs: Mapping[str, Any]