peal.adaptors.group_dro_v2.GroupDROv2Config

class peal.adaptors.group_dro_v2.GroupDROv2Config[source]

Bases: AdaptorConfig

Config for GroupDROv2.

Parameters:
  • model_path (str) – torch.load-able classifier to repair.

  • base_dir (str) – Run directory; an existing one is renamed with a timestamp suffix.

  • data (DataConfig) – Training/validation data, which must provide group labels.

  • unpoisoned_data (DataConfig, optional) – Second dataset whose test split is used for the unbiased evaluation.

  • training (TrainingConfig) – Supplies learning_rate, max_epochs, test_batch_size and early_stopping_goal ("worst_group_accuracy" or "average_group_accuracy").

  • task (TaskConfig) – Task of the classifier, passed on to the test dataloader.

  • alpha (float, optional) – Tail fraction of the BTL/greedy weighting. Default 0.2.

  • generalization_adjustment (float or list of float, optional) – Per-group adjustment C_g; a scalar is broadcast to all 4 groups.

  • automatic_adjustment (bool, optional) – Re-estimate the adjustment after every epoch from the train/validation generalization gap.

  • robust_step_size (float, optional) – Step size of the adversarial weight update. Default 0.01.

  • use_normalized_loss – Forwarded to GroupDroLossComputer.

  • btl – Forwarded to GroupDroLossComputer.

  • gamma – Forwarded to GroupDroLossComputer.

  • minimum_variational_weight – Forwarded to GroupDroLossComputer.

  • weight_decay (float, optional) – L2 penalty of the SGD optimizer. Default 5e-5.

  • track_test_acc (int, optional) – Evaluate on the unpoisoned test split every n epochs; None disables the intermediate test passes.

  • save_intermediate (bool, optional) – Write checkpoints/model_epoch<n>.cpl after every epoch.

Methods

Attributes

model_path: str
base_dir: str
data: DataConfig
unpoisoned_data: DataConfig = None
training: TrainingConfig
task: TaskConfig
alpha: float = 0.2
generalization_adjustment: float | list[float] = 0.0
automatic_adjustment: bool = False
robust_step_size: float = 0.01
use_normalized_loss: bool = False
btl: bool = False
weight_decay: float = 5e-05
gamma: float = 0.1
minimum_variational_weight: float = 0.0
track_test_acc: int = None
save_intermediate: bool = True