Site icon Jiasheng xu

Enhanced SVD Computation Toolkit

——Numerical Algebra Course Project

Collaborated with Yuxiang Tong and received guidance from Professor Shengxin Zhu, along with discussions with classmates from the entire Numerical Algebra course

About the process

This project encapsulates my personal reflections on a course that significantly enhanced my understanding of numerical algorithms, particularly in the context of Singular Value Decomposition (SVD) using MATLAB. In this course, we extensively used English-language textbooks, which inspired me to summarize my insights in Chinese. This approach not only aided my comprehension but also aims to assist future juniors in navigating the course material more effectively.

Throughout the course, we delved into the intricacies of MATLAB’s fundamental matrix operations, applying the algorithms we learned to develop custom SVD code. This endeavor marked my first foray into translating complex mathematical algorithms into code. The journey was challenging yet immensely rewarding, offering a multitude of learning opportunities and guidance that catalyzed a significant leap in my personal development.

This summary not only serves as a record of my journey through the course but also as a bridge for future students to connect with these concepts in a more approachable manner, marrying the rigor of English-language materials with the accessibility of a Chinese summary.

Click or drag to the floating window to download

README

Introduction

This toolkit, developed by Jiasheng Xu and Yuxiang Tong under the guidance of Professor Zhu Shengxin and with inputs from classmates in the numerical algebra course, optimizes and expedites the process of Singular Value Decomposition (SVD) for matrices. It introduces innovative algorithms and matrix transformations to enhance the efficiency of SVD operations.

Features

  1. n_svd:
    • An efficient Singular Value Decomposition function for matrix decomposition, showcasing our ability to apply complex numerical algorithms in coding.
  2. new_TSB and qr_givens:
    • Developed in collaboration with Yuxiang Tong. These functions optimize the matrix for SVD, focusing on bidiagonalization and tridiagonalization (new_TSB), and matrix transformation via Givens rotations (qr_givens).
  3. mytest:
    • A function to evaluate the performance of our SVD algorithm, providing insights into time efficiency and accuracy.
  4. Custom Matrix Input:
    • Flexibility for users to implement SVD on their own matrices by replacing the test.mat file.
  5. ouyang_SVD:
    • A collaborative effort with classmates, further expanding the toolkit’s capabilities in matrix decomposition.
  6. house2:
    • A foundational function by Professor Zhu, crucial for the SVD process.

Getting Started

Prerequisites

Running the Toolkit

  1. Performance Testing:
    • Run the mytest function to measure the performance of the SVD process. It times the computation and calculates the reconstruction error.
  2. Performing SVD:
    • Use the n_svd function to perform singular value decomposition on your matrix. This function returns matrices U, Σ, and V.
  3. Custom Matrix Input:
    • Replace the test.mat file with your own matrix file in MATLAB’s .mat format, containing matrices as per the existing code’s requirements.

Example

% Load your custom matrix
load('your_matrix_file.mat'); % Replace 'your_matrix_file.mat' with your file name% Perform SVD
[U, S, V] = n_svd(your_matrix);

% Measure performance
[time, error] = mytest();

Numerical Algebra Course Reflection

Exit mobile version