innvestigate.utils

innvestigate.utils.model_wo_softmax(*args, **kwargs)
innvestigate.utils.to_list(l)
class innvestigate.utils.BatchSequence(Xs, batch_size=32)
class innvestigate.utils.TargetAugmentedSequence(sequence, augment_f)
innvestigate.utils.preprocess_images(images, color_coding=None)
innvestigate.utils.postprocess_images(images, color_coding=None, channels_first=None)

Visualizations

innvestigate.utils.visualizations.project(X, output_range=(0, 1), absmax=None, input_is_postive_only=False)
innvestigate.utils.visualizations.heatmap(X, cmap_type='seismic', reduce_op='sum', reduce_axis=-1, **kwargs)
innvestigate.utils.visualizations.graymap(X, **kwargs)
innvestigate.utils.visualizations.gamma(X, gamma=0.5, minamp=0, maxamp=None)

Apply gamma correction to an input array X while maintaining the relative order of entries, also for negative vs positive values in X. the fxn firstly determines the max amplitude in both positive and negative direction and then applies gamma scaling to the positive and negative values of the array separately, according to the common amplitude.

Parameters:
  • gamma – the gamma parameter for gamma scaling
  • minamp – the smallest absolute value to consider. if not given assumed to be zero (neutral value for relevance, min value for saliency, …). values above and below minamp are treated separately.
  • maxamp – the largest absolute value to consider relative to the neutral value minamp if not given determined from the given data.