question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Guided Backpropagation

See original GitHub issue

Hi @keisen, thanks for putting this together. Is there a way to generate a guided backpropagation saliency map with a custom function in gradient-modifier?

Issue Analytics

  • State:closed
  • Created 3 years ago
  • Comments:8 (3 by maintainers)

github_iconTop GitHub Comments

2reactions
eyalercommented, Apr 10, 2021

maybe something like:

@tf.custom_gradient
def guidedRelu(x):
    def grad(dy):
        return tf.cast(dy>0,"float32") * tf.cast(x>0, "float32") * dy
    return tf.nn.relu(x), grad

def modify_model(model):
  for layer in [layer for layer in model.layers[1:] if hasattr(layer,"activation")]:
      if layer.activation == tf.keras.activations.relu:
          layer.activation = guidedRelu
  return model
1reaction
keisencommented, May 7, 2021

@ISipi , Thank you for your great suggestion! I’m going to include the warning comment in the code of guide-backprop.

Thanks!

(To be honest, I want to publish API and GettingStarted documentation on a website. It’s ideal if it included knowledge of visualization like above. If I could find the time, I would also do it. )

Read more comments on GitHub >

github_iconTop Results From Across the Web

Generalized way of Interpreting CNNs using Guided Gradient ...
Guided Backpropagation combines vanilla backpropagation at ReLUs (leveraging which elements are positive in the preceding feature map) with ...
Read more >
Understanding How ConvNets See
“Guided Backpropagation”. • Idea: neurons act like detectors of particular image features. • We are only interested in what image features the.
Read more >
Deep Learning: Guided BackPropagation - Leslie's Blog
Similar to Grad-CAM, guided backpropagation is a gradient-based visualization technique. Given an input image and a pretrained network, ...
Read more >
Guided Backpropagation - Coding Ninjas CodeStudio
A: Guided backpropagation is used to capture pixels that are detected by the neurons, discarding the pixels that suppress the neurons. When ...
Read more >
CNN Heat Maps: Gradients vs. DeconvNets vs. Guided ...
“Guided Backpropagation” uses vanilla backpropagation, except at the ReLUs. Guided Backpropagation combines vanilla backpropagation at ReLUs ( ...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found