๐Ÿ”ฅLimited Offer: Get 50% OFFon AI & Full Stack Courses๐Ÿ”ฅ
Back to Deep Learning Notes
Topic #21

Eigenvalues

An eigenvalue of a matrix answers a specific question: for which special vectors does this matrix act as a pure scaling operation โ€” stretching or shrinking, but never changing direction? Those scaling factors are the eigenvalues.

Definition

\[ \mathbf{A}\mathbf{v} = \lambda \mathbf{v} \]

\(\mathbf{A}\) is a square matrix, \(\mathbf{v}\) is a non-zero vector called an eigenvector (covered fully in the next note), and \(\lambda\) (a scalar) is the corresponding eigenvalue. The equation says: applying \(\mathbf{A}\) to \(\mathbf{v}\) gives back the same vector, just scaled by \(\lambda\) โ€” no rotation, no change of direction.

Finding Eigenvalues โ€” The Characteristic Equation

\[ \det(\mathbf{A} - \lambda\mathbf{I}) = 0 \]

Rearranging \(\mathbf{A}\mathbf{v}=\lambda\mathbf{v}\) gives \((\mathbf{A}-\lambda\mathbf{I})\mathbf{v} = \mathbf{0}\). For a non-zero \(\mathbf{v}\) to satisfy this, the matrix \((\mathbf{A}-\lambda\mathbf{I})\) must be singular โ€” meaning its determinant is zero (see Determinant). Solving that equation for \(\lambda\) gives the eigenvalues.

Numerical Example

\[ \mathbf{A} = \begin{bmatrix}4 & 1\\2 & 3\end{bmatrix} \] \[ \det(\mathbf{A}-\lambda\mathbf{I}) = \det\begin{bmatrix}4-\lambda & 1\\2 & 3-\lambda\end{bmatrix} = (4-\lambda)(3-\lambda) - 2 = \lambda^2 - 7\lambda + 10 = 0 \] \[ (\lambda-5)(\lambda-2)=0 \implies \lambda_1 = 5, \quad \lambda_2 = 2 \]

Code

import numpy as np
A = np.array([[4., 1.], [2., 3.]])
eigenvalues, eigenvectors = np.linalg.eig(A)
print(eigenvalues)    # [5. 2.]

Where This Shows Up in Deep Learning

  • PCA (Principal Component Analysis): the principal components are the eigenvectors of the data's covariance matrix, and the eigenvalues tell you how much variance each component explains โ€” used for dimensionality reduction.
  • Weight matrix conditioning: the spread of a weight matrix's eigenvalues affects how gradients scale as they pass through many layers โ€” very large or very small eigenvalues are linked to exploding/vanishing gradients.
  • Determinant shortcut: \(\det(\mathbf{A})\) equals the product of all its eigenvalues โ€” a quick sanity link back to Determinant.

Common Mistakes

  • Assuming every matrix has real eigenvalues โ€” some (e.g. pure rotation matrices) have complex eigenvalues, since there's no real vector whose direction is preserved.
  • Confusing eigenvalues with the matrix's individual entries โ€” eigenvalues are a global property of how the matrix transforms space, not directly read off the matrix (except for triangular matrices, where they are the diagonal entries).

Interview Relevance

Q: "What's the intuitive meaning of an eigenvalue?" It's the scaling factor applied to a special direction (the eigenvector) that a matrix leaves unrotated. Most vectors get both rotated and scaled by a matrix; eigenvectors are the exceptions โ€” they only get scaled, by exactly their eigenvalue.

Practice Question

Without solving fully, explain why a diagonal matrix's eigenvalues are simply its diagonal entries. (Hint: what does \(\mathbf{A}\mathbf{v}\) look like for a diagonal \(\mathbf{A}\) and \(\mathbf{v}\) a standard basis vector?)

Want to go beyond the notes?

Join CodingNow 2.0's Deep Learning course โ€” live mentorship, real projects, and 100% placement support.

Enroll Now โ€” Free Demo Available

Eigenvalues โ€“ FAQs

Quick answers about learning Eigenvalues in Deep Learning.

This free note from CodingNow 2.0 explains Eigenvalues in Deep Learning โ€” concept, syntax and worked code examples you can copy, run and revise before interviews.
Yes. Every Deep Learning topic on CodingNow 2.0, including Eigenvalues, is 100% free with no signup required.
With focused practice, most students grasp Eigenvalues in 1โ€“3 days from these notes; pairing it with CodingNow 2.0's mentor-led course takes you to job-ready depth faster.
Use the code examples in this note, then ask doubts for free on the CodingNow 2.0 Community (/community) โ€” expert instructors answer within 24 hours.
WhatsApp
Call NowEnroll Now