Skip to content

Commit ff23733

Browse files
committed
4 subspace SVD forward/backward mod/add
1 parent 4bea42b commit ff23733

File tree

4 files changed

+171
-11
lines changed

4 files changed

+171
-11
lines changed

slides/four_subspaces.pdf

4.83 KB
Binary file not shown.

slides/four_subspaces.tex

Lines changed: 40 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -29,8 +29,11 @@
2929
\def\lengthrect{4};
3030
\def\lengthvec{3};
3131

32-
\path (0,0) +(90:\lengthvec+2) coordinate (G);
33-
\draw (G) node[above]{$\bm{A}_{M \times N} = \bm{U}_{M \times M} \bm{\Sigma}_{M \times N} \bm{V}_{N \times N}^H$};
32+
\path (0,0) +(90:\lengthvec+2) coordinate (T);
33+
\draw (T) node[above]{Forward Problem with SVD of $\bm{A}$};
34+
35+
\path (0,0) +(90:\lengthvec+1) coordinate (G);
36+
\draw (G) node[above]{$\bm{A}_{M \times N} = \bm{U}_{M \times M} \bm{\Sigma}_{M \times N} \bm{V}_{N \times N}^\mathrm{H}$};
3437

3538
\draw[draw=black, rotate around={45:(u_space)}, C0] (u_space) rectangle ++(\lengthrect,\lengthrect);
3639
\draw[draw=black, rotate around={225:(u_space)}, C4] (u_space) rectangle ++(\lengthrect,\lengthrect);
@@ -40,7 +43,7 @@
4043

4144
%zero vectors
4245
\draw[fill] (u_space) circle (2pt) node[right]{$\bm{0}_{M \times 1}$};
43-
\draw[fill] (v_space) circle (2pt) node[right]{$\bm{0}_{N \times 1}$};
46+
\draw[fill] (v_space) circle (2pt) node[left]{$\bm{0}_{N \times 1}$};
4447

4548
% U space stuff:
4649
\path (u_space) +(135:\lengthvec) coordinate (u1);
@@ -59,13 +62,13 @@
5962
\draw (col_space) node[above]{column space: $\text{Range}(\bm{A})$};
6063

6164
\path (u_space) +(90:\lengthvec-1) coordinate (col_space_dim);
62-
\draw (col_space_dim) node[above]{dim $R$ = rank of $\bm{A}$};
65+
\draw (col_space_dim) node[above]{dim: $R$ = rank of $\bm{A}$};
6366

6467
\path (u_space) +(270:\lengthvec) coordinate (left_null_space);
65-
\draw (left_null_space) node[above]{left null space: $\text{Null}(\bm{A}^H)$};
68+
\draw (left_null_space) node[above]{left null space: $\text{Null}(\bm{A}^\mathrm{H})$};
6669

6770
\path (u_space) +(270:\lengthvec+1) coordinate (left_null_space_dim);
68-
\draw (left_null_space_dim) node[above]{dim $M-R$};
71+
\draw (left_null_space_dim) node[above]{dim: $M-R$};
6972

7073
% V space stuff:
7174
\path (v_space) +(45:\lengthvec) coordinate (v1);
@@ -81,24 +84,50 @@
8184
\draw[-{Latex[length=3mm]}, C1, thick] (v_space) -- (vn) node[left]{$\bm{v}_{N}$};
8285

8386
\path (v_space) +(90:\lengthvec) coordinate (row_space);
84-
\draw (row_space) node[above]{row space: $\text{Range}(\bm{A}^H)$};
87+
\draw (row_space) node[above]{row space: $\text{Range}(\bm{A}^\mathrm{H})$};
8588

8689
\path (v_space) +(90:\lengthvec-1) coordinate (row_space_dim);
87-
\draw (row_space_dim) node[above]{dim $R$ = rank of $\bm{A}$};
90+
\draw (row_space_dim) node[above]{dim: $R$ = rank of $\bm{A}$};
8891

8992
\path (v_space) +(270:\lengthvec) coordinate (null_space);
9093
\draw (null_space) node[above]{null space: $\text{Null}(\bm{A})$};
9194

9295
\path (v_space) +(270:\lengthvec+1) coordinate (null_space_dim);
93-
\draw (null_space_dim) node[above]{dim $N-R$};
96+
\draw (null_space_dim) node[above]{dim: $N-R$};
9497

9598
% row to column
9699
\path (u_space) +(135:\lengthvec-1) coordinate (u1s);
97100
\draw[-{Latex[length=3mm]}] (u_space) -- (u1s) node[right]{$\sigma_1 \bm{u}_1$};
98-
\draw[->] (v1) -- node[below]{$\bm{A} \bm{v}_1=\sigma_1 \bm{u}_1$}(u1s);
101+
\draw[-{Latex[length=2.5mm]}, dashed] (v1) -- node[below]{$\bm{A} \bm{v}_1=\sigma_1 \bm{u}_1$}(u1s);
102+
103+
104+
105+
\path (vr1) +(45:\lengthvec) coordinate (x_ns);
106+
\draw[C7, thin] (vr1) -- (x_ns);
107+
108+
\path (v1) +(-45:\lengthvec) coordinate (x);
109+
\draw[C7, thin] (v1) -- (x);
110+
111+
\draw[-{Latex[length=3mm]}] (v_space) -- (x) node[right]{$\bm{x}=\bm{v}_1 + \bm{v}_{R+1}$};
112+
113+
\draw[-{Latex[length=2.5mm]}, dashed] (x) -- node[below]{$\bm{A} \bm{x}=\sigma_1 \bm{u}_1$} (u1s);
99114

100115
% null to zero vec
101-
\draw[->] (vr1) -- node[above]{$\bm{A} \bm{v}_{R+1}=\bm{0}$}(u_space);
116+
\draw[-{Latex[length=2.5mm]}, dashed] (vr1) -- node[below]{$\bm{A} \bm{v}_{R+1}=\bm{0}$}(u_space);
117+
118+
\path (-0.25,0) +(-90:\lengthvec+2.5) coordinate (S);
119+
\draw (S) node[above]
120+
{
121+
$
122+
\bm{\Sigma}=
123+
\begin{bmatrix}
124+
\sigma_1 & 0& & 0\\
125+
0 & \ddots & & \vdots\\
126+
& & \sigma_R & \\
127+
0 & \cdots & & 0\\
128+
0 & \cdots & & 0
129+
\end{bmatrix}
130+
$};
102131

