Guozhen AIGlobal AI field notes and model intelligence

English translation

Define matrix A

Published:

Category: Linear Algebra for AI

Read time: 4 min

Lesson #22Images are preserved from the source page

AI Article Decision Snapshot

Turn the lesson into workflow, model, budget, and security checks before choosing tools.

Use this quick snapshot before leaving the article. It keeps the next search tied to practical AI software, model/API, cost, privacy, and implementation questions.

Workflow fit

Identify the real job behind the article: coding, research, document review, support, analytics, content, or internal automation.

Model or tool decision

Decide whether the next step is a software shortlist, an AI tool comparison, an API platform choice, or a model benchmark.

Budget and usage signal

Estimate seats, API calls, prompt volume, retries, review time, and fallback work before assuming the workflow is cheap.

Security and privacy review

Check whether source code, customer data, private documents, prompts, logs, or embeddings will enter the AI workflow.

Conceptual Diagram of Singular Value Computation

You can compute singular values manually by starting from the eigenvalues of ATAA^T A. In practice, engineers delegate this task to numerical libraries—but understanding the underlying derivation helps interpret results correctly.

Verification Diagram for Singular Value Computation

I verify that singular values are non-negative and typically ordered in descending order. If their ordering is incorrect, low-rank approximations will also be wrong.

In the previous article, we introduced the concept of Singular Value Decomposition (SVD) and discussed why it plays such a pivotal role in data science and machine learning. This article dives deeper into how singular values are computed—equipping you with mastery of this core technique and laying a solid foundation for subsequent applications.

1. Theoretical Foundation

Singular Value Decomposition (SVD) is a matrix factorization method that decomposes any matrix AA into the product of three matrices. Specifically, if AA is an m×nm \times n matrix, it can be expressed as:

Singular Value Computation Decision Card

When computing singular values, consider: transpose–product relationships, eigenvalues, square-root mapping, singular vectors, dimensional changes, and numerical stability.

A=UΣVTA = U \Sigma V^T

where:

  • UU is an m×mm \times m orthogonal matrix;
  • Σ\Sigma is an m×nm \times n diagonal matrix containing the singular values of AA;
  • VTV^T is the transpose of VV, and VV is an n×nn \times n orthogonal matrix.

Singular values represent a kind of “signature” of matrix AA, reflecting its structural properties and information content. To extract them from Σ\Sigma, follow these steps:

  1. Compute ATAA^T A and AATA A^T.
  2. Obtain the eigenvalues of both matrices.
  3. Take the non-negative square roots of those eigenvalues to yield the singular values.

2. Step-by-Step Computation of Singular Values

To compute singular values, proceed as follows:

Step 1: Compute ATAA^T A

Given a matrix AA, first compute its transpose ATA^T, then multiply it by AA to obtain ATAA^T A. The result is an n×nn \times n matrix.

Step 2: Compute Eigenvalues

Next, compute the eigenvalues λi\lambda_i of ATAA^T A. If AA is m×nm \times n, then ATAA^T A is n×nn \times n, and its eigenvalues can be found by solving the characteristic polynomial.

Step 3: Compute Singular Values

Each singular value sis_i is the non-negative square root of the corresponding eigenvalue:

si=λis_i = \sqrt{\lambda_i}

Apply this to all eigenvalues λi\lambda_i to obtain the full set of singular values.

3. Worked Example

Let’s demonstrate singular value computation using a concrete matrix. Consider:

Linear Algebra Reading Map Card

“The Computation of Singular Values in SVD” can be read through four lenses: scenario, concept, action, and outcome. First align these four elements, then revisit parameters, code, or workflows in the main text.

A=(123456)A = \begin{pmatrix} 1 & 2 \\ 3 & 4 \\ 5 & 6 \end{pmatrix}

Detailed Computation Steps

  1. Compute ATAA^T A:

    AT=(135246)A^T = \begin{pmatrix} 1 & 3 & 5 \\ 2 & 4 & 6 \end{pmatrix}

    So,

    ATA=(135246)(123456)=(35444456)A^T A = \begin{pmatrix} 1 & 3 & 5 \\ 2 & 4 & 6 \end{pmatrix} \begin{pmatrix} 1 & 2 \\ 3 & 4 \\ 5 & 6 \end{pmatrix} = \begin{pmatrix} 35 & 44 \\ 44 & 56 \end{pmatrix}
  2. Compute eigenvalues: Solve

    det(ATAλI)=0,\det(A^T A - \lambda I) = 0,

    where II is the 2×22 \times 2 identity matrix. Solving yields eigenvalues:

    λ1=91,λ2=0.\lambda_1 = 91,\quad \lambda_2 = 0.
  3. Compute singular values:

    s1=λ1=919.54,s_1 = \sqrt{\lambda_1} = \sqrt{91} \approx 9.54, s2=λ2=0=0.s_2 = \sqrt{\lambda_2} = \sqrt{0} = 0.

Thus, the singular values of AA are approximately 9.549.54 and 00.

4. Python Implementation

Using NumPy, we can implement this computation concisely:

import numpy as np

# Define matrix A
A = np.array([[1, 2], [3, 4], [5, 6]])

# Compute SVD
U, s, VT = np.linalg.svd(A)

# Output singular values
print("Singular values:", s)

Running this code yields:

Singular values: [9.52551809 0.51449576]

Application Retrospective Card: Singular Value Computation in SVD

After studying “The Computation of Singular Values in SVD”, try applying it to your own scenario—pay close attention to whether inputs, processing steps, and outputs align coherently.

Application Validation Card: Singular Value Computation in SVD

To apply “The Computation of Singular Values in SVD” to your own task, begin by narrowing the scope—focus on validating just one critical decision point.

Summary

This article thoroughly explains how singular values are computed—including theoretical foundations, a step-by-step worked example, and a practical Python implementation. This knowledge is essential for deeply understanding SVD and its applications. In the next article, we’ll explore real-world use cases of SVD—for instance, in recommendation systems and image processing.

Stay tuned for our ongoing tutorial series—and deepen your grasp of linear algebra’s vital role in AI!

Apply This Lesson

Turn this article into AI software, model, API, and security decisions.

English Article FAQ

Use this article as evidence before choosing AI tools

How should I use this AI Tutorials article?

Use it as the implementation or learning layer, then connect the idea to AI software buyer guides, tool comparisons, benchmarks, API choices, and security checks before making a production decision.

Is this English article different from the Chinese original?

The English edition is localized for global AI readers while preserving the original diagrams, screenshots, prompts, code examples, and source context from the Chinese article.

What should I read after Define matrix A?

Continue with AI Software Buyer Guides, AI Tools Workbench, Best AI Coding Agents, AI Model Benchmarks, OpenAI vs Anthropic API, or LLM Security Tools depending on the decision you need to make.

Can this article alone choose an AI product or model?

No. Treat the article as evidence and context, then validate fit with pricing, privacy requirements, integration effort, benchmark results, workflow tests, and fallback planning.

Continue

Keep reading from here

Browse English site

Reader Messages

Reader messages

Questions, corrections, extra sources, or hands-on results can be left here. No login is required.

Max 800 characters

To reduce spam, each message is checked for length, link count, and posting frequency.

0/800

Messages

0 messages
Loading messages...