Skip to content

Commit dadc773

Browse files
committed
Update ddasp_exercise_slides.tex
1 parent 42ef960 commit dadc773

File tree

1 file changed

+36
-26
lines changed

1 file changed

+36
-26
lines changed

slides/ddasp_exercise_slides.tex

Lines changed: 36 additions & 26 deletions
Original file line numberDiff line numberDiff line change
@@ -123,6 +123,7 @@
123123
\href{https://probml.github.io/pml-book/book1.html}{current draft as free pdf}
124124
\item \href{https://math.mit.edu/~gs/}{G. Strang} (2019): "Linear Algebra and Learning from Data", Wellesley, 1st ed.
125125
\item S. Raschka, Y. Liu, V. Mirjalili (2022): "Machine Learning with PyTorch and Scikit-Learn", Packt, 1st ed.
126+
\item J.A. Fessler, R.R. Nadakuditi (2024): "Linear Algebra for Data Science, Machine Learning, and Signal Processing", Cambridge University Press, 1st ed.
126127
\end{itemize}
127128
\end{frame}
128129

@@ -270,7 +271,7 @@ \subsection{Exercise 02}
270271
Objectives
271272
\begin{itemize}
272273
\item recap important matrix factorizations
273-
\item recap eigenvalues/eigenvectors
274+
\item recap eigenvalues / eigenvectors
274275
\item spectral theorem
275276
\item SVD as a fundamental matrix factorization
276277
\end{itemize}
@@ -281,13 +282,13 @@ \subsection{Exercise 02}
281282

282283
\begin{frame}{Matrix Factorization from Eigenwert Problem for Square Matrix}
283284

284-
for square matrix $\bm{A}_{M \times M}$ we can have a factorization (known as diagonalization)
285+
for \underline{square} matrix $\bm{A}_{M \times M}$ we can have a factorization (known as diagonalization)
285286

286287
$$\bm{A} = \bm{X} \bm{\Lambda} \bm{X}^{-1}$$
287288

288289
(but only) when $M$ independent eigenvectors as columns in $\bm{X}$ (only then $\bm{X}^{-1}$ is possible)
289290

290-
with the corresponding eigenvalues $\lambda$ in the diagonal matrix $\Lambda$
291+
with the corresponding eigenvalues $\lambda$ in the diagonal matrix $\bm{\Lambda}$
291292

292293
\begin{center}
293294
$
@@ -301,15 +302,15 @@ \subsection{Exercise 02}
301302
$
302303
\end{center}
303304

304-
the matrix is acting onto $m$-th eigenvector as
305+
the matrix is acting onto the $m$-th eigenvector as
305306

306307
$$\bm{A} \bm{x}_m = \lambda_m \bm{x}_m$$
307308

308-
$\Lambda$ might be complex-valued
309+
$\bm{\Lambda}$ might be complex-valued
309310

310311
$\bm{X}$ might be complex-valued
311312

312-
if $\lambda_m=0$ we get $\bm{A} \bm{x}_m = 0 \cdot \bm{x}_m = \bm{0}$, i.e. $\bm{A}$ is a singular matrix, i.e. $\bm{A}$ is a non-full rank matrix
313+
if $\lambda_m=\textcolor{C3}{0}$ we get $\bm{A} \bm{x}_m = \textcolor{C3}{0} \cdot \bm{x}_m = \bm{0}$, i.e. $\bm{A}$ is a singular matrix, i.e. $\bm{A}$ is a non-full rank matrix
313314

314315
rank of matrix $\bm{A}$ is $R$ == number of non-zero eigenvalues
315316

@@ -320,13 +321,16 @@ \subsection{Exercise 02}
320321

321322
\begin{frame}{Matrix Factorization from Eigenwert Problem for Symmetric Matrix}
322323

323-
for \underline{Hermitian} matrix $\bm{A}_{M \times M} = \bm{A}_{M \times M}^H$ we can have a special case of diagonalization
324+
for \textcolor{C0}{\underline{Hermitian}} matrix $\bm{A}_{M \times M} = \bm{A}_{M \times M}^H$
325+
326+
and a dedicated \underline{unitary} matrix $\bm{Q}$ (i.e. it holds $\bm{Q} \bm{Q}^H = \bm{I}$, $\bm{Q}^H \bm{Q} = \bm{I}$)
324327

328+
special case of diagonalization, known as \underline{spectral theorem}:
325329
$$\bm{A} = \bm{Q} \bm{\Lambda} \bm{Q}^{-1} = \bm{Q} \bm{\Lambda} \bm{Q}^{H}$$
326330

327-
(only) when $M$ independent, \underline{orthogonal} eigenvectors as columns in $\bm{Q}$ \quad($\bm{Q} \bm{Q}^H = \bm{I}$, $\bm{Q}^H \bm{Q} = \bm{I}$)
331+
with $M$ independent, \underline{orthonormal} eigenvectors as columns in $\bm{Q}$
328332

329-
with the corresponding eigenvalues $\lambda\in\mathbb{R}$ in the diagonal matrix $\Lambda$
333+
with the corresponding eigenvalues $\textcolor{C0}{\lambda\in\mathbb{R}}$ in the diagonal matrix $\Lambda$
330334

331335
\begin{center}
332336
$
@@ -344,7 +348,7 @@ \subsection{Exercise 02}
344348

345349
$$\bm{A} \bm{q}_m = \lambda_m \bm{q}_m$$
346350

347-
$\bm{\Lambda}\in\mathbb{R}$
351+
$\textcolor{C0}{\bm{\Lambda}\in\mathbb{R}}$
348352

349353
$\bm{Q}\in\mathbb{R}$ if $\bm{A}\in\mathbb{R}$, $\bm{Q}\in\mathbb{C}$ if $\bm{A}\in\mathbb{C}$
350354

@@ -359,12 +363,18 @@ \subsection{Exercise 02}
359363

360364
\begin{frame}[t]{Matrix Factorization from Eigenwert Problem for Symmetric Matrix}
361365

362-
for a \underline{normal} matrix $\bm{A}$ (i.e. it holds $\bm{A}^H \bm{A} = \bm{A} \bm{A}^H$ )
366+
for a \textcolor{C0}{\underline{normal}} matrix $\bm{A}$ (i.e. it holds $\bm{A}^H \bm{A} = \bm{A} \bm{A}^H$)
367+
368+
and a dedicated \underline{unitary} matrix $\bm{Q}$ (i.e. it holds $\bm{Q} \bm{Q}^H = \bm{I}$, $\bm{Q}^H \bm{Q} = \bm{I}$)
369+
370+
special case of diagonalization, known as \underline{spectral theorem}:
371+
$$\bm{A} = \bm{Q} \bm{\Lambda} \bm{Q}^{-1} = \bm{Q} \bm{\Lambda} \bm{Q}^{H}$$
372+
373+
with $M$ independent, \underline{orthonormal} eigenvectors as columns in $\bm{Q}$
363374

364-
there is the fundamental spectral theorem
365-
$$\bm{A} = \bm{Q} \bm{\Lambda} \bm{Q}^{H}$$
375+
with the corresponding eigenvalues $\textcolor{C0}{\lambda\in\mathbb{R}/\mathbb{C}}$ in the diagonal matrix $\bm{\Lambda}$
366376

367-
i.e. diagonalization in terms of eigenvectors in unitary matrix $\bm{Q}$ and eigenvalues in $\bm{\Lambda}\in\mathbb{C}$
377+
%i.e. diagonalization in terms of orthonormal eigenvectors in $\bm{Q}$ and eigenvalues in $\bm{\Lambda}\in\mathbb{C}$
368378

369379
What does $\bm{A}$ with an eigenvector $\bm{q}$?
370380

@@ -451,7 +461,7 @@ \subsection{Exercise 02}
451461
$
452462
\end{center}
453463

454-
$$\bm{A} = \bm{U} \bm{\Sigma} \bm{V}^\mathrm{H}\qquad \qquad \bm{U}\bm{U}^H = \bm{U}^H\bm{U} = \bm{I}_{M \times M} \qquad \qquad \bm{V}\bm{V}^H = \bm{V}^H\bm{V} = \bm{I}_{N \times N}$$
464+
$$\bm{A} = \bm{U} \bm{\Sigma} \bm{V}^\mathrm{H} \qquad \qquad \text{unitary:} \qquad \bm{U}\bm{U}^H = \bm{U}^H\bm{U} = \bm{I}_{M \times M} \qquad \bm{V}\bm{V}^H = \bm{V}^H\bm{V} = \bm{I}_{N \times N}$$
455465

456466

457467
left singular vectors\quad$\bm{U} = \mathrm{eigvec}(\bm{A}\bm{A}^\mathrm{H})$
@@ -788,7 +798,7 @@ \subsection{Exercise 03}
788798
\begin{frame}{SVD Fundamentals}
789799
%
790800
superposition of rank-1 matrices (outer products) because singular values in diagonal matrix $\bm{\Sigma}$
791-
$$\bm{A}_{M \times N} = \sum_{r=1}^{\text{rank }R} \sigma_r \bm{u}_r \bm{v}_r^\mathrm{H} = \bm{U} \bm{S} \bm{V}^\mathrm{H}$$
801+
$$\bm{A}_{M \times N} = \sum_{r=1}^{\text{rank }R} \sigma_r \bm{u}_r \bm{v}_r^\mathrm{H} = \bm{U} \bm{\Sigma} \bm{V}^\mathrm{H}$$
792802
%
793803
input-related matrix $\bm{V}$ and output related matrix $\bm{U}$ are unitary, i.e.
794804
$$\bm{V}\bm{V}^\mathrm{H}=\bm{I},\quad\bm{V}^\mathrm{H}\bm{V}=\bm{I},\quad\bm{U}\bm{U}^\mathrm{H}=\bm{I},\quad\bm{U}^\mathrm{H}\bm{U}=\bm{I}$$
@@ -820,7 +830,7 @@ \subsection{Exercise 03}
820830
2 & 6
821831
\end{bmatrix}
822832
\stackrel{?}{=}
823-
\bm{U}\bm{S}\bm{V}^\mathrm{T}
833+
\bm{U}\bm{\Sigma}\bm{V}^\mathrm{T}
824834
$$
825835
manually.
826836

@@ -891,7 +901,7 @@ \subsection{Exercise 03}
891901
2 & 6
892902
\end{bmatrix}
893903
\stackrel{?}{=}
894-
\bm{U}\bm{S}\bm{V}^\mathrm{T}
904+
\bm{U}\bm{\Sigma}\bm{V}^\mathrm{T}
895905
$$
896906

897907
As we have $M-R$ vectors that span the left null space, thus here $M=2$ and $R=1$,
@@ -917,13 +927,13 @@ \subsection{Exercise 03}
917927
2 & 6
918928
\end{bmatrix}
919929
\stackrel{?}{=}
920-
\bm{U}\bm{S}\bm{V}^\mathrm{T}
930+
\bm{U}\bm{\Sigma}\bm{V}^\mathrm{T}
921931
$$
922932

923933
Let us start with
924-
$\bm{X}^\mathrm{T} \bm{X} = (\bm{U}\bm{S}\bm{V}^\mathrm{T})^\mathrm{T} (\bm{U}\bm{S}\bm{V}^\mathrm{T})
925-
= \bm{V}\bm{S}^\mathrm{T}\bm{U}^\mathrm{T} \bm{U}\bm{S}\bm{V}^\mathrm{T}
926-
= \bm{V}\bm{S}^\mathrm{T}\bm{S}\bm{V}^\mathrm{T}
934+
$\bm{X}^\mathrm{T} \bm{X} = (\bm{U}\bm{\Sigma}\bm{V}^\mathrm{T})^\mathrm{T} (\bm{U}\bm{\Sigma}\bm{V}^\mathrm{T})
935+
= \bm{V}\bm{\Sigma}^\mathrm{T}\bm{U}^\mathrm{T} \bm{U}\bm{\Sigma}\bm{V}^\mathrm{T}
936+
= \bm{V}\bm{\Sigma}^\mathrm{T}\bm{\Sigma}\bm{V}^\mathrm{T}
927937
$
928938
using the property of SVD matrices $\bm{U}^\mathrm{T} \bm{U} = \bm{I}$
929939

@@ -1002,13 +1012,13 @@ \subsection{Exercise 03}
10021012

10031013
\begin{frame}[t]{SVD Example Manual Calculus: Eigenvalue And -Vector Problem}
10041014
$$\bm{X}^\mathrm{T} \bm{X} =
1005-
\bm{V}\bm{S}^\mathrm{T}\bm{S}\bm{V}^\mathrm{T} =
1015+
\bm{V}\bm{\Sigma}^\mathrm{T}\bm{\Sigma}\bm{V}^\mathrm{T} =
10061016
\begin{bmatrix}
10071017
5 & 15\\
10081018
15 & 45
10091019
\end{bmatrix}$$
10101020
The matrix factorization in the middle stores eigenvectors in $\bm{V}$ and
1011-
corresponding eigenvalues in $\bm{S}^\mathrm{T}\bm{S}$ of the matrix
1021+
corresponding eigenvalues in $\bm{\Sigma}^\mathrm{T}\bm{\Sigma}$ of the matrix
10121022
$\bm{X}^\mathrm{T} \bm{X}$.
10131023
We need to calculate them, so we take the usual steps
10141024
$$\mathrm{det}(\bm{X}^\mathrm{T} \bm{X} - \lambda \bm{I}) = 0$$
@@ -1267,7 +1277,7 @@ \subsection{Exercise 03}
12671277
3 & -1
12681278
\end{bmatrix}
12691279
\qquad
1270-
\bm{S}=
1280+
\bm{\Sigma}=
12711281
\begin{bmatrix}
12721282
\lambda_1 \neq 0 & 0\\
12731283
0 & 0
@@ -1363,7 +1373,7 @@ \subsection{Exercise 03}
13631373
1 & 3\\
13641374
2 & 6
13651375
\end{bmatrix}
1366-
= \bm{U} \bm{S} \bm{V}^\mathrm{T}=
1376+
= \bm{U} \bm{\Sigma} \bm{V}^\mathrm{T}=
13671377
\begin{bmatrix}
13681378
\frac{1}{\sqrt{5}} & \frac{2}{\sqrt{5}}\\
13691379
\frac{2}{\sqrt{5}} & \frac{-1}{\sqrt{5}}

0 commit comments

Comments
 (0)