pulsatrix 1.1.0
Loading...
Searching...
No Matches
pulsatrix::Imputation Struct Reference

How a removed feature is filled in when perturbing an input. More...

#include <explanation_metrics.hpp>

Public Types

enum class  Kind { Constant , NoisyLinear }
 

Static Public Member Functions

static Imputation Constant (float value=0.0f)
 Every removed element becomes value.
 
static Imputation NoisyLinear (float noise_std=0.01f, uint64_t seed=0)
 ROAD (Rong et al., "A Consistent and Efficient Evaluation Strategy for Attribution Methods", ICML 2022): each removed pixel becomes the weighted average of its neighbors in its (H, W) plane – direct neighbors 1/6, diagonal ones 1/12, solved jointly for all removed pixels – plus Gaussian noise. A constant fill leaks which pixels were removed through the shape of the hole; this doesn't.
 

Public Attributes

Kind kind = Kind::Constant
 
float value = 0.0f
 Constant.
 
float noise_std = 0.01f
 NoisyLinear.
 
uint64_t seed = 0
 NoisyLinear.
 

Detailed Description

How a removed feature is filled in when perturbing an input.

Member Enumeration Documentation

◆ Kind

enum class pulsatrix::Imputation::Kind
strong
Enumerator
Constant 
NoisyLinear 

Member Function Documentation

◆ Constant()

static Imputation pulsatrix::Imputation::Constant ( float  value = 0.0f)
inlinestatic

Every removed element becomes value.

◆ NoisyLinear()

static Imputation pulsatrix::Imputation::NoisyLinear ( float  noise_std = 0.01f,
uint64_t  seed = 0 
)
inlinestatic

ROAD (Rong et al., "A Consistent and Efficient Evaluation Strategy for Attribution Methods", ICML 2022): each removed pixel becomes the weighted average of its neighbors in its (H, W) plane – direct neighbors 1/6, diagonal ones 1/12, solved jointly for all removed pixels – plus Gaussian noise. A constant fill leaks which pixels were removed through the shape of the hole; this doesn't.

Note
Meant for images: the last two dimensions are treated as (H, W).

Member Data Documentation

◆ kind

Kind pulsatrix::Imputation::kind = Kind::Constant

◆ noise_std

float pulsatrix::Imputation::noise_std = 0.01f

NoisyLinear.

◆ seed

uint64_t pulsatrix::Imputation::seed = 0

NoisyLinear.

◆ value

float pulsatrix::Imputation::value = 0.0f

Constant.


The documentation for this struct was generated from the following file: