Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
Normalize the visualization heat map
def norm_heatmap(heatmap):
# element-wise maximum calculation, basically setting all negative values to zero
heatmap = np.maximum(heatmap, 0)
# normalizing the heatmap to values between 0 and 1
norm_heatmap = heatmap / np.max(heatmap)
return norm_heatmap
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.