seems like guided backpropogation

  
      github.com
  
  
    utkuozbulak/pytorch-cnn-visualizations/blob/master/src/guided_backprop.py#L15 39

"""
import torch
from torch.nn import ReLU


from misc_functions import (get_params,
                        convert_to_grayscale,
                        save_gradient_images,
                        get_positive_negative_saliency)




class GuidedBackprop():
"""
   Produces gradients generated with guided back propagation from the given image
"""
def __init__(self, model, processed_im, target_class):
    self.model = model
    self.input_image = processed_im
    self.target_class = target_class
    self.gradients = None
    # Put model in evaluation mode
    self.model.eval()