peal.explainers.counterfactual_explainer.ACEConfig

class peal.explainers.counterfactual_explainer.ACEConfig[source]

Bases: ExplainerConfig

This class defines the config of a ACE, DiME or FastDiME explainer. This config is primarily for replicating results of related work.

Methods

Attributes

explainer_type: str = 'ACE'

The type of explanation that shall be used. Options: [‘counterfactual’, ‘lrp’]

subtype: str = 'ACE'
loss_fn: None | str = None
predictor: str | None | dict = None
generator: None | GeneratorConfig = None
data_config: None | DataConfig = None
attack_iterations: list | int = 100
sampling_time_fraction: list | float = 0.3
dist_l1: list | float = 0.0001
dist_l2: list | float = 0.0
sampling_inpaint: list | float = 0.2
sampling_dilation: list | int = 17
timestep_respacing: list | int = 50
distilled_predictor: None | str | dict = None
attempts: int = 1
clip_denoised: bool = True
batch_size: int = 1
gpu: str = '0'
save_images: bool = False
num_samples: int = 500000000000
cudnn_deterministic: bool = False
base_path: str = ''
exp_name: str = 'example_name'
seed: int = 4

The seed of all randomness to make results reproducible.

attack_method: str = 'PGD'
attack_epsilon: float = 255
attack_step: float = 1.0
attack_joint: bool = True
attack_joint_checkpoint: bool = False
attack_checkpoint_backward_steps: int = 1
attack_joint_shortcut: bool = False
dist_schedule: str = 'none'
sampling_stochastic: bool = True
chunks: int = 1
chunk: int = 0
merge_chunks: bool = False
y_target_goal_confidence: None | float = None
replace_with_activation: str = ''

leaky_relu, leaky_softplus

Type:

The activation function ReLU is replaced with

guided_iterations: object = 9999999
image_size: object = 128
l1_loss: object = 0.05
l2_loss: object = 0.0
l_perc: object = 30.0
l_perc_layer: object = 18
learn_sigma: object = True
merge_and_eval: object = False
model_path: object = 'models/ddpm-celeba.pt'
noise_schedule: object = 'linear'
num_batches: object = 1
num_channels: object = 128
num_chunks: object = 1
num_head_channels: object = -1
num_heads: object = 4
num_heads_upsample: object = -1
num_res_blocks: object = 2
oracle_path: object = 'models/oracle.pth'
output_path: object = '/path/to/results'
predict_xstart: object = False
query_label: object = 31
resblock_updown: object = True
rescale_learned_sigmas: object = False
rescale_timesteps: object = False
sampling_scale: object = 1.0
save_x_t: object = True
save_z_t: object = True
start_step: object = 60
target_label: object = -1
use_checkpoint: object = False
use_ddim: object = False
use_fp16: object = True
use_kl: object = False
use_logits: object = True
use_new_attention_order: object = False
use_sampling_on_x_t: object = True
use_scale_shift_norm: object = True
use_train: object = False
attention_resolutions: object = [32, 16, 8]
channel_mult: object = ''
class_cond: object = False
classifier_path: object = '/scratch/ppar/models/classifier.pth'
classifier_scales: object = [8, 10, 15]
data_dir: object = '/scratch/ppar/data/img_align_celeba/'
dataset: object = 'CelebA'
diffusion_steps: object = 500
dilation: object = 5
dropout: object = 0.0
masking_threshold: object = 0.15
method: object = 'fastdime'
n_samples: object = 1000
percentage: object = 0.5
scale_grads: object = False
self_optimized_masking: object = True
shortcut_label_name: object = 'Smiling'
task_label: object = 39
task_label_name: object = 'Young'
warmup_step: object = 30