Skip to content

Instantly share code, notes, and snippets.

@tachim
Created February 16, 2016 04:12
Show Gist options
  • Save tachim/1355d51e10befd4fe0ff to your computer and use it in GitHub Desktop.
Save tachim/1355d51e10befd4fe0ff to your computer and use it in GitHub Desktop.
def render_vector_sparsity(final_z):
zb = final_z.copy()
zb[zb != 0] = 1
wb = w.copy()
wb[wb != 0] = 1
plt.imshow(((zb != wb).reshape((50, 100))))
print (zb != wb).sum(), 'different'
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment