Computational Physics, Linear Algebra, Python, Math, Matrix.
plt.imshow(reconstimg, cmap='gray') plt.show() We will now draw the reconstruction using different number of singular values. for i in [5, 10, 15, 20, 30, 50]: reconstimg = np.matrix(U[:, :i]) * np.diag(D[:i]) * np.matrix(V[:i, :]) plt.imshow(reconstimg, cmap='gray') title = "n = %s" % i