Visualizing the Gradients as heat map in Tensorflow 2
问题 I am working on a task to generate heatmap by guided backpropagation. I have overridden the original Relu and obtained the gradient for each parameter. However, I am not sure what should I do next. Your assistance is appreciated! Thank you! Here is my code: I first use @tf.RegisterGradient("GuidedRelu") like: def _GuidedReluGrad(op, grad): gate_f = tf.cast(op.outputs[0] > 0, "float32") gate_R = tf.cast(grad > 0, "float32") return gate_f * gate_R * grad Then, I obtained grads by: with g