Skip to content

Instantly share code, notes, and snippets.

@davidrichards
Created May 22, 2015 00:23
Show Gist options
  • Save davidrichards/b8eafd145df36c10d279 to your computer and use it in GitHub Desktop.
Save davidrichards/b8eafd145df36c10d279 to your computer and use it in GitHub Desktop.
SVD
U, s, V = np.linalg.svd(a, full_matrices=False)
U.shape, V.shape, s.shape
S = np.diag(s)
np.allclose(a, np.dot(U, np.dot(S, V)))
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment