Skip to content

Instantly share code, notes, and snippets.

@bmcfee
Last active December 23, 2020 12:13
Show Gist options
  • Save bmcfee/a378bfe31a75769c583e to your computer and use it in GitHub Desktop.
Save bmcfee/a378bfe31a75769c583e to your computer and use it in GitHub Desktop.
Display the source blob
Display the rendered blob
Raw
Sorry, this is too big to display.
@vighneshbirodkar
Copy link

Hello @bmcfee. Thanks for your work. This proved to be very helpful to me and @amueller.

There is a small bug in the code. For scaling back to the original scale you should be doing

Z =  Z * rescale + Xmin

with the current code the returned low rank representation is not in the correct scale. However, matplotlib displays it correctly as it rescales images before displaying them

@bmcfee
Copy link
Author

bmcfee commented Mar 16, 2016

👍 confirmed. Thanks!

@lseffer
Copy link

lseffer commented Jul 11, 2017

Thanks for this, great work! If you want to omit using scipy.weave you can replace the contents of __l1_prox with

Y = np.zeros_like(A)
Y[A-r>0] = A[A-r>0]-r
Y[A+r<=0] = A[A+r<=0]+r

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment