singular value decomposition matrix factorization
play

Singular Value Decomposition (matrix factorization) Singular Value - PowerPoint PPT Presentation

Singular Value Decomposition (matrix factorization) Singular Value Decomposition The SVD is a factorization of a matrix into = where is a orthogonal matrix, is a orthogonal


  1. Singular Value Decomposition (matrix factorization)

  2. Singular Value Decomposition The SVD is a factorization of a ๐‘›ร—๐‘œ matrix into ๐‘ฉ = ๐‘ฝ ๐šป ๐‘พ ๐‘ผ where ๐‘ฝ is a ๐‘›ร—๐‘› orthogonal matrix, ๐‘พ ๐‘ผ is a ๐‘œร—๐‘œ orthogonal matrix and ๐šป is a ๐‘›ร—๐‘œ diagonal matrix. For a square matrix ( ๐’ = ๐’): ๐œ & โ‰ฅ ๐œ ) โ‰ฅ ๐œ * โ€ฆ ( ๐œ & โ‹ฎ โ€ฆ โ‹ฎ โ€ฆ ๐ฐ & โ€ฆ ๐‘ฉ = ๐’— & โ€ฆ ๐’— ' โ‹ฎ โ‹ฎ โ‹ฎ โ‹ฑ ( โ‹ฎ โ€ฆ โ‹ฎ โ€ฆ ๐ฐ ' โ€ฆ ๐œ ' ( ๐œ & โ‹ฎ โ€ฆ โ‹ฎ โ‹ฎ โ€ฆ โ‹ฎ ๐‘ฉ = ๐’— & โ€ฆ ๐’— ' ๐’˜ & โ€ฆ ๐’˜ ' โ‹ฑ โ‹ฎ โ€ฆ โ‹ฎ โ‹ฎ โ€ฆ โ‹ฎ ๐œ '

  3. Reduced SVD What happens when ๐‘ฉ is not a square matrix? 1) ๐’ > ๐’ ๐œ " โ‹ฑ % โ‹ฎ โ€ฆ โ‹ฎ โ€ฆ โ‹ฎ โ€ฆ ๐ฐ " โ€ฆ ๐œ # ๐‘ฉ = ๐‘ฝ ๐šป ๐‘พ ๐‘ผ = ๐’— " โ€ฆ ๐’— # โ€ฆ ๐’— $ โ‹ฎ โ‹ฎ โ‹ฎ 0 % โ‹ฎ โ€ฆ โ‹ฎ โ€ฆ โ‹ฎ โ€ฆ ๐ฐ # โ€ฆ โ‹ฎ 0 ๐‘œร—๐‘œ ๐‘›ร—๐‘› ๐‘›ร—๐‘œ We can instead re-write the above as: ๐‘ฉ = ๐‘ฝ ๐‘บ ๐šป ๐‘บ ๐‘พ ๐‘ผ Where ๐‘ฝ ๐‘บ is a ๐‘›ร—๐‘œ matrix and ๐šป ๐‘บ is a ๐‘œร—๐‘œ matrix

  4. Reduced SVD 2) ๐’ > ๐’ % โ€ฆ ๐ฐ " โ€ฆ ๐œ & 0 โ‹ฎ โ‹ฎ โ‹ฎ โ‹ฎ โ€ฆ โ‹ฎ ๐‘ฉ = ๐‘ฝ ๐šป ๐‘พ ๐‘ผ = % โ‹ฑ โ‹ฑ โ€ฆ ๐ฐ $ โ€ฆ ๐’— " โ€ฆ ๐’— # ๐œ . 0 โ‹ฎ โ‹ฎ โ‹ฎ โ‹ฎ โ€ฆ โ‹ฎ % โ€ฆ ๐ฐ # โ€ฆ ๐‘›ร—๐‘› ๐‘›ร—๐‘œ ๐‘œร—๐‘œ We can instead re-write the above as: ๐‘ผ ๐‘ฉ = ๐‘ฝ ๐šป ๐‘บ ๐‘พ ๐‘บ where ๐‘พ ๐‘บ is a ๐‘œร—๐‘› matrix and ๐šป ๐‘บ is a ๐‘›ร—๐‘› matrix In general: ๐‘ฝ ๐‘บ is a ๐‘›ร—๐‘™ matrix ๐‘ผ ๐‘ฉ = ๐‘ฝ ๐‘บ ๐šป ๐‘บ ๐‘พ ๐‘บ ๐‘™ = min(๐‘›, ๐‘œ) ๐šป ๐‘บ is a ๐‘™ ร—๐‘™ matrix ๐‘พ ๐‘บ is a ๐‘œร—๐‘™ matrix

  5. Letโ€™s take a look at the product ๐šป ๐‘ผ ๐šป, where ๐šป has the singular values of a ๐‘ฉ , a ๐‘›ร—๐‘œ matrix. ๐œ " โ‹ฑ ๐œ "$ ๐œ " 0 ๐œ # ๐šป ๐‘ผ ๐šป = = โ‹ฑ โ‹ฑ โ‹ฑ 0 ๐œ #$ ๐œ # 0 โ‹ฎ 0 ๐‘› > ๐‘œ ๐‘œร—๐‘œ ๐‘œร—๐‘› ๐‘›ร—๐‘œ ๐œ "$ ๐œ " 0 โ‹ฑ โ‹ฑ โ‹ฑ ๐œ " 0 ๐œ %$ ๐œ % 0 ๐šป ๐‘ผ ๐šป = = โ‹ฑ โ‹ฑ 0 0 0 ๐œ % 0 โ‹ฎ โ‹ฑ โ‹ฑ 0 0 0 ๐‘›ร—๐‘œ ๐‘œ > ๐‘› ๐‘œร—๐‘› ๐‘œร—๐‘œ

  6. Assume ๐‘ฉ with the singular value decomposition ๐‘ฉ = ๐‘ฝ ๐šป ๐‘พ ๐‘ผ . Letโ€™s take a look at the eigenpairs corresponding to ๐‘ฉ ๐‘ผ ๐‘ฉ: ๐‘ฉ ๐‘ผ ๐‘ฉ = ๐‘ฝ ๐šป ๐‘พ ๐‘ผ ๐‘ผ ๐‘ฝ ๐šป ๐‘พ ๐‘ผ ๐‘พ ๐‘ผ ๐‘ผ ๐šป ๐‘ผ ๐‘ฝ ๐‘ผ ๐‘ฝ ๐šป ๐‘พ ๐‘ผ = ๐‘พ๐šป ๐‘ผ ๐‘ฝ ๐‘ผ ๐‘ฝ ๐šป ๐‘พ ๐‘ผ = ๐‘พ ๐šป ๐‘ผ ๐šป ๐‘พ ๐‘ผ Hence ๐‘ฉ ๐‘ผ ๐‘ฉ = ๐‘พ ๐šป ๐Ÿ‘ ๐‘พ ๐‘ผ Recall that columns of ๐‘พ are all linear independent (orthogonal matrix), then from diagonalization ( ๐‘ช = ๐’€๐‘ฌ๐’€ 1๐Ÿ ), we get: โ€ข the columns of ๐‘พ are the eigenvectors of the matrix ๐‘ฉ ๐‘ผ ๐‘ฉ โ€ข The diagonal entries of ๐šป ๐Ÿ‘ are the eigenvalues of ๐‘ฉ ๐‘ผ ๐‘ฉ Letโ€™s call ๐œ‡ the eigenvalues of ๐‘ฉ ๐‘ผ ๐‘ฉ, then ๐œ 3) = ๐œ‡ 3

  7. In a similar way, ๐‘ฝ ๐šป ๐‘พ ๐‘ผ ๐‘ผ ๐‘ฉ๐‘ฉ ๐‘ผ = ๐‘ฝ ๐šป ๐‘พ ๐‘ผ ๐‘พ ๐‘ผ ๐‘ผ ๐šป ๐‘ผ ๐‘ฝ ๐‘ผ = ๐‘ฝ ๐šป ๐‘พ ๐‘ผ ๐‘พ๐šป ๐‘ผ ๐‘ฝ ๐‘ผ = ๐‘ฝ๐šป ๐šป ๐‘ผ ๐‘ฝ ๐‘ผ ๐‘ฝ ๐šป ๐‘พ ๐‘ผ Hence ๐‘ฉ๐‘ฉ ๐‘ผ = ๐‘ฝ ๐šป ๐Ÿ‘ ๐‘ฝ ๐‘ผ Recall that columns of ๐‘ฝ are all linear independent (orthogonal matrices), then from diagonalization ( ๐‘ช = ๐’€๐‘ฌ๐’€ 1๐Ÿ ), we get: โ€ข The columns of ๐‘ฝ are the eigenvectors of the matrix ๐‘ฉ๐‘ฉ ๐‘ผ

  8. How can we compute an SVD of a matrix A ? 1. Evaluate the ๐‘œ eigenvectors ๐ฐ 3 and eigenvalues ๐œ‡ 3 of ๐‘ฉ ๐‘ผ ๐‘ฉ 2. Make a matrix ๐‘พ from the normalized vectors ๐ฐ 3 . The columns are called โ€œright singular vectorsโ€. โ‹ฎ โ€ฆ โ‹ฎ ๐‘พ = ๐ฐ & โ€ฆ ๐ฐ ' โ‹ฎ โ€ฆ โ‹ฎ 3. Make a diagonal matrix from the square roots of the eigenvalues. ๐œ & ๐šป = ๐œ 3 = ๐œ‡ 3 and ๐œ & โ‰ฅ ๐œ ) โ‰ฅ ๐œ * โ€ฆ โ‹ฑ ๐œ ' 4. Find ๐‘ฝ: ๐‘ฉ = ๐‘ฝ ๐šป ๐‘พ ๐‘ผ โŸน ๐‘ฝ ๐šป = ๐‘ฉ ๐‘พ โŸน ๐‘ฝ = ๐‘ฉ ๐‘พ ๐šป 1๐Ÿ . The columns are called the โ€œleft singular vectorsโ€.

  9. True or False? ๐‘ฉ has the singular value decomposition ๐‘ฉ = ๐‘ฝ ๐šป ๐‘พ ๐‘ผ . โ€ข The matrices ๐‘ฝ and ๐‘พ are not singular โ€ข The matrix ๐šป can have zero diagonal entries ๐‘ฝ ) = 1 โ€ข โ€ข The SVD exists when the matrix ๐‘ฉ is singular โ€ข The algorithm to evaluate SVD will fail when taking the square root of a negative eigenvalue

  10. Singular values are always non-negative Singular values cannot be negative since ๐‘ฉ ๐‘ผ ๐‘ฉ is a positive semi- definite matrix (for real matrices ๐‘ฉ ) โ€ข A matrix is positive definite if ๐’š ๐‘ผ ๐‘ช๐’š > ๐Ÿ for โˆ€๐’š โ‰  ๐Ÿ โ€ข A matrix is positive semi-definite if ๐’š ๐‘ผ ๐‘ช๐’š โ‰ฅ ๐Ÿ for โˆ€๐’š โ‰  ๐Ÿ โ€ข What do we know about the matrix ๐‘ฉ ๐‘ผ ๐‘ฉ ? ๐’š ๐‘ผ ๐‘ฉ ๐‘ผ ๐‘ฉ ๐’š = (๐‘ฉ๐’š) ๐‘ผ ๐‘ฉ๐’š = ๐Ÿ‘ โ‰ฅ 0 ๐‘ฉ๐’š ๐Ÿ‘ โ€ข Hence we know that ๐‘ฉ ๐‘ผ ๐‘ฉ is a positive semi-definite matrix โ€ข A positive semi-definite matrix has non-negative eigenvalues ๐‘ช๐’š = ๐œ‡๐’š โŸน ๐’š ๐‘ผ ๐‘ช๐’š = ๐’š ๐‘ผ ๐œ‡ ๐’š = ๐œ‡ ๐’š ๐Ÿ‘ ๐Ÿ‘ โ‰ฅ 0 โŸน ๐œ‡ โ‰ฅ 0

  11. Cost of SVD The cost of an SVD is proportional to ๐’ ๐’ ๐Ÿ‘ + ๐’ ๐Ÿ’ where the constant of proportionality constant ranging from 4 to 10 (or more) depending on the algorithm. ๐ท 456 = ๐›ฝ ๐‘› ๐‘œ ) + ๐‘œ * = ๐‘ƒ ๐‘œ * ๐ท .78.78 = ๐‘œ * = ๐‘ƒ ๐‘œ * ๐ท 9: = 2๐‘œ * /3 = ๐‘ƒ ๐‘œ *

  12. SVD summary: โ€ข The SVD is a factorization of a ๐‘›ร—๐‘œ matrix into ๐‘ฉ = ๐‘ฝ ๐šป ๐‘พ ๐‘ผ where ๐‘ฝ is a ๐‘›ร—๐‘› orthogonal matrix, ๐‘พ ๐‘ผ is a ๐‘œร—๐‘œ orthogonal matrix and ๐šป is a ๐‘›ร—๐‘œ diagonal matrix. ๐‘ผ , where ๐‘ฝ ๐‘บ is a ๐‘›ร—๐‘™ matrix, ๐šป ๐‘บ is a ๐‘™ ร—๐‘™ matrix, โ€ข In reduced form: ๐‘ฉ = ๐‘ฝ ๐‘บ ๐šป ๐‘บ ๐‘พ ๐‘บ and ๐‘พ ๐‘บ is a ๐‘œร—๐‘™ matrix, and ๐‘™ = min(๐‘›, ๐‘œ) . โ€ข The columns of ๐‘พ are the eigenvectors of the matrix ๐‘ฉ ๐‘ผ ๐‘ฉ , denoted the right singular vectors. The columns of ๐‘ฝ are the eigenvectors of the matrix ๐‘ฉ๐‘ฉ ๐‘ผ , denoted the left singular โ€ข vectors. โ€ข The diagonal entries of ๐šป ๐Ÿ‘ are the eigenvalues of ๐‘ฉ ๐‘ผ ๐‘ฉ. ๐œ & = ๐œ‡ & are called the singular values. โ€ข The singular values are always non-negative (since ๐‘ฉ ๐‘ผ ๐‘ฉ is a positive semi-definite matrix, the eigenvalues are always ๐œ‡ โ‰ฅ 0 )

  13. Singular Value Decomposition (applications)

  14. 1) Determining the rank of a matrix Suppose ๐‘ฉ is a ๐‘›ร—๐‘œ rectangular matrix where ๐‘› > ๐‘œ : ๐œ " โ‹ฑ ( โ‹ฎ โ€ฆ โ‹ฎ โ€ฆ โ‹ฎ โ€ฆ ๐ฐ " โ€ฆ ๐œ ' ๐‘ฉ = ๐’— " โ€ฆ ๐’— ' โ€ฆ ๐’— # โ‹ฎ โ‹ฎ โ‹ฎ 0 ( โ‹ฎ โ€ฆ โ‹ฎ โ€ฆ โ‹ฎ โ€ฆ ๐ฐ ' โ€ฆ โ‹ฎ 0 ( โ‹ฎ โ€ฆ โ‹ฎ โ€ฆ ๐œ " ๐ฐ " โ€ฆ ( + ๐œ ) ๐’— ) ๐ฐ ) ( + โ‹ฏ + ๐œ ' ๐’— ' ๐ฐ ' ( ๐‘ฉ = = ๐œ " ๐’— " ๐ฐ " ๐’— " โ€ฆ ๐’— ' โ‹ฎ โ‹ฎ โ‹ฎ ( โ‹ฎ โ€ฆ โ‹ฎ โ€ฆ ๐œ ' ๐ฐ ' โ€ฆ $ % ๐‘ฉ = = ๐œ ! ๐’— ! ๐ฐ ! !"# % what is rank ๐‘ฉ # = ? ๐‘ฉ # = ๐œ # ๐’— # ๐ฐ # A) 1 B) n C) depends on the matrix In general, rank ๐‘ฉ & = ๐‘™ D) NOTA

  15. Rank of a matrix For general rectangular matrix ๐‘ฉ with dimensions ๐‘›ร—๐‘œ , the reduced SVD is: ๐‘ผ ๐‘ฉ = ๐‘ฝ ๐‘บ ๐šป ๐‘บ ๐‘พ ๐‘บ ๐‘™ = min(๐‘›, ๐‘œ) H ๐‘™ ร—๐‘œ ๐‘›ร—๐‘œ ๐‘›ร—๐‘™ ( ๐‘ฉ = I ๐œ 3 ๐’— 3 ๐ฐ 3 ๐‘™ร—๐‘™ 3G& ๐œ # ๐œ # โ‹ฑ 0 ๐œ & ๐œฏ = โ‹ฑ โ‹ฑ ๐œฏ = ๐œ & 0 โ€ฆ 0 0 0 โ‹ฑ โ‹ฎ 0 If ๐œ & โ‰  0 โˆ€๐‘— , then rank ๐‘ฉ = ๐‘™ (Full rank matrix) In general, rank ๐‘ฉ = ๐’” , where ๐’” is the number of non-zero singular values ๐œ & ๐‘  < ๐‘™ (Rank deficient)

  16. Rank of a matrix โ€ข The rank of A equals the number of non-zero singular values which is the same as the number of non-zero diagonal elements in ฮฃ . โ€ข Rounding errors may lead to small but non-zero singular values in a rank deficient matrix, hence the rank of a matrix determined by the number of non-zero singular values is sometimes called โ€œeffective rankโ€. โ€ข The right-singular vectors (columns of ๐‘พ ) corresponding to vanishing singular values span the null space of A . โ€ข The left-singular vectors (columns of ๐‘ฝ ) corresponding to the non-zero singular values of A span the range of A .

  17. 2) Pseudo-inverse โ€ข Problem: if A is rank-deficient, ๐šป is not be invertible โ€ข How to fix it: Define the Pseudo Inverse โ€ข Pseudo-Inverse of a diagonal matrix : & O & , if ๐œ 3 โ‰  0 ๐šป N 3 = N 0, if ๐œ 3 = 0 โ€ข Pseudo-Inverse of a matrix ๐‘ฉ : ๐‘ฉ N = ๐‘พ๐šป N ๐‘ฝ ๐‘ผ

  18. 3) Matrix norms The Euclidean norm of an orthogonal matrix is equal to 1 ๐‘ฝ๐’š ๐‘ผ (๐‘ฝ๐’š) = max ๐’š ๐‘ผ ๐’š = max ๐‘ฝ ) = max ๐’š ! +" ๐‘ฝ๐’š ) = max ๐’š ! +" ๐’š ) = 1 ๐’š ! +" ๐’š ! +" The Euclidean norm of a matrix is given by the largest singular value ๐’š ! +" ๐‘ฝ ๐šป ๐‘พ ๐‘ผ ๐’š ) = max ๐’š ! +" ๐šป ๐‘พ ๐‘ผ ๐’š ) = ๐‘ฉ ) = max ๐’š ! +" ๐‘ฉ๐’š ) = max ๐‘พ ๐‘ผ ๐’š ! +" ๐šป ๐‘พ ๐‘ผ ๐’š ) = max = max ๐’› ! +" ๐šป ๐’› ) = max(๐œ & ) Where we used the fact that ๐‘ฝ ) = 1 , ๐‘พ ) = 1 and ๐šป is diagonal ๐‘ฉ ) = max ๐œ & = ๐œ #./ ๐œ '() is the largest singular value

  19. 4) Norm for the inverse of a matrix The Euclidean norm of the inverse of a square-matrix is given by: Assume here ๐‘ฉ is full rank, so that ๐‘ฉ 1& exists ๐‘ฉ 0" ) = max ๐’š ! +" (๐‘ฝ ๐šป ๐‘พ ๐‘ผ ) 0" ๐’š ) = max ๐’š ! +" ๐‘พ ๐šป 0๐Ÿ ๐‘ฝ ๐‘ผ ๐’š ) Since ๐‘ฝ ) = 1 , ๐‘พ ) = 1 and ๐šป is diagonal then " ๐‘ฉ 0" ) = ๐œ '!$ is the smallest singular value 2 #$%

Recommend


More recommend