Last active
April 16, 2018 02:44
-
-
Save hanneshapke/4f7831704b359a7fb19fb6ae14e4c544 to your computer and use it in GitHub Desktop.
Normalize the visualization heat map
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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