def svd_compressed(a, k, n_power_iter=0, seed=None, name=None):
 comp = compression_matrix(a, k, n_power_iter=n_power_iter, seed=seed)
 a_compressed = comp.dot(a)
 (v, s, u) = tsqr(a_compressed.T, name, compute_svd=True)
 u = comp.T.dot(u)
 v = v.T
 u = u[:, :k]
 s = s[:k]
 v = v[:k, :]
 return (u, s, v)

def svd_compressed ( a , k , n_power_iter = 0 , seed = None , name = None ) : comp = compression_matrix ( a , k , n_power_iter = n_power_iter , seed = seed ) a_compressed = comp . dot ( a ) ( v , s , u ) = tsqr ( a_compressed . T , name , compute_svd = True ) u = comp . T . dot ( u ) v = v . T u = u [ : , : k ] s = s [ : k ] v = v [ : k , : ] return ( u , s , v )
randomly compressed rank-k thin singular value decomposition .