Professional Documents
Culture Documents
Mathematics behind SVD: The SVD of a mxn matrix A is given by the formula A = UΣVT
where,
● U: mxm matrix of the orthonormal eigenvectors of AAT. .
● VT: Transpose of a nxn matrix containing the orthonormal eigenvectors ofATA.
● Σ: Diagonal matrix with r elements equal to the root of the positive eigenvalues of AAᵀ
or AᵀA (both matrices have the same positive eigenvalues anyway).
Applications of SVD: SVD allows an exact representation of any matrix and it is easy to
eliminate the less important data in the matrix to produce a low-dimensional approximation. This
makes SVD a powerful technique with a wide range of applications in various fields.
1. Data Compression: SVD is used for data compression by approximating
high-dimensional data with a lower-rank approximation. This is particularly useful in
image and signal compression.
2. Image and Signal Processing: SVD is applied in image and signal processing for
denoising, feature extraction, and compression. It helps identify dominant patterns or
features in the data.
3. Collaborative Filtering in Recommender Systems: In recommendation systems, SVD is
used for collaborative filtering to predict user preferences based on the preferences of
similar users. Matrix factorization techniques, including SVD, are common in this
context.
4. Natural Language Processing (NLP): SVD is used in NLP tasks such as latent semantic
analysis (LSA) to extract underlying relationships and patterns in large textual datasets. It
helps in identifying the semantic meaning of words and documents.
5. Principal Component Analysis (PCA): PCA, a dimensionality reduction technique, is
closely related to SVD. SVD is used to compute the principal components of a dataset,
which are then used for feature reduction and data visualization.
6. Quantum Mechanics and Quantum Computing: SVD is employed in quantum mechanics
for the analysis of quantum states and operations. In quantum computing, SVD is used in
quantum algorithms for tasks like quantum singular value transformation.
7. Statistics and Machine Learning: SVD is used in various statistical and machine learning
applications. For example, it is applied in regression analysis, feature selection, and
clustering. It can be used for handling multicollinearity in linear regression models.
8. Biomedical Imaging: In medical imaging, such as MRI and CT scans, SVD is used for
image reconstruction, noise reduction, and feature extraction. It helps in enhancing the
quality of medical images.
9. Control Systems and System Identification: SVD is applied in control systems and
system identification to analyze and model dynamic systems. It helps in identifying
dominant modes of a system and designing controllers.
10. Internet of Things (IoT): SVD is used in IoT applications for data analysis and anomaly
detection. It can help identify patterns and trends in large datasets generated by IoT
devices.
Dense Matrix SVD Algorithms: Dense matrix Singular Value Decomposition (SVD)
algorithms are numerical techniques designed to decompose a dense (fully populated) matrix into
three other matrices, revealing the singular values and singular vectors of the original matrix.
Dense matrices are those where most of the entries are non-zero.
Jacobi Singular Value Decomposition (SVD): This is an iterative method for computing the
SVD of a matrix through a series of orthogonal transformations, known as Jacobi rotations. The
algorithm diagonalizes the matrix by iteratively applying these rotations until convergence is
achieved. The resulting diagonalized matrix reveals the singular values and singular vectors of
the original matrix.
● We start with the original matrix A and initialize the orthogonal matrices U and V as
identity matrices. Set the matrix B = A.
● The main loop of the algorithm consists of iteratively applying Jacobi rotations to the
matrix B until convergence. The goal is to introduce zeros in off-diagonal elements.
● A Jacobi rotation is a 2x2 orthogonal matrix that zeros out one off-diagonal element. The
𝑇
rotation is applied to B as B ← 𝐽 𝐵𝐽 where J is the Jacobi rotation matrix.
● After each rotation, convergence is checked by examining the magnitude of the
off-diagonal elements. If the off-diagonal elements are sufficiently close to zero, the
algorithm is considered converged.
● After each successful rotation, the orthogonal matrices U and V are updated by
accumulating the rotation matrices.
● Repeat the process until convergence is achieved. The diagonal elements of the matrix B
become the singular values, and the columns of U and V contain the left and right
singular vectors, respectively.
● The final result is the decomposition A = UΣVT where U and V are orthogonal matrices,
and Σ is a diagonal matrix with the singular values on the diagonal.
Two-sided Jacobi algorithm: The two-sided Jacobi scheme, also known as the two-sided
Jacobi algorithm, is an extension of the Jacobi SVD algorithm that simultaneously applies Jacobi
rotations to both the left and right singular vector matrices. In the standard Jacobi SVD
algorithm, the rotations are applied separately to the left singular vector matrix U and the right
singular vector matrix V. The two-sided Jacobi scheme, however, performs joint rotations on
both U and V in each iteration. This simultaneous rotation of both matrices leads to faster
convergence.
The two-sided Jacobi scheme offers improved numerical stability and convergence properties
compared to the one-sided Jacobi algorithm. However, it comes with increased computational
cost due to the simultaneous rotations.
Sparse Extreme Singular Values: Sparse matrices warrant more specialized SVD computation
techniques, as full decompositions are infeasible. Subspace iterations, Lanczos/block-Lanczos
methods, trace minimization and Davidson-based procedures mainly find a few extreme singular
values/vectors accurately.
Working with the normal matrix ATA or an augmented matrix yields the desired singular values
as interior eigenvalues. This causes slow convergence for eigenvalues based methods. While
subspace iteration suppresses unwanted eigenvalues via polynomial transformations, Lanczos
cannot.
Alternatively, ATA's smallest eigenvalues equal the matrix's smallest singular values squared.
This allows trace minimization methods to converge correctly. A quadratic minimization
formulation leads to independent linear systems that refine search subspaces. Chebyshev
acceleration, Ritz shifting and left singular vector refinement further aid convergence.
We have explored Lanczos algorithm in our project.
Lanczos algorithm: The Lanczos algorithm is an iterative method used for finding a few
eigenvalues and corresponding eigenvectors of a large, sparse symmetric matrix. It is particularly
well-suited for problems in numerical linear algebra and is often applied in the context of
eigenvalue problems, such as those encountered in quantum mechanics, structural mechanics,
and other scientific simulations. The Lanczos algorithm was originally developed by Cornelius
Lanczos in the 1950s.
● We start with a vector v1 of random or predetermined initial values.
● Iteratively apply the Lanczos procedure to generate a tridiagonal matrix T that is similar
to the original symmetric matrix A.
● Orthogonalize the vectors generated during the iteration process to maintain
orthogonality and numerical stability.
● The Lanczos iteration produces a tridiagonal matrix T that approximates the original
symmetric matrix A. The eigenvalues of T are approximations of the eigenvalues of A
and the Lanczos vectors provide corresponding approximations of the eigenvectors.
● Use standard methods, such as the QR algorithm, to compute the eigenvalues and
eigenvectors of the tridiagonal matrix T. These eigenvalues are then considered as
approximations of the eigenvalues of the original matrix A.
● The Lanczos algorithm can be iteratively restarted to improve accuracy or to find
additional eigenvalues. The algorithm is typically terminated when the desired number of
eigenvalues or a specified convergence criterion is reached.
The Lanczos algorithm is particularly useful for large, sparse matrices because it avoids explicit
diagonalization of the entire matrix. Instead, it works with a small, tridiagonal matrix,
significantly reducing the computational cost. The method is efficient in situations where only a
subset of eigenvalues is needed.
Parallelization Approach: A root process reads the entire sparse matrix and assigns matrix
columns to processes for load balancing, minimizing communication. Column partitions are
picked to balance non-zero elements across processes while avoiding fractions of columns.
Processes then independently perform Lanczos computations on their sub-matrices and gather
intermediate results for reorthogonalization. MPI derived data types and collective routines are
used for efficient data transfers.
Experiments: Test matrices with varying sizes and density (fraction of non-zero entries) are
generated to simulate real document corpora. Constant size, growing density and constant
density, growing size cases are tested on a nine node Linux cluster.
Results: The experiments reveal that speedups are only observed beyond a density threshold,
below which parallel overheads dominate. This manifests as relative speedups for higher density
matrices, and occasional slowdowns for sparse cases.
Analysis suggests data distribution and messaging costs for reorthogonalization determine
efficiency. These scale with matrix dimensions. But computational load is also proportional to
matrix density. So sufficient density absorbs overheads allowing scalability.
The tests also demonstrate that keeping density fixed, increasing matrix size consistently
improves speedups. This aligns with Amdahl’s law, as larger problems make parallelizable
Lanczos portion more dominant.
Matrix Type: Lanczos is well-suited for large, sparse matrices, especially when eigenvalues and
eigenvectors are of interest.
Jacobi SVD is better suited for dense matrices, and it directly provides the SVD decomposition.
Numerical Stability: Jacobi SVD is generally more numerically stable than Lanczos, making it
suitable for a broader range of applications.
Computation Time: The performance comparison in terms of computation time depends on the
size and sparsity of the matrices. Lanczos might be more efficient for large sparse matrices,
while Jacobi SVD might be more efficient for dense matrices.
Parallelization: Both algorithms actually benefit from parallelization. Lanczos, when used in
eigenvalue problems, exploits parallelism during the iterations. Jacobi SVD is parallelized by
utilizing parallel linear algebra operations.
Memory Requirements: Lanczos often requires less memory as it operates iteratively on the
matrix without explicitly forming the entire matrix.
Jacobi SVD may require more memory, especially for large dense matrices.
Despite these challenges, hybrid approaches, combining multiple parallelization techniques, and
leveraging specialized hardware, such as GPUs, are often employed to address some of these
challenges and enhance the performance of parallel SVD computations.
References:
1. https://www.engr.colostate.edu/~hj/conferences/164.pdf: Parallel Algorithms for SIngular
Value Decomposition - Renard R. Ulrey, Anthony A. Maciejewski and Howard Jay
Siegel
2. https://core.ac.uk/download/pdf/81925994.pdf: An overview of parallel algorithms for
the singular value and symmetric eigenvalue problems - Michael Berry and Ahmed
Sameh
3. https://www.math.pku.edu.cn/teachers/xusf/private/dump/parallel%20lanczos.pdf: A
Parallel Implementation of Lanczos Algorithm in SVD Computation - SRIKANTH
KALLURKAR
Team Details:
1. Madhuparna Ghosh(CS21MDS14016)
2. Leela Pavani Dulla(CS22MDS15027)
3. Anurag Roy(CS20MDS14010) - Did not participate due to health issues.