103132
\end{tikzpicture}
104133
\end{document}
41.8 KB
Binary file not shown.
Lines changed: 131 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,131 @@
1+
\documentclass[crop,tikz]{standalone}
2+
3+
\usepackage[utf8]{inputenc}
4+
\usepackage{fouriernc}
5+
\usepackage[T1]{fontenc}
6+
\usepackage{bm}
7+
\usepackage{amsmath}
8+
\usepackage{nicefrac}
9+
\usepackage{trfsigns}
10+
\usepackage{xcolor}
11+
\usetikzlibrary{arrows.meta}
12+
13+
%matplotlib colors:
14+
\definecolor{C0}{HTML}{1f77b4}
15+
\definecolor{C1}{HTML}{ff7f0e}
16+
\definecolor{C2}{HTML}{2ca02c}
17+
\definecolor{C3}{HTML}{d62728}
18+
\definecolor{C4}{HTML}{9467bd}
19+
\definecolor{C5}{HTML}{8c564b}
20+
\definecolor{C6}{HTML}{e377c2}
21+
\definecolor{C7}{HTML}{7f7f7f}
22+
\definecolor{C8}{HTML}{bcbd22}
23+
\definecolor{C9}{HTML}{17becf}
24+
25+
\begin{document}
26+
\begin{tikzpicture}
27+
28+
\coordinate (u_space) at (+4,0);
29+
\coordinate (v_space) at (-4,0);
30+
\def\lengthrect{4};
31+
\def\lengthvec{3};
32+
33+
\path (0,0) +(90:\lengthvec+2) coordinate (T);
34+
\draw (T) node[above]{Inverse Problem with SVD of $\bm{A}$};
35+
36+
\path (0,0) +(90:\lengthvec+1) coordinate (G);
37+
\draw (G) node[above]{$\bm{A}^+_{N \times M} = \bm{V}_{N \times N} \bm{\Sigma}^+_{N \times M} \bm{U}_{M \times M}^\mathrm{H}$};
38+
39+
\draw[draw=black, rotate around={45:(u_space)}, C0] (u_space) rectangle ++(\lengthrect,\lengthrect);
40+
\draw[draw=black, rotate around={225:(u_space)}, C4] (u_space) rectangle ++(\lengthrect,\lengthrect);
41+
42+
\draw[draw=black, rotate around={45:(v_space)}, C2] (v_space) rectangle ++(\lengthrect,\lengthrect);
43+
\draw[draw=black, rotate around={225:(v_space)}, C1] (v_space) rectangle ++(\lengthrect,\lengthrect);
44+
45+
%zero vectors
46+
\draw[fill] (u_space) circle (2pt) node[right]{$\bm{0}_{M \times 1}$};
47+
\draw[fill] (v_space) circle (2pt) node[left]{$\bm{0}_{N \times 1}$};
48+
49+
% U space stuff:
50+
\path (u_space) +(135:\lengthvec) coordinate (u1);
51+
\draw[-{Latex[length=3mm]}, C0, thick] (u_space) -- (u1) node[left]{$\bm{u}_1$};
52+
53+
\path (u_space) +(45:\lengthvec) coordinate (ur);
54+
\draw[-{Latex[length=3mm]}, C0, thick] (u_space) -- (ur) node[right]{$\bm{u}_R$};
55+
56+
\path (u_space) +(225:\lengthvec) coordinate (ur1);
57+
\draw[-{Latex[length=3mm]}, C4, thick] (u_space) -- (ur1) node[left]{$\bm{u}_{R+1}$};
58+
59+
\path (u_space) +(315:\lengthvec) coordinate (um);
60+
\draw[-{Latex[length=3mm]}, C4, thick] (u_space) -- (um) node[right]{$\bm{u}_{M}$};
61+
62+
\path (u_space) +(90:\lengthvec) coordinate (col_space);
63+
\draw (col_space) node[above]{column space: $\text{Range}(\bm{A})$};
64+
65+
\path (u_space) +(90:\lengthvec-1) coordinate (col_space_dim);
66+
\draw (col_space_dim) node[above]{dim: $R$ = rank$(\bm{A})$};
67+
68+
\path (u_space) +(270:\lengthvec) coordinate (left_null_space);
69+
\draw (left_null_space) node[above]{left null space: $\text{Null}(\bm{A}^\mathrm{H})$};
70+
71+
\path (u_space) +(270:\lengthvec+1) coordinate (left_null_space_dim);
72+
\draw (left_null_space_dim) node[above]{dim: $M-R$};
73+
74+
% V space stuff:
75+
\path (v_space) +(45:\lengthvec) coordinate (v1);
76+
\draw[-{Latex[length=3mm]}, C2, thick] (v_space) -- (v1) node[left]{$\bm{v}_1$};
77+
78+
\path (v_space) +(135:\lengthvec) coordinate (vr);
79+
\draw[-{Latex[length=3mm]}, C2, thick] (v_space) -- (vr) node[left]{$\bm{v}_R$};
80+
81+
\path (v_space) +(315:\lengthvec) coordinate (vr1);
82+
\draw[-{Latex[length=3mm]}, C1, thick] (v_space) -- (vr1) node[right]{$\bm{v}_{R+1}$};
83+
84+
\path (v_space) +(225:\lengthvec) coordinate (vn);
85+
\draw[-{Latex[length=3mm]}, C1, thick] (v_space) -- (vn) node[left]{$\bm{v}_{N}$};
86+
87+
\path (v_space) +(90:\lengthvec) coordinate (row_space);
88+
\draw (row_space) node[above]{row space: $\text{Range}(\bm{A}^\mathrm{H})$};
89+
90+
\path (v_space) +(90:\lengthvec-1) coordinate (row_space_dim);
91+
\draw (row_space_dim) node[above]{dim: $R$ = rank$(\bm{A})$};
92+
93+
\path (v_space) +(270:\lengthvec) coordinate (null_space);
94+
\draw (null_space) node[above]{null space: $\text{Null}(\bm{A})$};
95+
96+
\path (v_space) +(270:\lengthvec+1) coordinate (null_space_dim);
97+
\draw (null_space_dim) node[above]{dim: $N-R$};
98+
99+
\path (u_space) +(135:\lengthvec-1) coordinate (u1s);
100+
\path (u_space) +(225:2) coordinate (b_lns);
101+
\path (b_lns) +(135:2) coordinate (b);
102+
103+
\draw[-{Latex[length=3mm]}] (u_space) -- (u1s) node[right]{$\sigma_1 \bm{u}_1$};
104+
\draw[-{Latex[length=3mm]}] (u_space) -- (b_lns) node[right]{$\bm{e}$};
105+
106+
\draw[C7, thin] (b_lns) -- (b);
107+
\draw[C7, thin] (b) -- (u1s);
108+
109+
\draw[-{Latex[length=3mm]}] (u_space) -- (b) node[below]{$\bm{b}$};
110+
111+
\draw[-{Latex[length=2.5mm]}, dashed] (b) node[left=2cm, above=1cm]{$\bm{v}_1 = \bm{A}^+ \bm{b}$} -- (v1);
112+
\draw[-{Latex[length=2.5mm]}, dashed] (u1s) node[left=2.5cm, above=0.35cm]{$\bm{v}_1 = \bm{A}^+ (\sigma_1 \bm{u}_1)$} -- (v1);
113+
114+
\draw[-{Latex[length=2.5mm]}, dashed] (b_lns) -- node[above]{$\bm{A}^+ \bm{e}=\bm{0}$}(v_space);
115+
116+
117+
\path (-0.25,0) +(-90:\lengthvec+2.5) coordinate (S);
118+
\draw (S) node[above]
119+
{
120+
$
121+
\bm{\Sigma}^+=
122+
\begin{bmatrix}
123+
\nicefrac{1}{\sigma_1} & 0& & 0 & 0\\
124+
0 & \ddots & & \vdots & \vdots\\
125+
& & \nicefrac{1}{\sigma_R} & & \\
126+
0 & \cdots & & 0 & 0
127+
\end{bmatrix}
128+
$};
129+
130+
\end{tikzpicture}
131+
\end{document}

0 commit comments

Comments
 (0)