rex_xai.lib

Classes

ReX

Module Contents

class rex_xai.lib.ReX(model, model_shape, device, mode, prediction_function=None)
Parameters:
args: rex_xai.input.config.CausalArgs
model
model_shape: List[int | str] | Tuple[int | str]
device: str | torch.device
mode: str
explanation = None
prediction_function = None
data = None
maps: rex_xai.responsibility.resp_maps.ResponsibilityMaps | None = None
stats: Dict[str, float] | None = None
set_tabular_data(path, data=None)
Parameters:

path (str)

set_input(input)
set_transformed_data(transformed_data)
Parameters:

transformed_data (torch.Tensor)

set_rgb_image(path)
Parameters:

path (str)

show_target()
get_default_prediction_function()
set_target()
set_prediction_function(function)
calculate_responsibility(args=None)
Parameters:

args (rex_xai.input.config.CausalArgs | None)

generate_explanation_object()
extract_sufficient_explanation()
extract_contrastive_explanation()
extract_complete_explanation()
analyse()
rerun_with(new_args)
Parameters:

new_args (rex_xai.input.config.CausalArgs)

show()