Skip to content

Instantly share code, notes, and snippets.

@hanneshapke
Last active April 16, 2018 02:44
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save hanneshapke/b524a27594c520de47c7a0451b4ced78 to your computer and use it in GitHub Desktop.
Save hanneshapke/b524a27594c520de47c7a0451b4ced78 to your computer and use it in GitHub Desktop.
Plot the layer heatmap
def plot_heatmap(heatmap, height_ratio=0.05):
# calculating how often the vector should be repeated to display a height relative to the vector length
repeat_vector_n_times = int(heatmap.shape[0] * height_ratio)
plt.matshow([heatmap] * repeat_vector_n_times)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment