peal.adaptors.clarc.ClArCConfig¶
- class peal.adaptors.clarc.ClArCConfig[source]¶
Bases:
AdaptorConfigConfiguration shared by the ClArC adaptors.
- Parameters:
model_path (
str) –torch.load-able predictor; a wrapping.modelattribute is unwrapped.base_dir (
str) – Output directory for csv results, corrected models and logs.data (
DataConfig) – Training / validation data withhas_confoundergroup labels; ifdata.spray_label_fileis set the labels are treated as SpRAy (estimated) rather than true annotations.unpoisoned_data (
DataConfig, optional) – Extra clean test set evaluated as"unpoisoned-test".training (
TrainingConfig) – Supplieslearning_rate,max_epochsandtest_batch_size.task (
TaskConfig) – Task description handed to the dataloader factory.projection_type (
str, default"pcav") – CAV estimator:"pcav"(pattern CAV),"svm"(LinearSVC) or"simple"(mean difference projection, P-ClArC only).layer_index (
listofint, default[-1]) – Layers (indices into the flattened child list) at which to correct;0means the input.correction_strength (
listoffloat, default[1]) – Scaling of the projection (P-ClArC) or RR loss weight (RR-ClArC).attacked_class (
int, default0) – Class whose samples are used to estimate the CAV; None uses all.cav_mode (
str, optional) – How conv activations are pooled before the CAV:"cavs_max","cavs_mean"or None (flatten everything).save_model (
bool, defaultTrue) – Save every corrected model intobase_dir.max_samples (
int, default999999) – Cap on confounder / non-confounder activations collected per group.reverse_cav_direction (
bool, defaultFalse) – Swap the group labels before estimating the CAV.
Methods
Attributes
The category of the config.
adaptor_typeThe type of adaptor that shall be used.
- category: str = 'adaptor'¶
The category of the config. Can not be changed for adaptor. This is also necessary to identify which pydantic class to use when loading from yaml.
- data: DataConfig¶
- unpoisoned_data: DataConfig = None¶
- training: TrainingConfig¶
- task: TaskConfig¶