SlideShare a Scribd company logo
1 of 43
Download to read offline
線形代数計算の視覚化と
⾏列5分解
〜ストラング先⽣から学んだこと〜
平鍋健児(@hiranabe)
Version 1.0
=
1
これは何?
• Gilbert Strang 著
『Linear Algebra for Everyone』
は線形代数を直感理解するのに
とてもいい本です。
• 定理と証明の連鎖ではなく、マトリックス語法と例⽰で直感的な理解と実⽤的な
応⽤法を得ることができます。
• YouTube の MIT Open Courseware、 先⽣の講義プレイリストである 18.06
と 18.065 には、200万⼈の購読者がいます。(ぼくもその⼀⼈です)
• この本のハイライトは、
• AB=C の4つの⾒⽅
• 基本的な4つの部分空間
• 5つのマトリックス分解
• 通常の線形代数の教科書はジョルダン標準形がクライマックスですが、この
本では、SVD です。そして、
• 機械学習を含むデータサイエンスへの⼊⾨につながっています。
• この1と2のコンセプトをグラフィック表現できないか、というアイディアです。
By Kenji Hiranabe with the kindest help of Prof. Gilbert Strang 2
1
2
この発表
のモチベ
ーション
• ⾏列とベクトルの掛け算には、複数の⾒⽅
があります。
• このノートは、それらを可視化し、教育⽤
コンテンツとする試みです。
• それによって ...
• ⾏列とベクトルの演算を直感的に⾏えるよう
になります。
• その直感を、5つの⾏列分解法、などのコンセ
プトの理解につなげることができます。
By Kenji Hiranabe with the kindest help of Prof. Gilbert Strang 3
最新版︓
https://github.com/kenjihiranabe/The-Art-of-Linear-Algebra/
http://math.mit.edu/everyone
5つの⾏列分解
𝐴 = 𝐶𝑅
𝐴 = 𝐿𝑈
𝐴 = 𝑄𝑅
𝑆 = 𝑄Λ𝑄!
𝐴 = 𝑈Σ𝑉!
By Kenji Hiranabe with the kindest help of Prof. Gilbert Strang 4
独⽴列⾏列と⾏簡約⾏列の積
(⾏ランク=列ランクを⽰す)
LU分解=ガウスの消去法
QR分解=Gram-Schmidtの直⾏化
対称⾏列の固有値分解
どんな⻑⽅⾏列にも使える
特異値分解
By Kenji Hiranabe with the kindest help of Prof. Gilbert Strang 5
Foreword
I am happy to see Kenji Hiranabeʻs pictures of matrix operations in linear algebra ! The
pictures are an excellent way to show the algebra. We can think of matrix
multiplications by (row, column) dot products, but that is not all -- it is ``linear
combinations” and ``rank 1 matrices" that complete the algebra and the art.
I am very grateful to see the books in Japanese translation and the ideas in Kenji's
pictures.
-- Gilbert Strang
Professor of Mathematics at MIT
By Kenji Hiranabe with the kindest help of Prof. Gilbert Strang 6
• もうすぐ⽇本語訳発売! • ⽇本語訳決定!
By Kenji Hiranabe with the kindest help of Prof. Gilbert Strang 7
先⽣の講演例:https://www.youtube.com/watch?v=MsIvs_6vC38
⽬次
• ⾏列の⾒⽅ – 4つ
• ベクトルの積 – 2つ
• ⾏列のベクトルの積 – 2つ
• ⾏列と⾏列の積 – 4つ
• 便利な応⽤パターン– 4つ
• ⾏列の有名分解 – 5つ
• 𝐶𝑅, 𝐿𝑈, 𝑄𝑅, 𝑄Λ𝑄!, 𝑈Σ𝑉!
• データサイエンス応⽤で理解する SVD(今⽇だけ)
By Kenji Hiranabe with the kindest help of Prof. Gilbert Strang 8
= = =
3つの数からなる
2つの列ベクトル
2つの数からなる
3つの⾏ベクトル
6つの数
1 つの⾏列
⾏列の⾒⽅ – 4つ
𝐴 =
𝑎!!𝑎!"
𝑎"!𝑎""
𝑎#!𝑎#"
=
|
𝒂𝟏
|
|
𝒂𝟐
|
=
−𝒂!
∗ −
−𝒂"
∗ −
−𝒂#
∗ −
以降、太字で列ベクトル𝒂𝟏、*を付けて⾏ベクトル𝒂"
∗
、を表現する。
また、右肩にTをつけて転置ベクトル𝒂𝐓や転置⾏列𝑨𝐓を表現する。
𝐴 =
1 4
2 5
3 6
=
1 4
2 5
3 6
=
1 4
2 5
3 6
By Kenji Hiranabe with the kindest help of Prof. Gilbert Strang 9
= = =
内積(スカラー) Rank1の⾏列
v1 =
1
2
3
𝑥 𝑦 =
𝑥 𝑦
2𝑥 2𝑦
3𝑥 3𝑦
ベクトルの積 – 2つ
1 2 3
𝑥!
𝑥"
𝑥#
=
1
2
3
,
𝑥!
𝑥"
𝑥#
= 𝑥! + 2𝑥" + 3𝑥#
2つの列ベクトル𝒂, 𝒃を𝒂𝒃!
の順に掛けると、⾏
列 (𝐴 = 𝒂𝒃!
) になる。 𝒂, 𝒃どちらも0でなければ、
この⾏列はRankが1になることが分かる。(各
⾏は定数倍であり、各列も定数倍である)
2つの列ベクトルの内積(𝒂 ) 𝒃)は⾏列形
式では、𝒂!
𝒃 と表現され、1つのスカ
ラーになる。
v2
By Kenji Hiranabe with the kindest help of Prof. Gilbert Strang 10
= = +
⾏列とベクトルの積 – 2つ
𝐴 の⾏ベクトルと列ベクトルの積
(内積)からなる1つの列ベクトル
𝐴 の列ベクトルの線形結合
𝐴𝒙 =
1 2
3 4
5 6
𝑥!
𝑥"
=
(𝑥!+2𝑥")
(3𝑥! + 4𝑥")
(5𝑥! + 6𝑥")
𝐴𝒙 =
1 2
3 4
5 6
𝑥!
𝑥"
= 𝑥!
1
3
5
+ 𝑥"
2
4
6
最初に左を覚えるだろう。しかし、右の⾒⽅ができるようになると、
𝐴𝒙 が𝐴の列ベクトルの線形結合、すなわち、 𝐴の列ベクトル空間 𝐂(𝐴)、
さらに、 𝐴𝒙 = 0 の解がAの零空間 𝐍(𝐴)と読めるようになる。
Mv
1
Mv
2
By Kenji Hiranabe with the kindest help of Prof. Gilbert Strang 11
By Kenji Hiranabe with the kindest help of Prof. Gilbert Strang 12
⾏列と⾏列の積 – 4つ
=
1 2
3 4
5 6
𝑥" 𝑦"
𝑥# 𝑦#
=
(𝑥"+2𝑥#) (𝑦"+2𝑦#)
(3𝑥"+4𝑥#) (3𝑦"+4𝑦#)
(5𝑥"+6𝑥#) (5𝑦"+6𝑦#)
1 2
3 4
5 6
𝑥" 𝑦"
𝑥# 𝑦#
= 𝐴 𝒙 𝒚 = 𝐴𝒙 𝐴𝒚
= =
結果の各列 𝐴𝒙, 𝐴𝒚 は、それぞれ𝐴 の列ベクトルの線形結合
結果の各要素は、⾏ベクトルと列ベクトルの内積
MM
1
MM
2
By Kenji Hiranabe with the kindest help of Prof. Gilbert Strang 13
⾏列と⾏列の積 – 4つ
= +
= =
1 2
3 4
5 6
𝑏"" 𝑏"#
𝑏#" 𝑏##
= 𝒂𝟏 𝒂𝟐
𝒃𝟏
∗
𝒃𝟐
∗ = 𝒂𝟏𝒃𝟏
∗
+ 𝒂𝟐𝒃𝟐
∗
=
1
3
5
𝑏"" 𝑏"# +
2
4
6
𝑏#" 𝑏## =
𝑏"" 𝑏"#
3𝑏"" 3𝑏"#
5𝑏"" 5𝑏"#
+
2𝑏#" 2𝑏##
4𝑏#" 4𝑏##
6𝑏#" 6𝑏##
1 2
3 4
5 6
𝑥" 𝑦"
𝑥# 𝑦#
=
𝒂𝟏
∗
𝒂𝟐
∗
𝒂𝟑
∗
𝑋 =
𝒂𝟏
∗
𝑋
𝒂𝟐
∗
𝑋
𝒂𝟑
∗
𝑋
⾏列の積は、rank 1の⾏列の和に分解される。
結果の各⾏は、⾏ベクトルの線形結合
MM
3
MM
4
By Kenji Hiranabe with the kindest help of Prof. Gilbert Strang 14
便利な応⽤パターン – 3つ
2 3
=
1 2 3
1 1
=
2
1
+
3
+
2
=
2
1
+
3
+
3
=
2
1
+
3
+
MM
2
Mv
2
右からの操作は、列に作⽤する。
この表現は、右の3つの線形結合を
1つの⾏列表現で表したものだとも
⾔える。
P1
using
By Kenji Hiranabe with the kindest help of Prof. Gilbert Strang 15
1
2
3
= 1
2
3
1 = +
1 2 3
+
2 = +
1 2 3
+
3 = +
1 2 3
+
MM
3
左からの操作は、⾏に作⽤する。
この表現は、右の3つの線形結合を
1つの⾏列表現で表したものだとも
⾔える。
P2 using
By Kenji Hiranabe with the kindest help of Prof. Gilbert Strang 16
便利な応⽤パターン – 3つ
= =
𝐴𝐷 = 𝒂𝟏 𝒂𝟐 𝒂𝟑
𝑑!
𝑑"
𝑑#
= 𝑑!𝒂𝟏 𝑑"𝒂𝟐 𝑑"𝒂𝟐 𝐷𝐵 =
𝑑!
𝑑"
𝑑#
𝒃!
∗
𝒃!
∗
𝒃!
∗
=
𝑑!𝒃!
∗
𝑑!𝒃!
∗
𝑑!𝒃!
∗
対⾓⾏列を右から掛けると各列がスカラー倍 対⾓⾏列を左から掛けると各⾏がスカラー倍
これらを⽬に焼き付けると、さらに、、、、
P1ʼ P2ʼ
By Kenji Hiranabe with the kindest help of Prof. Gilbert Strang 17
便利な応⽤パターン – 3つ
スカラー倍された列ベクトルの線形結合(ベクトル漸化式やベクトル線形微分⽅程式で活⽤)
=
𝑿𝑫𝒄 = 𝒙𝟏 𝒙𝟐 𝒙𝟑
𝑑!
𝑑"
𝑑#
𝑐!
𝑐"
𝑐#
= 𝑐!𝑑!𝒙𝟏 + 𝑐"𝑑"𝒙𝟐+ 𝑐#𝑑#𝒙𝟑
+ +
P3
By Kenji Hiranabe with the kindest help of Prof. Gilbert Strang 18
便利な応⽤パターン – 3つ
By Kenji Hiranabe with the kindest help of Prof. Gilbert Strang 19
微分⽅程式、漸化式の例
P3
𝑋 𝑒*+, Λ, 𝒄 𝒙𝟏 𝒙𝟐 𝒙𝟑
= + +
𝑈𝛴𝑉- = 𝒖𝟏 𝒖𝟐 𝒖𝟑
𝜎!
𝜎"
𝜎#
𝒗!
-
𝒗"
-
𝒗#
-
= 𝜎!𝒖!𝒗!
- + 𝜎"𝒖"𝒗"
-+ 𝜎#𝒖#𝒗#
-
rank 1⾏列の和 (SVDや対称⾏列のスペクトル分解で活⽤)
P4
By Kenji Hiranabe with the kindest help of Prof. Gilbert Strang 20
便利な応⽤パターン – 3つ
𝐴 = 𝐶𝑅
𝐴 = 𝐿𝑈
𝐴 = 𝑄𝑅
𝑆 = 𝑄Λ𝑄!
𝐴 = 𝑈Σ𝑉!
By Kenji Hiranabe with the kindest help of Prof. Gilbert Strang 21
独⽴列⾏列と⾏簡約⾏列の積
(⾏ランク=列ランクを⽰す)
LU分解=ガウスの消去法
QR分解=Gram-Schmidtの直⾏化
対称⾏列の固有値分解
どんな⻑⽅⾏列にも使える
特異値分解
⾏列の有名分解 – 5つ
𝐴 = 𝐶𝑅
𝐴の列ベクトルを左から順に⾒て、独⽴なもののみ選び出していく。1,2列⽬は⽣き残り、3列⽬は1列⽬+2列
⽬なので捨てる。残った2つの列ベクトルCを使って𝐴 を復元すると、𝑅には階段⾏列が現れる。
これを、よく⾒て、⼆つの表現で表すと…
⻑⽅⾏列𝐴の⾏ランクと、 𝐴の列ランクが等しいことを最も直感的に⽰す分解。
Cは𝐴の線形独⽴な列ベクトル。 𝑅は⾏簡約階段⾏列(row reduced echelon form)となる。
1 2 3
2 3 5
=
1 2
2 3
1 0 1
0 1 1
|
𝒂𝟏
|
|
𝒂𝟐
|
|
𝒂𝟑
|
=
|
𝒄𝟏
|
|
𝒄𝟐
|
1 0 1
0 1 1
𝒂𝟏 = 𝒄𝟏, 𝒂𝟐= 𝒄𝟐, 𝒂𝟑 = 𝒄𝟏 + 𝒄𝟐
−𝒂"
∗
−
−𝒂#
∗
−
=
1 2
2 3
−𝒓"
∗
−
−𝒓#
∗
−
𝒂"
∗
= 𝒓"
∗
+ 2𝒓#
∗
, 𝒂#
∗
= 2𝒓"
∗
+ 3𝒓#
∗
= 2
1 = 1 + 2 1 + 2 1 + 2
すべての列ベクトルはc1,c2の線形結合。すなわち、列ランク=dim C(𝐴)=2。
= +
1
2
1 2
1 2
+
=
すべての⾏ベクトルはr1,r2の線形結合。すなわち、⾏ランク=dim C(𝐴!
)=2。
𝐴 = 𝐶𝑅
P1
P2
using
using
By Kenji Hiranabe with the kindest help of Prof. Gilbert Strang 22
By Kenji Hiranabe with the kindest help of Prof. Gilbert Strang 23
= 2
1 = 1 + 2 1 + 2 1 + 2
1 2 3
2 3 5
= +
1
2
1 2
1 2
+
=
𝐴 =
|
𝒍𝟏
|
−𝒖!
∗
− +
0 0 0
0
0
𝐴"
=
|
𝒍𝟏
|
−𝒖!
∗
− +
|
𝒍𝟐
|
−𝒖"
∗
− +
0 0 0
0 0 0
0 0 𝐴#
= 𝐿𝑈
𝐴 = 𝐿𝑈
𝐴の⾏1ベクトルと列1ベクトルでできる rank 1⾏列を取り出し、サイズが1つ減った⾏列を𝐴# とする。
この操作を再帰的に繰り返して、rank 1 の和に分解する。
= + +
𝐿𝑈 を逆向きに計算して𝐴 に戻すのは容易。
MM
4
ガウスの消去法は、⾏基本変形をAの左から掛けていくが、その逆⾏列が 𝐿である。
using
By Kenji Hiranabe with the kindest help of Prof. Gilbert Strang 24
=
= + +
𝐿 𝑈
𝐴
By Kenji Hiranabe with the kindest help of Prof. Gilbert Strang 25
=
= + +
𝐿 𝑈
𝐴
1 2 4
2
1
5
5
1
3
=
=
𝐴 = 𝑄𝑅
𝐴の各列ベクトルを、Gram-Schmidtの直⾏化によって𝑄 の列ベクトルに直⾏化する。
その際の係数を逆にすることで、𝑅に上三⾓⾏列が作られる。
Gram-Schmidt の直⾏化。
2 3
1
|
𝒂𝟏
|
|
𝒂𝟐
|
|
𝒂𝟑
|
=
|
𝒒𝟏
|
|
𝒒𝟐
|
|
𝒒𝟑
|
𝑟"" 𝑟"# 𝑟"(
𝑟## 𝑟#(
𝑟((
3
1
+
1 2
+
1 2
+
𝒂𝟏 = 𝑟""𝒒𝟏
𝒂𝟐 = 𝑟"#𝒒𝟏 + 𝑟##𝒒𝟐
𝒂𝟐 = 𝑟"(𝒒𝟏 + 𝑟#(𝒒𝟐 + 𝑟((𝒒𝟑
𝐴 = 𝑄𝑅
P1
using
By Kenji Hiranabe with the kindest help of Prof. Gilbert Strang 26
𝑄 𝑅
𝐴 𝒂𝟏 𝒂𝟐 𝒂𝟑
𝑆 = 𝑄𝛬𝑄-=
|
𝒒𝟏
|
|
𝒒𝟐
|
|
𝒒𝟑
|
𝜆!
𝜆"
𝜆#
−𝒒!
-
−
−𝒒"
- −
−𝒒#
-
−
=𝜆!
|
𝒒𝟏
|
−𝒒!
- − + 𝜆"
|
𝒒𝟐
|
−𝒒"
- − + 𝜆#
|
𝒒𝟑
|
−𝒒#
- −
𝑆 = 𝑄𝛬𝑄*
対称⾏列𝑆は、直⾏⾏列𝑄によって固有値の対⾓⾏列𝛬に対⾓化される。
さらに、これを rank 1 の射影⾏列の和に分解できる。(スペクトル分解)
= 𝜆!𝑃! + 𝜆"𝑃" + 𝜆#𝑃#
対称⾏列𝑆の固有値分解。固有値はすべて実数であり、固有ベクトルは必ず互いに直⾏したものが取れる。
2 3
1
= + +
= 1
2
3
1
1
2
2
3
3 P4
using
By Kenji Hiranabe with the kindest help of Prof. Gilbert Strang 27
𝑄 𝛬
𝑆 𝑄. 𝜆!𝒒𝟏𝒒!
.
𝜆"𝒒𝟐𝒒"
.
𝜆#𝒒𝟑𝒒#
.
𝑆 = 𝑆-
𝑄-𝑄 = 𝑃! +𝑃" + 𝑃# = 𝐼
𝑃!𝑃" = 𝑃"𝑃# = 𝑃#𝑃! = 𝑂
𝐴 = 𝑈Σ𝑉+
𝐴の⾏空間ℝ)
の正規直交基底として𝑉、列空間 ℝ*
の正規直交規定として𝑈をそれぞれうまく取ると、対
⾓化される。これを特異値分解という。さらに、これを rank 1 ⾏列の和に分解できる。
𝐴が⼀般の⻑⽅⾏列の場合でも、特異値分解は必ず可能。
= +
=
1
1
2
2
2 3
1
1
2
P4
using
By Kenji Hiranabe with the kindest help of Prof. Gilbert Strang 28
𝑈 Σ
𝐴 𝑉- 𝜎! 𝒖𝟏𝒗!
-
𝜎" 𝒖𝟐𝒗"
-
𝑈𝑈- = 𝐼/
𝑉𝑉- = 𝐼,
𝐴 = 𝑈Σ𝑉-=
|
𝒖𝟏
|
|
𝒖𝟐
|
|
𝒖𝟑
|
𝜎!
𝜎"
−𝒗!
- −
−𝒗"
- −
=𝜎!
|
𝒖𝟏
|
− 𝒗!
-
− + 𝜎"
|
𝒖𝟐
|
− 𝒗"
-
−
= 𝜎!𝒖𝟏𝒗!
- + 𝜎"𝒖𝟐𝒗"
-
SVDの応⽤からの理解︓ eigenface
Washington ⼤学の Steve Brunton 先⽣の YouTube チャネル
にて、120回以上の動画で詳しくこの本の中について解説されて
いる。その中の、eigenface の回をご紹介。
Databookuw.com
By Kenji Hiranabe with the kindest help of Prof. Gilbert Strang
Eigenfaces – Yale B Dataset
By Kenji Hiranabe with the kindest help of Prof. Gilbert Strang 30
256値×32K 画素×64枚× 36⼈、から、特異値ベクトルを抽出
⾏列の2つの意味(1.写像)
𝐴 ∈ 𝑀 𝑚×𝑛, ℝ m⾏n列の実数要素の⾏列
1. ℝ!→ ℝ" の線形写像と⾒る
By Kenji Hiranabe with the kindest help of Prof. Gilbert Strang 31
ℝ" ℝ#
→
𝑥
𝐴
𝐴𝑥
𝑥∈ℝ" n次元列ベクトル
𝐴𝑥∈ℝ# m次元列ベクトル
𝐶 A = 𝐴𝑥 𝑥∈ℝ"
} Aの列空間⊂ ℝ#
𝑁 A = 𝑥 𝑥∈ℝ", 𝐴𝑥 = 0} Aの零空間⊂ ℝ"
= +
𝐴 の列ベクトルの線形結合
𝑨𝒙 =
1 0
2 1
3 1
𝑥!
𝑥"
= 𝑥!
1
2
3
+ 𝑥"
0
1
1
Mv
2
rank 𝐴 = dim 𝐶(𝐴)
m x n の時、 ℝ%
→ ℝ&
nが⼊⼒m
が出⼒であることに注意。
⾏列の2つの意味(2.データ)
2. ℝ" のデータセットが𝑛列と⾒る。
By Kenji Hiranabe with the kindest help of Prof. Gilbert Strang 32
𝑎$, 𝑎%, … , 𝑎" ∈ ℝ# m次元列ベクトルのデータ
𝑢$, 𝑢%, … , 𝑢# ∈ ℝ# m次元列ベクトルの底
|
𝒂𝟏
|
|
𝒂𝟐
|
|
𝒂𝟑
|
=
|
𝒆𝟏
|
|
𝒆𝟐
|
|
𝒆𝟑
|
1 0 1
2
3
1
1
3
4
2 3
=
1
2 3
1
1
=
2
1
+
3
+
2
=
2
1
+
3
+
3
=
2
1
+
3
+
P1
𝒂𝟏 = 𝒖𝟏, 𝒂𝟐 = 𝒖𝟐, 𝒂𝟐 = 𝒖𝟏 + 𝒖𝟐
|
𝒂𝟏
|
|
𝒂𝟐
|
|
𝒂𝟑
|
=
|
𝒖𝟏
|
|
𝒖𝟐
|
|
𝒖𝟑
|
1 0 1
0
0
1
0
1
0
新しい基底(u1,u2,u3)の線形結合として各列を表す
通常の基底(e1,e2,e3)の線形結合として各列を表す 基底
この基底での「座標」
もしくは「成分」が
縦に並ぶ。
各データベクトル
𝑨 =
1 0 1
2
3
1
1
3
4
フーリエ変換等でもデータ圧縮可能
だが、SVDではデータ駆動で(デー
タ全体を⾒てから)有効な底を決め
る。
固有値/固有ベクトル(復習)
𝐴 ∈ 𝑀 𝑛×𝑛, ℝ n⾏n列の実数要素の正⽅⾏列
1. ℝ!→ ℝ! の線形写像と⾒る
By Kenji Hiranabe with the kindest help of Prof. Gilbert Strang 33
ℝ" ℝ"
→
𝑥
𝐴
𝐴𝑥
⽅向を変えないベクトルがある。
それらを基底とする(座標は⼲渉しないで定数倍になる)。
𝐴𝒑$ = 𝜆$𝒑$
𝐴𝒑% = 𝜆%𝒑%
𝐴𝒑& = 𝜆&𝒑&
𝐴𝑥 = 𝜆𝑥
𝐴𝑃 = 𝑃𝛬, 𝐴 = 𝑃𝛬𝑃2!
𝑨
|
𝒑𝟏
|
|
𝒑𝟐
|
|
𝒑𝟑
|
=
|
𝒑𝟏
|
|
𝒑𝟐
|
|
𝒑𝟑
|
𝜆!
𝜆"
𝜆#
1
= 1
1
2
= 2
2
3
= 3
3
1
2
3
2 3
1
2 3
1
=
※必ずn本取れるとは限らない。
対称⾏列なら正規直交なPが必ず取れ、λは実数。
特異値/特異ベクトル
𝐴 ∈ 𝑀 𝑚×𝑛, ℝ m⾏n列の実数要素の⻑⽅⾏列
1. ℝ!→ ℝ" の線形写像と⾒る
By Kenji Hiranabe with the kindest help of Prof. Gilbert Strang 34
ℝ" ℝ#
→
𝑥
𝐴
𝐴𝑥
別の正規直⾏ベクトルを基底とする。
座標は⼲渉しないで定数倍(⾮負の実数)になる。
𝐴𝒗$ = 𝜎$𝒖$
𝐴𝒗% = 𝜎%𝒖%
𝐴𝒗& = 𝜎&𝒖&
𝐴𝑉 = 𝑈Σ
𝐴 = 𝑈Σ𝑉!
1
= 1
1
2
= 2
2
3
= 3
3
1
2
3
2 3
1
2 3
1
=
※必ず分解でき、⼀意になる。
1
2
3
2 3
1
= 1
2
3
特異値/特異ベクトル
1. 𝑛個の ℝ" のデータセットと⾒る。
By Kenji Hiranabe with the kindest help of Prof. Gilbert Strang 35
2 3
1
2 3
1 1
=
2
1
+
3
+
2
=
2
1
+
3
+
3
=
2
1
+
3
+
新基底
各データベクトル
(各⾃の顔データ)
2 3
1
=
=
新基底
(eigen face)
𝐴 = 𝑈Σ𝑉"
𝐴 =
|
𝒖𝟏
|
|
𝒖𝟐
|
|
𝒖𝟑
|
𝜎&
𝜎'
𝜎(
−𝒗&
"
−
−𝒗'
" −
−𝒗(
"
−
𝐴 𝑉'
𝑈 Σ (Σ𝑉')
𝑈
=
=
A	の各列(face)は、新基底(eigenface)の線形結合。
A	全体の中での信号の強さが特異値。
データごとの
Mixture(Vの⾏)
信号の強さ
(特異値)
新基底での座標
(各⾃の顔の成分)
新基底での座標
(各⾃の顔の成分)
By Kenji Hiranabe with the kindest help of Prof. Gilbert Strang 36
⼿で分解するには、 𝐴'𝐴(どんな𝐴でも対称⾏列となる)を使う。
𝐴 = 𝑈Σ𝑉"
𝐴"𝐴 = (𝑈Σ𝑉")"𝑈Σ𝑉" = 𝑉Σ'𝑉"
となり、 𝐴"𝐴(対称⾏列)の対⾓化(固有値)を求めるのと同じ問題に帰着。
1. 𝐴"𝐴 を計算。
2. それを対⾓化、すなわち固有値𝜎'と固有ベクトル 𝒗 をn個求める。
3. それらが、 Σ', 𝑉 となる。
4. Σと𝑉が求まったら、 𝐴𝒗 = 𝜎𝒖 より、𝒗 に対応する 𝒖求めて、 𝑼とする。
これは⼿計算⽤で、通常、コンピュータの数値演算は全く違う
⽅法(シフト付きQRなど) をとる。
特異値/特異ベクトル
By Kenji Hiranabe with the kindest help of Prof. Gilbert Strang 37
直感で SVD 出来ますか︖
1. 𝐴 = 3
2. 𝐴 =
1
2
3. 𝐴 =
1 3
2 6
直感 or 計算で SVD 出来ますか︖
ポイント
𝐴 = 𝑈Σ𝑉!
単位直⾏⾏列
(⻑さ・⾓度を変えない)
(回転と捉えて良い)
対⾓⾏列
(向きを変えない)
(スケールと捉えて良い)
𝑈
𝑉
𝑈の次元は?
𝑉の次元は?
ℝ" ℝ#
𝐴
⾏空間 列空間
→
= 1 3 1
=
1
5
1
2
5 1
=
1
5
1 −2
2 1
5
0
1
特異値/特異ベクトル
Eigenfaces – Yale B Dataset
By Kenji Hiranabe with the kindest help of Prof. Gilbert Strang 38
256値×32K 画素×64枚× 36⼈、から、特異値ベクトルを抽出
最初の 64 eigenfaces(ちょっと怖い…)
By Kenji Hiranabe with the kindest help of Prof. Gilbert Strang 39
By Kenji Hiranabe with the kindest help of Prof. Gilbert Strang 40
顔データを元よりも少数
次元の基底によって復元
する。
基底は、U を特異値の⼩
さい⽅を削除ししまった
近似。
このU平⾯に新しい顔を
射影し、その座標(少数)
をαという。このαを使っ
て、新しい顔を表現する。
(データ圧縮)
顔を次元を順次増
やして復元。
効率は良くないが、
⽝も表現できるよ。
(だいぶ怖い)
参照⽂献と
謝辞
• Linear Algebra for Everyone
(⽇本語 来年)
http://math.mit.edu/everyone/
• MIT OpenCourseWare 18.06
http://web.mit.edu/18.06/www/vi
deos.shtml
• A 2020 Vision of Linear Algebra
https://ocw.mit.edu/resources/res
-18-010-a-2020-vision-of-linear-
algebra-spring-2020/
• マトリックスワールド
https://anagileway.com/2020/09/
29/matrix-world-in-linear-algebra-
for-everyone/
• 4つの部分空間 Tシャツ
https://anagileway.com/2020/06/
04/prof-gilbert-strang-linear-
algebra/
This work is inspired by Prof. Strangʼs
books and lecture videos. I deeply
appreciate his work, passion and
personality.
By Kenji Hiranabe with the kindest help of Prof. Gilbert Strang
41
By Kenji Hiranabe with the kindest help of Prof. Gilbert Strang 42
Tシャツ作った!
Thank you for
reading!
Any comments or feedbacks are welcome to:
Kenji Hiranabe (hiranabe@gmail.com)
=
43

More Related Content

What's hot

低ランク性および平滑性を用いたテンソル補完 (Tensor Completion based on Low-rank and Smooth Structu...
低ランク性および平滑性を用いたテンソル補完 (Tensor Completion based on Low-rank and Smooth Structu...低ランク性および平滑性を用いたテンソル補完 (Tensor Completion based on Low-rank and Smooth Structu...
低ランク性および平滑性を用いたテンソル補完 (Tensor Completion based on Low-rank and Smooth Structu...Tatsuya Yokota
 
社会心理学者のための時系列分析入門_小森
社会心理学者のための時系列分析入門_小森社会心理学者のための時系列分析入門_小森
社会心理学者のための時系列分析入門_小森Masashi Komori
 
機械学習のためのベイズ最適化入門
機械学習のためのベイズ最適化入門機械学習のためのベイズ最適化入門
機械学習のためのベイズ最適化入門hoxo_m
 
深層生成モデルと世界モデル
深層生成モデルと世界モデル深層生成モデルと世界モデル
深層生成モデルと世界モデルMasahiro Suzuki
 
PCAの最終形態GPLVMの解説
PCAの最終形態GPLVMの解説PCAの最終形態GPLVMの解説
PCAの最終形態GPLVMの解説弘毅 露崎
 
合成変量とアンサンブル:回帰森と加法モデルの要点
合成変量とアンサンブル:回帰森と加法モデルの要点合成変量とアンサンブル:回帰森と加法モデルの要点
合成変量とアンサンブル:回帰森と加法モデルの要点Ichigaku Takigawa
 
PRML輪読#1
PRML輪読#1PRML輪読#1
PRML輪読#1matsuolab
 
MIRU2016 チュートリアル
MIRU2016 チュートリアルMIRU2016 チュートリアル
MIRU2016 チュートリアルShunsuke Ono
 
アンサンブル木モデル解釈のためのモデル簡略化法
アンサンブル木モデル解釈のためのモデル簡略化法アンサンブル木モデル解釈のためのモデル簡略化法
アンサンブル木モデル解釈のためのモデル簡略化法Satoshi Hara
 
「世界モデル」と関連研究について
「世界モデル」と関連研究について「世界モデル」と関連研究について
「世界モデル」と関連研究についてMasahiro Suzuki
 
スパースモデリングによる多次元信号・画像復元
スパースモデリングによる多次元信号・画像復元スパースモデリングによる多次元信号・画像復元
スパースモデリングによる多次元信号・画像復元Shogo Muramatsu
 
因果探索: 基本から最近の発展までを概説
因果探索: 基本から最近の発展までを概説因果探索: 基本から最近の発展までを概説
因果探索: 基本から最近の発展までを概説Shiga University, RIKEN
 
探索と活用の戦略 ベイズ最適化と多腕バンディット
探索と活用の戦略 ベイズ最適化と多腕バンディット探索と活用の戦略 ベイズ最適化と多腕バンディット
探索と活用の戦略 ベイズ最適化と多腕バンディットH Okazaki
 
グラフィカル Lasso を用いた異常検知
グラフィカル Lasso を用いた異常検知グラフィカル Lasso を用いた異常検知
グラフィカル Lasso を用いた異常検知Yuya Takashina
 
深層学習の不確実性 - Uncertainty in Deep Neural Networks -
深層学習の不確実性 - Uncertainty in Deep Neural Networks -深層学習の不確実性 - Uncertainty in Deep Neural Networks -
深層学習の不確実性 - Uncertainty in Deep Neural Networks -tmtm otm
 
ベイズ統計学の概論的紹介
ベイズ統計学の概論的紹介ベイズ統計学の概論的紹介
ベイズ統計学の概論的紹介Naoki Hayashi
 
2014 3 13(テンソル分解の基礎)
2014 3 13(テンソル分解の基礎)2014 3 13(テンソル分解の基礎)
2014 3 13(テンソル分解の基礎)Tatsuya Yokota
 
構造方程式モデルによる因果推論: 因果構造探索に関する最近の発展
構造方程式モデルによる因果推論: 因果構造探索に関する最近の発展構造方程式モデルによる因果推論: 因果構造探索に関する最近の発展
構造方程式モデルによる因果推論: 因果構造探索に関する最近の発展Shiga University, RIKEN
 
最適輸送入門
最適輸送入門最適輸送入門
最適輸送入門joisino
 
機械学習モデルの判断根拠の説明(Ver.2)
機械学習モデルの判断根拠の説明(Ver.2)機械学習モデルの判断根拠の説明(Ver.2)
機械学習モデルの判断根拠の説明(Ver.2)Satoshi Hara
 

What's hot (20)

低ランク性および平滑性を用いたテンソル補完 (Tensor Completion based on Low-rank and Smooth Structu...
低ランク性および平滑性を用いたテンソル補完 (Tensor Completion based on Low-rank and Smooth Structu...低ランク性および平滑性を用いたテンソル補完 (Tensor Completion based on Low-rank and Smooth Structu...
低ランク性および平滑性を用いたテンソル補完 (Tensor Completion based on Low-rank and Smooth Structu...
 
社会心理学者のための時系列分析入門_小森
社会心理学者のための時系列分析入門_小森社会心理学者のための時系列分析入門_小森
社会心理学者のための時系列分析入門_小森
 
機械学習のためのベイズ最適化入門
機械学習のためのベイズ最適化入門機械学習のためのベイズ最適化入門
機械学習のためのベイズ最適化入門
 
深層生成モデルと世界モデル
深層生成モデルと世界モデル深層生成モデルと世界モデル
深層生成モデルと世界モデル
 
PCAの最終形態GPLVMの解説
PCAの最終形態GPLVMの解説PCAの最終形態GPLVMの解説
PCAの最終形態GPLVMの解説
 
合成変量とアンサンブル:回帰森と加法モデルの要点
合成変量とアンサンブル:回帰森と加法モデルの要点合成変量とアンサンブル:回帰森と加法モデルの要点
合成変量とアンサンブル:回帰森と加法モデルの要点
 
PRML輪読#1
PRML輪読#1PRML輪読#1
PRML輪読#1
 
MIRU2016 チュートリアル
MIRU2016 チュートリアルMIRU2016 チュートリアル
MIRU2016 チュートリアル
 
アンサンブル木モデル解釈のためのモデル簡略化法
アンサンブル木モデル解釈のためのモデル簡略化法アンサンブル木モデル解釈のためのモデル簡略化法
アンサンブル木モデル解釈のためのモデル簡略化法
 
「世界モデル」と関連研究について
「世界モデル」と関連研究について「世界モデル」と関連研究について
「世界モデル」と関連研究について
 
スパースモデリングによる多次元信号・画像復元
スパースモデリングによる多次元信号・画像復元スパースモデリングによる多次元信号・画像復元
スパースモデリングによる多次元信号・画像復元
 
因果探索: 基本から最近の発展までを概説
因果探索: 基本から最近の発展までを概説因果探索: 基本から最近の発展までを概説
因果探索: 基本から最近の発展までを概説
 
探索と活用の戦略 ベイズ最適化と多腕バンディット
探索と活用の戦略 ベイズ最適化と多腕バンディット探索と活用の戦略 ベイズ最適化と多腕バンディット
探索と活用の戦略 ベイズ最適化と多腕バンディット
 
グラフィカル Lasso を用いた異常検知
グラフィカル Lasso を用いた異常検知グラフィカル Lasso を用いた異常検知
グラフィカル Lasso を用いた異常検知
 
深層学習の不確実性 - Uncertainty in Deep Neural Networks -
深層学習の不確実性 - Uncertainty in Deep Neural Networks -深層学習の不確実性 - Uncertainty in Deep Neural Networks -
深層学習の不確実性 - Uncertainty in Deep Neural Networks -
 
ベイズ統計学の概論的紹介
ベイズ統計学の概論的紹介ベイズ統計学の概論的紹介
ベイズ統計学の概論的紹介
 
2014 3 13(テンソル分解の基礎)
2014 3 13(テンソル分解の基礎)2014 3 13(テンソル分解の基礎)
2014 3 13(テンソル分解の基礎)
 
構造方程式モデルによる因果推論: 因果構造探索に関する最近の発展
構造方程式モデルによる因果推論: 因果構造探索に関する最近の発展構造方程式モデルによる因果推論: 因果構造探索に関する最近の発展
構造方程式モデルによる因果推論: 因果構造探索に関する最近の発展
 
最適輸送入門
最適輸送入門最適輸送入門
最適輸送入門
 
機械学習モデルの判断根拠の説明(Ver.2)
機械学習モデルの判断根拠の説明(Ver.2)機械学習モデルの判断根拠の説明(Ver.2)
機械学習モデルの判断根拠の説明(Ver.2)
 

Similar to Graphic Notes on Linear Algebra and Data Science

Graphic Notes on Introduction to Linear Algebra
Graphic Notes on Introduction to Linear AlgebraGraphic Notes on Introduction to Linear Algebra
Graphic Notes on Introduction to Linear AlgebraKenji Hiranabe
 
行列(人間科学のための基礎数学)
行列(人間科学のための基礎数学)行列(人間科学のための基礎数学)
行列(人間科学のための基礎数学)Masahiro Okano
 
chapter1_part2.pdf
chapter1_part2.pdfchapter1_part2.pdf
chapter1_part2.pdfAliEb2
 
Examples of Functions and Their Graphs.pptx
Examples of Functions and Their Graphs.pptxExamples of Functions and Their Graphs.pptx
Examples of Functions and Their Graphs.pptxJimmyAbalos1
 
Parallel Line Properties
Parallel Line PropertiesParallel Line Properties
Parallel Line PropertiesFidelfo Moral
 
Rabbit challenge 1_math
Rabbit challenge 1_mathRabbit challenge 1_math
Rabbit challenge 1_mathTOMMYLINK1
 
1539 graphs linear equations and functions
1539 graphs linear equations and functions1539 graphs linear equations and functions
1539 graphs linear equations and functionsDr Fereidoun Dejahang
 
Get the facts, jack!
Get the facts, jack!Get the facts, jack!
Get the facts, jack!sgibson1626
 
February 17, 2015
February 17, 2015February 17, 2015
February 17, 2015khyps13
 
Lecture_9_LA_Review.pptx
Lecture_9_LA_Review.pptxLecture_9_LA_Review.pptx
Lecture_9_LA_Review.pptxSunny432360
 
Applied mathematics
Applied mathematicsApplied mathematics
Applied mathematicsssuserada5be
 
Algebra equations & inequalities
Algebra equations & inequalitiesAlgebra equations & inequalities
Algebra equations & inequalitiesOurutopy
 
CLASS 9 LINEAR EQUATIONS IN TWO VARIABLES PPT
CLASS 9 LINEAR EQUATIONS IN TWO VARIABLES PPTCLASS 9 LINEAR EQUATIONS IN TWO VARIABLES PPT
CLASS 9 LINEAR EQUATIONS IN TWO VARIABLES PPT05092000
 

Similar to Graphic Notes on Linear Algebra and Data Science (20)

Graphic Notes on Introduction to Linear Algebra
Graphic Notes on Introduction to Linear AlgebraGraphic Notes on Introduction to Linear Algebra
Graphic Notes on Introduction to Linear Algebra
 
行列(人間科学のための基礎数学)
行列(人間科学のための基礎数学)行列(人間科学のための基礎数学)
行列(人間科学のための基礎数学)
 
MT102 Лекц 16
MT102 Лекц 16MT102 Лекц 16
MT102 Лекц 16
 
Matrix algebra
Matrix algebraMatrix algebra
Matrix algebra
 
chapter1_part2.pdf
chapter1_part2.pdfchapter1_part2.pdf
chapter1_part2.pdf
 
Examples of Functions and Their Graphs.pptx
Examples of Functions and Their Graphs.pptxExamples of Functions and Their Graphs.pptx
Examples of Functions and Their Graphs.pptx
 
Parallel Line Properties
Parallel Line PropertiesParallel Line Properties
Parallel Line Properties
 
Rabbit challenge 1_math
Rabbit challenge 1_mathRabbit challenge 1_math
Rabbit challenge 1_math
 
MT102 Лекц 15
MT102 Лекц 15MT102 Лекц 15
MT102 Лекц 15
 
1539 graphs linear equations and functions
1539 graphs linear equations and functions1539 graphs linear equations and functions
1539 graphs linear equations and functions
 
Get the facts, jack!
Get the facts, jack!Get the facts, jack!
Get the facts, jack!
 
February 17, 2015
February 17, 2015February 17, 2015
February 17, 2015
 
Lecture_9_LA_Review.pptx
Lecture_9_LA_Review.pptxLecture_9_LA_Review.pptx
Lecture_9_LA_Review.pptx
 
Applied mathematics
Applied mathematicsApplied mathematics
Applied mathematics
 
Algebra equations & inequalities
Algebra equations & inequalitiesAlgebra equations & inequalities
Algebra equations & inequalities
 
Linear relations
   Linear relations   Linear relations
Linear relations
 
Differentiation
Differentiation Differentiation
Differentiation
 
CLASS 9 LINEAR EQUATIONS IN TWO VARIABLES PPT
CLASS 9 LINEAR EQUATIONS IN TWO VARIABLES PPTCLASS 9 LINEAR EQUATIONS IN TWO VARIABLES PPT
CLASS 9 LINEAR EQUATIONS IN TWO VARIABLES PPT
 
Maths
MathsMaths
Maths
 
Lecture_1_matrix_operations.pdf
Lecture_1_matrix_operations.pdfLecture_1_matrix_operations.pdf
Lecture_1_matrix_operations.pdf
 

More from Kenji Hiranabe

effective ba for online communication
effective ba for online communication effective ba for online communication
effective ba for online communication Kenji Hiranabe
 
線形代数の視覚的理解 V1.1-Gストラング勉強会
線形代数の視覚的理解 V1.1-Gストラング勉強会線形代数の視覚的理解 V1.1-Gストラング勉強会
線形代数の視覚的理解 V1.1-Gストラング勉強会Kenji Hiranabe
 
Math in Machine Learning / PCA and SVD with Applications
Math in Machine Learning / PCA and SVD with ApplicationsMath in Machine Learning / PCA and SVD with Applications
Math in Machine Learning / PCA and SVD with ApplicationsKenji Hiranabe
 
Scrum-Fest-Sapporo-2021-Keynote-Our-Journey
Scrum-Fest-Sapporo-2021-Keynote-Our-JourneyScrum-Fest-Sapporo-2021-Keynote-Our-Journey
Scrum-Fest-Sapporo-2021-Keynote-Our-JourneyKenji Hiranabe
 
Appreciating Your Way to XP
Appreciating Your Way to XPAppreciating Your Way to XP
Appreciating Your Way to XPKenji Hiranabe
 
Digital Business and Agile
Digital Business and AgileDigital Business and Agile
Digital Business and AgileKenji Hiranabe
 
線形代数の視覚的理解のためのノート
線形代数の視覚的理解のためのノート線形代数の視覚的理解のためのノート
線形代数の視覚的理解のためのノートKenji Hiranabe
 
with コロナ時代のアジャイルとコミュニケーション
with コロナ時代のアジャイルとコミュニケーションwith コロナ時代のアジャイルとコミュニケーション
with コロナ時代のアジャイルとコミュニケーションKenji Hiranabe
 
Agile Ba with Covid at Redmine Japan 2020
Agile Ba with Covid at Redmine Japan 2020Agile Ba with Covid at Redmine Japan 2020
Agile Ba with Covid at Redmine Japan 2020Kenji Hiranabe
 
ESM Agile Studio DX and COVID
ESM Agile Studio DX and COVIDESM Agile Studio DX and COVID
ESM Agile Studio DX and COVIDKenji Hiranabe
 
Essence position talk by hiranabe
Essence position talk by hiranabeEssence position talk by hiranabe
Essence position talk by hiranabeKenji Hiranabe
 
Agile Scrum at Knowledge Forum 2020
Agile Scrum at Knowledge Forum 2020Agile Scrum at Knowledge Forum 2020
Agile Scrum at Knowledge Forum 2020Kenji Hiranabe
 
Ba and digital here now ness
Ba and digital here now nessBa and digital here now ness
Ba and digital here now nessKenji Hiranabe
 
Modeling in the Agile Age and casual astah models
Modeling in the Agile Age and casual astah modelsModeling in the Agile Age and casual astah models
Modeling in the Agile Age and casual astah modelsKenji Hiranabe
 
Modeling in the Agile Age
Modeling in the Agile Age Modeling in the Agile Age
Modeling in the Agile Age Kenji Hiranabe
 
Agile in automotive industry
Agile in automotive industryAgile in automotive industry
Agile in automotive industryKenji Hiranabe
 
Introduction to Agile - how business and engineer team up
Introduction to Agile - how business and engineer team upIntroduction to Agile - how business and engineer team up
Introduction to Agile - how business and engineer team upKenji Hiranabe
 
5-principles-for-project-facilitation
5-principles-for-project-facilitation5-principles-for-project-facilitation
5-principles-for-project-facilitationKenji Hiranabe
 
Nonaka Scrum - The New New Product Development Game, SECI model, The US Marin...
Nonaka Scrum - The New New Product Development Game, SECI model, The US Marin...Nonaka Scrum - The New New Product Development Game, SECI model, The US Marin...
Nonaka Scrum - The New New Product Development Game, SECI model, The US Marin...Kenji Hiranabe
 

More from Kenji Hiranabe (20)

effective ba for online communication
effective ba for online communication effective ba for online communication
effective ba for online communication
 
線形代数の視覚的理解 V1.1-Gストラング勉強会
線形代数の視覚的理解 V1.1-Gストラング勉強会線形代数の視覚的理解 V1.1-Gストラング勉強会
線形代数の視覚的理解 V1.1-Gストラング勉強会
 
Math in Machine Learning / PCA and SVD with Applications
Math in Machine Learning / PCA and SVD with ApplicationsMath in Machine Learning / PCA and SVD with Applications
Math in Machine Learning / PCA and SVD with Applications
 
Scrum-Fest-Sapporo-2021-Keynote-Our-Journey
Scrum-Fest-Sapporo-2021-Keynote-Our-JourneyScrum-Fest-Sapporo-2021-Keynote-Our-Journey
Scrum-Fest-Sapporo-2021-Keynote-Our-Journey
 
Appreciating Your Way to XP
Appreciating Your Way to XPAppreciating Your Way to XP
Appreciating Your Way to XP
 
Digital Business and Agile
Digital Business and AgileDigital Business and Agile
Digital Business and Agile
 
線形代数の視覚的理解のためのノート
線形代数の視覚的理解のためのノート線形代数の視覚的理解のためのノート
線形代数の視覚的理解のためのノート
 
with コロナ時代のアジャイルとコミュニケーション
with コロナ時代のアジャイルとコミュニケーションwith コロナ時代のアジャイルとコミュニケーション
with コロナ時代のアジャイルとコミュニケーション
 
Agile Ba with Covid at Redmine Japan 2020
Agile Ba with Covid at Redmine Japan 2020Agile Ba with Covid at Redmine Japan 2020
Agile Ba with Covid at Redmine Japan 2020
 
ESM Agile Studio DX and COVID
ESM Agile Studio DX and COVIDESM Agile Studio DX and COVID
ESM Agile Studio DX and COVID
 
Agile Ba with Covid
Agile Ba with CovidAgile Ba with Covid
Agile Ba with Covid
 
Essence position talk by hiranabe
Essence position talk by hiranabeEssence position talk by hiranabe
Essence position talk by hiranabe
 
Agile Scrum at Knowledge Forum 2020
Agile Scrum at Knowledge Forum 2020Agile Scrum at Knowledge Forum 2020
Agile Scrum at Knowledge Forum 2020
 
Ba and digital here now ness
Ba and digital here now nessBa and digital here now ness
Ba and digital here now ness
 
Modeling in the Agile Age and casual astah models
Modeling in the Agile Age and casual astah modelsModeling in the Agile Age and casual astah models
Modeling in the Agile Age and casual astah models
 
Modeling in the Agile Age
Modeling in the Agile Age Modeling in the Agile Age
Modeling in the Agile Age
 
Agile in automotive industry
Agile in automotive industryAgile in automotive industry
Agile in automotive industry
 
Introduction to Agile - how business and engineer team up
Introduction to Agile - how business and engineer team upIntroduction to Agile - how business and engineer team up
Introduction to Agile - how business and engineer team up
 
5-principles-for-project-facilitation
5-principles-for-project-facilitation5-principles-for-project-facilitation
5-principles-for-project-facilitation
 
Nonaka Scrum - The New New Product Development Game, SECI model, The US Marin...
Nonaka Scrum - The New New Product Development Game, SECI model, The US Marin...Nonaka Scrum - The New New Product Development Game, SECI model, The US Marin...
Nonaka Scrum - The New New Product Development Game, SECI model, The US Marin...
 

Recently uploaded

Bioteknologi kelas 10 kumer smapsa .pptx
Bioteknologi kelas 10 kumer smapsa .pptxBioteknologi kelas 10 kumer smapsa .pptx
Bioteknologi kelas 10 kumer smapsa .pptx023NiWayanAnggiSriWa
 
BUMI DAN ANTARIKSA PROJEK IPAS SMK KELAS X.pdf
BUMI DAN ANTARIKSA PROJEK IPAS SMK KELAS X.pdfBUMI DAN ANTARIKSA PROJEK IPAS SMK KELAS X.pdf
BUMI DAN ANTARIKSA PROJEK IPAS SMK KELAS X.pdfWildaNurAmalia2
 
User Guide: Magellan MX™ Weather Station
User Guide: Magellan MX™ Weather StationUser Guide: Magellan MX™ Weather Station
User Guide: Magellan MX™ Weather StationColumbia Weather Systems
 
Good agricultural practices 3rd year bpharm. herbal drug technology .pptx
Good agricultural practices 3rd year bpharm. herbal drug technology .pptxGood agricultural practices 3rd year bpharm. herbal drug technology .pptx
Good agricultural practices 3rd year bpharm. herbal drug technology .pptxSimeonChristian
 
Citronella presentation SlideShare mani upadhyay
Citronella presentation SlideShare mani upadhyayCitronella presentation SlideShare mani upadhyay
Citronella presentation SlideShare mani upadhyayupadhyaymani499
 
Pests of soyabean_Binomics_IdentificationDr.UPR.pdf
Pests of soyabean_Binomics_IdentificationDr.UPR.pdfPests of soyabean_Binomics_IdentificationDr.UPR.pdf
Pests of soyabean_Binomics_IdentificationDr.UPR.pdfPirithiRaju
 
User Guide: Capricorn FLX™ Weather Station
User Guide: Capricorn FLX™ Weather StationUser Guide: Capricorn FLX™ Weather Station
User Guide: Capricorn FLX™ Weather StationColumbia Weather Systems
 
Harmful and Useful Microorganisms Presentation
Harmful and Useful Microorganisms PresentationHarmful and Useful Microorganisms Presentation
Harmful and Useful Microorganisms Presentationtahreemzahra82
 
REVISTA DE BIOLOGIA E CIÊNCIAS DA TERRA ISSN 1519-5228 - Artigo_Bioterra_V24_...
REVISTA DE BIOLOGIA E CIÊNCIAS DA TERRA ISSN 1519-5228 - Artigo_Bioterra_V24_...REVISTA DE BIOLOGIA E CIÊNCIAS DA TERRA ISSN 1519-5228 - Artigo_Bioterra_V24_...
REVISTA DE BIOLOGIA E CIÊNCIAS DA TERRA ISSN 1519-5228 - Artigo_Bioterra_V24_...Universidade Federal de Sergipe - UFS
 
Environmental Biotechnology Topic:- Microbial Biosensor
Environmental Biotechnology Topic:- Microbial BiosensorEnvironmental Biotechnology Topic:- Microbial Biosensor
Environmental Biotechnology Topic:- Microbial Biosensorsonawaneprad
 
Call Girls in Munirka Delhi 💯Call Us 🔝8264348440🔝
Call Girls in Munirka Delhi 💯Call Us 🔝8264348440🔝Call Girls in Munirka Delhi 💯Call Us 🔝8264348440🔝
Call Girls in Munirka Delhi 💯Call Us 🔝8264348440🔝soniya singh
 
Functional group interconversions(oxidation reduction)
Functional group interconversions(oxidation reduction)Functional group interconversions(oxidation reduction)
Functional group interconversions(oxidation reduction)itwameryclare
 
Topic 9- General Principles of International Law.pptx
Topic 9- General Principles of International Law.pptxTopic 9- General Principles of International Law.pptx
Topic 9- General Principles of International Law.pptxJorenAcuavera1
 
OECD bibliometric indicators: Selected highlights, April 2024
OECD bibliometric indicators: Selected highlights, April 2024OECD bibliometric indicators: Selected highlights, April 2024
OECD bibliometric indicators: Selected highlights, April 2024innovationoecd
 
Dubai Calls Girl Lisa O525547819 Lexi Call Girls In Dubai
Dubai Calls Girl Lisa O525547819 Lexi Call Girls In DubaiDubai Calls Girl Lisa O525547819 Lexi Call Girls In Dubai
Dubai Calls Girl Lisa O525547819 Lexi Call Girls In Dubaikojalkojal131
 
Best Call Girls In Sector 29 Gurgaon❤️8860477959 EscorTs Service In 24/7 Delh...
Best Call Girls In Sector 29 Gurgaon❤️8860477959 EscorTs Service In 24/7 Delh...Best Call Girls In Sector 29 Gurgaon❤️8860477959 EscorTs Service In 24/7 Delh...
Best Call Girls In Sector 29 Gurgaon❤️8860477959 EscorTs Service In 24/7 Delh...lizamodels9
 
Four Spheres of the Earth Presentation.ppt
Four Spheres of the Earth Presentation.pptFour Spheres of the Earth Presentation.ppt
Four Spheres of the Earth Presentation.pptJoemSTuliba
 
Davis plaque method.pptx recombinant DNA technology
Davis plaque method.pptx recombinant DNA technologyDavis plaque method.pptx recombinant DNA technology
Davis plaque method.pptx recombinant DNA technologycaarthichand2003
 
Pests of jatropha_Bionomics_identification_Dr.UPR.pdf
Pests of jatropha_Bionomics_identification_Dr.UPR.pdfPests of jatropha_Bionomics_identification_Dr.UPR.pdf
Pests of jatropha_Bionomics_identification_Dr.UPR.pdfPirithiRaju
 

Recently uploaded (20)

Bioteknologi kelas 10 kumer smapsa .pptx
Bioteknologi kelas 10 kumer smapsa .pptxBioteknologi kelas 10 kumer smapsa .pptx
Bioteknologi kelas 10 kumer smapsa .pptx
 
BUMI DAN ANTARIKSA PROJEK IPAS SMK KELAS X.pdf
BUMI DAN ANTARIKSA PROJEK IPAS SMK KELAS X.pdfBUMI DAN ANTARIKSA PROJEK IPAS SMK KELAS X.pdf
BUMI DAN ANTARIKSA PROJEK IPAS SMK KELAS X.pdf
 
Volatile Oils Pharmacognosy And Phytochemistry -I
Volatile Oils Pharmacognosy And Phytochemistry -IVolatile Oils Pharmacognosy And Phytochemistry -I
Volatile Oils Pharmacognosy And Phytochemistry -I
 
User Guide: Magellan MX™ Weather Station
User Guide: Magellan MX™ Weather StationUser Guide: Magellan MX™ Weather Station
User Guide: Magellan MX™ Weather Station
 
Good agricultural practices 3rd year bpharm. herbal drug technology .pptx
Good agricultural practices 3rd year bpharm. herbal drug technology .pptxGood agricultural practices 3rd year bpharm. herbal drug technology .pptx
Good agricultural practices 3rd year bpharm. herbal drug technology .pptx
 
Citronella presentation SlideShare mani upadhyay
Citronella presentation SlideShare mani upadhyayCitronella presentation SlideShare mani upadhyay
Citronella presentation SlideShare mani upadhyay
 
Pests of soyabean_Binomics_IdentificationDr.UPR.pdf
Pests of soyabean_Binomics_IdentificationDr.UPR.pdfPests of soyabean_Binomics_IdentificationDr.UPR.pdf
Pests of soyabean_Binomics_IdentificationDr.UPR.pdf
 
User Guide: Capricorn FLX™ Weather Station
User Guide: Capricorn FLX™ Weather StationUser Guide: Capricorn FLX™ Weather Station
User Guide: Capricorn FLX™ Weather Station
 
Harmful and Useful Microorganisms Presentation
Harmful and Useful Microorganisms PresentationHarmful and Useful Microorganisms Presentation
Harmful and Useful Microorganisms Presentation
 
REVISTA DE BIOLOGIA E CIÊNCIAS DA TERRA ISSN 1519-5228 - Artigo_Bioterra_V24_...
REVISTA DE BIOLOGIA E CIÊNCIAS DA TERRA ISSN 1519-5228 - Artigo_Bioterra_V24_...REVISTA DE BIOLOGIA E CIÊNCIAS DA TERRA ISSN 1519-5228 - Artigo_Bioterra_V24_...
REVISTA DE BIOLOGIA E CIÊNCIAS DA TERRA ISSN 1519-5228 - Artigo_Bioterra_V24_...
 
Environmental Biotechnology Topic:- Microbial Biosensor
Environmental Biotechnology Topic:- Microbial BiosensorEnvironmental Biotechnology Topic:- Microbial Biosensor
Environmental Biotechnology Topic:- Microbial Biosensor
 
Call Girls in Munirka Delhi 💯Call Us 🔝8264348440🔝
Call Girls in Munirka Delhi 💯Call Us 🔝8264348440🔝Call Girls in Munirka Delhi 💯Call Us 🔝8264348440🔝
Call Girls in Munirka Delhi 💯Call Us 🔝8264348440🔝
 
Functional group interconversions(oxidation reduction)
Functional group interconversions(oxidation reduction)Functional group interconversions(oxidation reduction)
Functional group interconversions(oxidation reduction)
 
Topic 9- General Principles of International Law.pptx
Topic 9- General Principles of International Law.pptxTopic 9- General Principles of International Law.pptx
Topic 9- General Principles of International Law.pptx
 
OECD bibliometric indicators: Selected highlights, April 2024
OECD bibliometric indicators: Selected highlights, April 2024OECD bibliometric indicators: Selected highlights, April 2024
OECD bibliometric indicators: Selected highlights, April 2024
 
Dubai Calls Girl Lisa O525547819 Lexi Call Girls In Dubai
Dubai Calls Girl Lisa O525547819 Lexi Call Girls In DubaiDubai Calls Girl Lisa O525547819 Lexi Call Girls In Dubai
Dubai Calls Girl Lisa O525547819 Lexi Call Girls In Dubai
 
Best Call Girls In Sector 29 Gurgaon❤️8860477959 EscorTs Service In 24/7 Delh...
Best Call Girls In Sector 29 Gurgaon❤️8860477959 EscorTs Service In 24/7 Delh...Best Call Girls In Sector 29 Gurgaon❤️8860477959 EscorTs Service In 24/7 Delh...
Best Call Girls In Sector 29 Gurgaon❤️8860477959 EscorTs Service In 24/7 Delh...
 
Four Spheres of the Earth Presentation.ppt
Four Spheres of the Earth Presentation.pptFour Spheres of the Earth Presentation.ppt
Four Spheres of the Earth Presentation.ppt
 
Davis plaque method.pptx recombinant DNA technology
Davis plaque method.pptx recombinant DNA technologyDavis plaque method.pptx recombinant DNA technology
Davis plaque method.pptx recombinant DNA technology
 
Pests of jatropha_Bionomics_identification_Dr.UPR.pdf
Pests of jatropha_Bionomics_identification_Dr.UPR.pdfPests of jatropha_Bionomics_identification_Dr.UPR.pdf
Pests of jatropha_Bionomics_identification_Dr.UPR.pdf
 

Graphic Notes on Linear Algebra and Data Science

  • 2. これは何? • Gilbert Strang 著 『Linear Algebra for Everyone』 は線形代数を直感理解するのに とてもいい本です。 • 定理と証明の連鎖ではなく、マトリックス語法と例⽰で直感的な理解と実⽤的な 応⽤法を得ることができます。 • YouTube の MIT Open Courseware、 先⽣の講義プレイリストである 18.06 と 18.065 には、200万⼈の購読者がいます。(ぼくもその⼀⼈です) • この本のハイライトは、 • AB=C の4つの⾒⽅ • 基本的な4つの部分空間 • 5つのマトリックス分解 • 通常の線形代数の教科書はジョルダン標準形がクライマックスですが、この 本では、SVD です。そして、 • 機械学習を含むデータサイエンスへの⼊⾨につながっています。 • この1と2のコンセプトをグラフィック表現できないか、というアイディアです。 By Kenji Hiranabe with the kindest help of Prof. Gilbert Strang 2 1 2
  • 3. この発表 のモチベ ーション • ⾏列とベクトルの掛け算には、複数の⾒⽅ があります。 • このノートは、それらを可視化し、教育⽤ コンテンツとする試みです。 • それによって ... • ⾏列とベクトルの演算を直感的に⾏えるよう になります。 • その直感を、5つの⾏列分解法、などのコンセ プトの理解につなげることができます。 By Kenji Hiranabe with the kindest help of Prof. Gilbert Strang 3 最新版︓ https://github.com/kenjihiranabe/The-Art-of-Linear-Algebra/ http://math.mit.edu/everyone
  • 4. 5つの⾏列分解 𝐴 = 𝐶𝑅 𝐴 = 𝐿𝑈 𝐴 = 𝑄𝑅 𝑆 = 𝑄Λ𝑄! 𝐴 = 𝑈Σ𝑉! By Kenji Hiranabe with the kindest help of Prof. Gilbert Strang 4 独⽴列⾏列と⾏簡約⾏列の積 (⾏ランク=列ランクを⽰す) LU分解=ガウスの消去法 QR分解=Gram-Schmidtの直⾏化 対称⾏列の固有値分解 どんな⻑⽅⾏列にも使える 特異値分解
  • 5. By Kenji Hiranabe with the kindest help of Prof. Gilbert Strang 5 Foreword I am happy to see Kenji Hiranabeʻs pictures of matrix operations in linear algebra ! The pictures are an excellent way to show the algebra. We can think of matrix multiplications by (row, column) dot products, but that is not all -- it is ``linear combinations” and ``rank 1 matrices" that complete the algebra and the art. I am very grateful to see the books in Japanese translation and the ideas in Kenji's pictures. -- Gilbert Strang Professor of Mathematics at MIT
  • 6. By Kenji Hiranabe with the kindest help of Prof. Gilbert Strang 6 • もうすぐ⽇本語訳発売! • ⽇本語訳決定!
  • 7. By Kenji Hiranabe with the kindest help of Prof. Gilbert Strang 7 先⽣の講演例:https://www.youtube.com/watch?v=MsIvs_6vC38
  • 8. ⽬次 • ⾏列の⾒⽅ – 4つ • ベクトルの積 – 2つ • ⾏列のベクトルの積 – 2つ • ⾏列と⾏列の積 – 4つ • 便利な応⽤パターン– 4つ • ⾏列の有名分解 – 5つ • 𝐶𝑅, 𝐿𝑈, 𝑄𝑅, 𝑄Λ𝑄!, 𝑈Σ𝑉! • データサイエンス応⽤で理解する SVD(今⽇だけ) By Kenji Hiranabe with the kindest help of Prof. Gilbert Strang 8
  • 9. = = = 3つの数からなる 2つの列ベクトル 2つの数からなる 3つの⾏ベクトル 6つの数 1 つの⾏列 ⾏列の⾒⽅ – 4つ 𝐴 = 𝑎!!𝑎!" 𝑎"!𝑎"" 𝑎#!𝑎#" = | 𝒂𝟏 | | 𝒂𝟐 | = −𝒂! ∗ − −𝒂" ∗ − −𝒂# ∗ − 以降、太字で列ベクトル𝒂𝟏、*を付けて⾏ベクトル𝒂" ∗ 、を表現する。 また、右肩にTをつけて転置ベクトル𝒂𝐓や転置⾏列𝑨𝐓を表現する。 𝐴 = 1 4 2 5 3 6 = 1 4 2 5 3 6 = 1 4 2 5 3 6 By Kenji Hiranabe with the kindest help of Prof. Gilbert Strang 9
  • 10. = = = 内積(スカラー) Rank1の⾏列 v1 = 1 2 3 𝑥 𝑦 = 𝑥 𝑦 2𝑥 2𝑦 3𝑥 3𝑦 ベクトルの積 – 2つ 1 2 3 𝑥! 𝑥" 𝑥# = 1 2 3 , 𝑥! 𝑥" 𝑥# = 𝑥! + 2𝑥" + 3𝑥# 2つの列ベクトル𝒂, 𝒃を𝒂𝒃! の順に掛けると、⾏ 列 (𝐴 = 𝒂𝒃! ) になる。 𝒂, 𝒃どちらも0でなければ、 この⾏列はRankが1になることが分かる。(各 ⾏は定数倍であり、各列も定数倍である) 2つの列ベクトルの内積(𝒂 ) 𝒃)は⾏列形 式では、𝒂! 𝒃 と表現され、1つのスカ ラーになる。 v2 By Kenji Hiranabe with the kindest help of Prof. Gilbert Strang 10
  • 11. = = + ⾏列とベクトルの積 – 2つ 𝐴 の⾏ベクトルと列ベクトルの積 (内積)からなる1つの列ベクトル 𝐴 の列ベクトルの線形結合 𝐴𝒙 = 1 2 3 4 5 6 𝑥! 𝑥" = (𝑥!+2𝑥") (3𝑥! + 4𝑥") (5𝑥! + 6𝑥") 𝐴𝒙 = 1 2 3 4 5 6 𝑥! 𝑥" = 𝑥! 1 3 5 + 𝑥" 2 4 6 最初に左を覚えるだろう。しかし、右の⾒⽅ができるようになると、 𝐴𝒙 が𝐴の列ベクトルの線形結合、すなわち、 𝐴の列ベクトル空間 𝐂(𝐴)、 さらに、 𝐴𝒙 = 0 の解がAの零空間 𝐍(𝐴)と読めるようになる。 Mv 1 Mv 2 By Kenji Hiranabe with the kindest help of Prof. Gilbert Strang 11
  • 12. By Kenji Hiranabe with the kindest help of Prof. Gilbert Strang 12
  • 13. ⾏列と⾏列の積 – 4つ = 1 2 3 4 5 6 𝑥" 𝑦" 𝑥# 𝑦# = (𝑥"+2𝑥#) (𝑦"+2𝑦#) (3𝑥"+4𝑥#) (3𝑦"+4𝑦#) (5𝑥"+6𝑥#) (5𝑦"+6𝑦#) 1 2 3 4 5 6 𝑥" 𝑦" 𝑥# 𝑦# = 𝐴 𝒙 𝒚 = 𝐴𝒙 𝐴𝒚 = = 結果の各列 𝐴𝒙, 𝐴𝒚 は、それぞれ𝐴 の列ベクトルの線形結合 結果の各要素は、⾏ベクトルと列ベクトルの内積 MM 1 MM 2 By Kenji Hiranabe with the kindest help of Prof. Gilbert Strang 13
  • 14. ⾏列と⾏列の積 – 4つ = + = = 1 2 3 4 5 6 𝑏"" 𝑏"# 𝑏#" 𝑏## = 𝒂𝟏 𝒂𝟐 𝒃𝟏 ∗ 𝒃𝟐 ∗ = 𝒂𝟏𝒃𝟏 ∗ + 𝒂𝟐𝒃𝟐 ∗ = 1 3 5 𝑏"" 𝑏"# + 2 4 6 𝑏#" 𝑏## = 𝑏"" 𝑏"# 3𝑏"" 3𝑏"# 5𝑏"" 5𝑏"# + 2𝑏#" 2𝑏## 4𝑏#" 4𝑏## 6𝑏#" 6𝑏## 1 2 3 4 5 6 𝑥" 𝑦" 𝑥# 𝑦# = 𝒂𝟏 ∗ 𝒂𝟐 ∗ 𝒂𝟑 ∗ 𝑋 = 𝒂𝟏 ∗ 𝑋 𝒂𝟐 ∗ 𝑋 𝒂𝟑 ∗ 𝑋 ⾏列の積は、rank 1の⾏列の和に分解される。 結果の各⾏は、⾏ベクトルの線形結合 MM 3 MM 4 By Kenji Hiranabe with the kindest help of Prof. Gilbert Strang 14
  • 15. 便利な応⽤パターン – 3つ 2 3 = 1 2 3 1 1 = 2 1 + 3 + 2 = 2 1 + 3 + 3 = 2 1 + 3 + MM 2 Mv 2 右からの操作は、列に作⽤する。 この表現は、右の3つの線形結合を 1つの⾏列表現で表したものだとも ⾔える。 P1 using By Kenji Hiranabe with the kindest help of Prof. Gilbert Strang 15
  • 16. 1 2 3 = 1 2 3 1 = + 1 2 3 + 2 = + 1 2 3 + 3 = + 1 2 3 + MM 3 左からの操作は、⾏に作⽤する。 この表現は、右の3つの線形結合を 1つの⾏列表現で表したものだとも ⾔える。 P2 using By Kenji Hiranabe with the kindest help of Prof. Gilbert Strang 16 便利な応⽤パターン – 3つ
  • 17. = = 𝐴𝐷 = 𝒂𝟏 𝒂𝟐 𝒂𝟑 𝑑! 𝑑" 𝑑# = 𝑑!𝒂𝟏 𝑑"𝒂𝟐 𝑑"𝒂𝟐 𝐷𝐵 = 𝑑! 𝑑" 𝑑# 𝒃! ∗ 𝒃! ∗ 𝒃! ∗ = 𝑑!𝒃! ∗ 𝑑!𝒃! ∗ 𝑑!𝒃! ∗ 対⾓⾏列を右から掛けると各列がスカラー倍 対⾓⾏列を左から掛けると各⾏がスカラー倍 これらを⽬に焼き付けると、さらに、、、、 P1ʼ P2ʼ By Kenji Hiranabe with the kindest help of Prof. Gilbert Strang 17 便利な応⽤パターン – 3つ
  • 18. スカラー倍された列ベクトルの線形結合(ベクトル漸化式やベクトル線形微分⽅程式で活⽤) = 𝑿𝑫𝒄 = 𝒙𝟏 𝒙𝟐 𝒙𝟑 𝑑! 𝑑" 𝑑# 𝑐! 𝑐" 𝑐# = 𝑐!𝑑!𝒙𝟏 + 𝑐"𝑑"𝒙𝟐+ 𝑐#𝑑#𝒙𝟑 + + P3 By Kenji Hiranabe with the kindest help of Prof. Gilbert Strang 18 便利な応⽤パターン – 3つ
  • 19. By Kenji Hiranabe with the kindest help of Prof. Gilbert Strang 19 微分⽅程式、漸化式の例 P3 𝑋 𝑒*+, Λ, 𝒄 𝒙𝟏 𝒙𝟐 𝒙𝟑
  • 20. = + + 𝑈𝛴𝑉- = 𝒖𝟏 𝒖𝟐 𝒖𝟑 𝜎! 𝜎" 𝜎# 𝒗! - 𝒗" - 𝒗# - = 𝜎!𝒖!𝒗! - + 𝜎"𝒖"𝒗" -+ 𝜎#𝒖#𝒗# - rank 1⾏列の和 (SVDや対称⾏列のスペクトル分解で活⽤) P4 By Kenji Hiranabe with the kindest help of Prof. Gilbert Strang 20 便利な応⽤パターン – 3つ
  • 21. 𝐴 = 𝐶𝑅 𝐴 = 𝐿𝑈 𝐴 = 𝑄𝑅 𝑆 = 𝑄Λ𝑄! 𝐴 = 𝑈Σ𝑉! By Kenji Hiranabe with the kindest help of Prof. Gilbert Strang 21 独⽴列⾏列と⾏簡約⾏列の積 (⾏ランク=列ランクを⽰す) LU分解=ガウスの消去法 QR分解=Gram-Schmidtの直⾏化 対称⾏列の固有値分解 どんな⻑⽅⾏列にも使える 特異値分解 ⾏列の有名分解 – 5つ
  • 22. 𝐴 = 𝐶𝑅 𝐴の列ベクトルを左から順に⾒て、独⽴なもののみ選び出していく。1,2列⽬は⽣き残り、3列⽬は1列⽬+2列 ⽬なので捨てる。残った2つの列ベクトルCを使って𝐴 を復元すると、𝑅には階段⾏列が現れる。 これを、よく⾒て、⼆つの表現で表すと… ⻑⽅⾏列𝐴の⾏ランクと、 𝐴の列ランクが等しいことを最も直感的に⽰す分解。 Cは𝐴の線形独⽴な列ベクトル。 𝑅は⾏簡約階段⾏列(row reduced echelon form)となる。 1 2 3 2 3 5 = 1 2 2 3 1 0 1 0 1 1 | 𝒂𝟏 | | 𝒂𝟐 | | 𝒂𝟑 | = | 𝒄𝟏 | | 𝒄𝟐 | 1 0 1 0 1 1 𝒂𝟏 = 𝒄𝟏, 𝒂𝟐= 𝒄𝟐, 𝒂𝟑 = 𝒄𝟏 + 𝒄𝟐 −𝒂" ∗ − −𝒂# ∗ − = 1 2 2 3 −𝒓" ∗ − −𝒓# ∗ − 𝒂" ∗ = 𝒓" ∗ + 2𝒓# ∗ , 𝒂# ∗ = 2𝒓" ∗ + 3𝒓# ∗ = 2 1 = 1 + 2 1 + 2 1 + 2 すべての列ベクトルはc1,c2の線形結合。すなわち、列ランク=dim C(𝐴)=2。 = + 1 2 1 2 1 2 + = すべての⾏ベクトルはr1,r2の線形結合。すなわち、⾏ランク=dim C(𝐴! )=2。 𝐴 = 𝐶𝑅 P1 P2 using using By Kenji Hiranabe with the kindest help of Prof. Gilbert Strang 22
  • 23. By Kenji Hiranabe with the kindest help of Prof. Gilbert Strang 23 = 2 1 = 1 + 2 1 + 2 1 + 2 1 2 3 2 3 5 = + 1 2 1 2 1 2 + =
  • 24. 𝐴 = | 𝒍𝟏 | −𝒖! ∗ − + 0 0 0 0 0 𝐴" = | 𝒍𝟏 | −𝒖! ∗ − + | 𝒍𝟐 | −𝒖" ∗ − + 0 0 0 0 0 0 0 0 𝐴# = 𝐿𝑈 𝐴 = 𝐿𝑈 𝐴の⾏1ベクトルと列1ベクトルでできる rank 1⾏列を取り出し、サイズが1つ減った⾏列を𝐴# とする。 この操作を再帰的に繰り返して、rank 1 の和に分解する。 = + + 𝐿𝑈 を逆向きに計算して𝐴 に戻すのは容易。 MM 4 ガウスの消去法は、⾏基本変形をAの左から掛けていくが、その逆⾏列が 𝐿である。 using By Kenji Hiranabe with the kindest help of Prof. Gilbert Strang 24 = = + + 𝐿 𝑈 𝐴
  • 25. By Kenji Hiranabe with the kindest help of Prof. Gilbert Strang 25 = = + + 𝐿 𝑈 𝐴 1 2 4 2 1 5 5 1 3
  • 26. = = 𝐴 = 𝑄𝑅 𝐴の各列ベクトルを、Gram-Schmidtの直⾏化によって𝑄 の列ベクトルに直⾏化する。 その際の係数を逆にすることで、𝑅に上三⾓⾏列が作られる。 Gram-Schmidt の直⾏化。 2 3 1 | 𝒂𝟏 | | 𝒂𝟐 | | 𝒂𝟑 | = | 𝒒𝟏 | | 𝒒𝟐 | | 𝒒𝟑 | 𝑟"" 𝑟"# 𝑟"( 𝑟## 𝑟#( 𝑟(( 3 1 + 1 2 + 1 2 + 𝒂𝟏 = 𝑟""𝒒𝟏 𝒂𝟐 = 𝑟"#𝒒𝟏 + 𝑟##𝒒𝟐 𝒂𝟐 = 𝑟"(𝒒𝟏 + 𝑟#(𝒒𝟐 + 𝑟((𝒒𝟑 𝐴 = 𝑄𝑅 P1 using By Kenji Hiranabe with the kindest help of Prof. Gilbert Strang 26 𝑄 𝑅 𝐴 𝒂𝟏 𝒂𝟐 𝒂𝟑
  • 27. 𝑆 = 𝑄𝛬𝑄-= | 𝒒𝟏 | | 𝒒𝟐 | | 𝒒𝟑 | 𝜆! 𝜆" 𝜆# −𝒒! - − −𝒒" - − −𝒒# - − =𝜆! | 𝒒𝟏 | −𝒒! - − + 𝜆" | 𝒒𝟐 | −𝒒" - − + 𝜆# | 𝒒𝟑 | −𝒒# - − 𝑆 = 𝑄𝛬𝑄* 対称⾏列𝑆は、直⾏⾏列𝑄によって固有値の対⾓⾏列𝛬に対⾓化される。 さらに、これを rank 1 の射影⾏列の和に分解できる。(スペクトル分解) = 𝜆!𝑃! + 𝜆"𝑃" + 𝜆#𝑃# 対称⾏列𝑆の固有値分解。固有値はすべて実数であり、固有ベクトルは必ず互いに直⾏したものが取れる。 2 3 1 = + + = 1 2 3 1 1 2 2 3 3 P4 using By Kenji Hiranabe with the kindest help of Prof. Gilbert Strang 27 𝑄 𝛬 𝑆 𝑄. 𝜆!𝒒𝟏𝒒! . 𝜆"𝒒𝟐𝒒" . 𝜆#𝒒𝟑𝒒# . 𝑆 = 𝑆- 𝑄-𝑄 = 𝑃! +𝑃" + 𝑃# = 𝐼 𝑃!𝑃" = 𝑃"𝑃# = 𝑃#𝑃! = 𝑂
  • 28. 𝐴 = 𝑈Σ𝑉+ 𝐴の⾏空間ℝ) の正規直交基底として𝑉、列空間 ℝ* の正規直交規定として𝑈をそれぞれうまく取ると、対 ⾓化される。これを特異値分解という。さらに、これを rank 1 ⾏列の和に分解できる。 𝐴が⼀般の⻑⽅⾏列の場合でも、特異値分解は必ず可能。 = + = 1 1 2 2 2 3 1 1 2 P4 using By Kenji Hiranabe with the kindest help of Prof. Gilbert Strang 28 𝑈 Σ 𝐴 𝑉- 𝜎! 𝒖𝟏𝒗! - 𝜎" 𝒖𝟐𝒗" - 𝑈𝑈- = 𝐼/ 𝑉𝑉- = 𝐼, 𝐴 = 𝑈Σ𝑉-= | 𝒖𝟏 | | 𝒖𝟐 | | 𝒖𝟑 | 𝜎! 𝜎" −𝒗! - − −𝒗" - − =𝜎! | 𝒖𝟏 | − 𝒗! - − + 𝜎" | 𝒖𝟐 | − 𝒗" - − = 𝜎!𝒖𝟏𝒗! - + 𝜎"𝒖𝟐𝒗" -
  • 29. SVDの応⽤からの理解︓ eigenface Washington ⼤学の Steve Brunton 先⽣の YouTube チャネル にて、120回以上の動画で詳しくこの本の中について解説されて いる。その中の、eigenface の回をご紹介。 Databookuw.com By Kenji Hiranabe with the kindest help of Prof. Gilbert Strang
  • 30. Eigenfaces – Yale B Dataset By Kenji Hiranabe with the kindest help of Prof. Gilbert Strang 30 256値×32K 画素×64枚× 36⼈、から、特異値ベクトルを抽出
  • 31. ⾏列の2つの意味(1.写像) 𝐴 ∈ 𝑀 𝑚×𝑛, ℝ m⾏n列の実数要素の⾏列 1. ℝ!→ ℝ" の線形写像と⾒る By Kenji Hiranabe with the kindest help of Prof. Gilbert Strang 31 ℝ" ℝ# → 𝑥 𝐴 𝐴𝑥 𝑥∈ℝ" n次元列ベクトル 𝐴𝑥∈ℝ# m次元列ベクトル 𝐶 A = 𝐴𝑥 𝑥∈ℝ" } Aの列空間⊂ ℝ# 𝑁 A = 𝑥 𝑥∈ℝ", 𝐴𝑥 = 0} Aの零空間⊂ ℝ" = + 𝐴 の列ベクトルの線形結合 𝑨𝒙 = 1 0 2 1 3 1 𝑥! 𝑥" = 𝑥! 1 2 3 + 𝑥" 0 1 1 Mv 2 rank 𝐴 = dim 𝐶(𝐴) m x n の時、 ℝ% → ℝ& nが⼊⼒m が出⼒であることに注意。
  • 32. ⾏列の2つの意味(2.データ) 2. ℝ" のデータセットが𝑛列と⾒る。 By Kenji Hiranabe with the kindest help of Prof. Gilbert Strang 32 𝑎$, 𝑎%, … , 𝑎" ∈ ℝ# m次元列ベクトルのデータ 𝑢$, 𝑢%, … , 𝑢# ∈ ℝ# m次元列ベクトルの底 | 𝒂𝟏 | | 𝒂𝟐 | | 𝒂𝟑 | = | 𝒆𝟏 | | 𝒆𝟐 | | 𝒆𝟑 | 1 0 1 2 3 1 1 3 4 2 3 = 1 2 3 1 1 = 2 1 + 3 + 2 = 2 1 + 3 + 3 = 2 1 + 3 + P1 𝒂𝟏 = 𝒖𝟏, 𝒂𝟐 = 𝒖𝟐, 𝒂𝟐 = 𝒖𝟏 + 𝒖𝟐 | 𝒂𝟏 | | 𝒂𝟐 | | 𝒂𝟑 | = | 𝒖𝟏 | | 𝒖𝟐 | | 𝒖𝟑 | 1 0 1 0 0 1 0 1 0 新しい基底(u1,u2,u3)の線形結合として各列を表す 通常の基底(e1,e2,e3)の線形結合として各列を表す 基底 この基底での「座標」 もしくは「成分」が 縦に並ぶ。 各データベクトル 𝑨 = 1 0 1 2 3 1 1 3 4 フーリエ変換等でもデータ圧縮可能 だが、SVDではデータ駆動で(デー タ全体を⾒てから)有効な底を決め る。
  • 33. 固有値/固有ベクトル(復習) 𝐴 ∈ 𝑀 𝑛×𝑛, ℝ n⾏n列の実数要素の正⽅⾏列 1. ℝ!→ ℝ! の線形写像と⾒る By Kenji Hiranabe with the kindest help of Prof. Gilbert Strang 33 ℝ" ℝ" → 𝑥 𝐴 𝐴𝑥 ⽅向を変えないベクトルがある。 それらを基底とする(座標は⼲渉しないで定数倍になる)。 𝐴𝒑$ = 𝜆$𝒑$ 𝐴𝒑% = 𝜆%𝒑% 𝐴𝒑& = 𝜆&𝒑& 𝐴𝑥 = 𝜆𝑥 𝐴𝑃 = 𝑃𝛬, 𝐴 = 𝑃𝛬𝑃2! 𝑨 | 𝒑𝟏 | | 𝒑𝟐 | | 𝒑𝟑 | = | 𝒑𝟏 | | 𝒑𝟐 | | 𝒑𝟑 | 𝜆! 𝜆" 𝜆# 1 = 1 1 2 = 2 2 3 = 3 3 1 2 3 2 3 1 2 3 1 = ※必ずn本取れるとは限らない。 対称⾏列なら正規直交なPが必ず取れ、λは実数。
  • 34. 特異値/特異ベクトル 𝐴 ∈ 𝑀 𝑚×𝑛, ℝ m⾏n列の実数要素の⻑⽅⾏列 1. ℝ!→ ℝ" の線形写像と⾒る By Kenji Hiranabe with the kindest help of Prof. Gilbert Strang 34 ℝ" ℝ# → 𝑥 𝐴 𝐴𝑥 別の正規直⾏ベクトルを基底とする。 座標は⼲渉しないで定数倍(⾮負の実数)になる。 𝐴𝒗$ = 𝜎$𝒖$ 𝐴𝒗% = 𝜎%𝒖% 𝐴𝒗& = 𝜎&𝒖& 𝐴𝑉 = 𝑈Σ 𝐴 = 𝑈Σ𝑉! 1 = 1 1 2 = 2 2 3 = 3 3 1 2 3 2 3 1 2 3 1 = ※必ず分解でき、⼀意になる。 1 2 3 2 3 1 = 1 2 3
  • 35. 特異値/特異ベクトル 1. 𝑛個の ℝ" のデータセットと⾒る。 By Kenji Hiranabe with the kindest help of Prof. Gilbert Strang 35 2 3 1 2 3 1 1 = 2 1 + 3 + 2 = 2 1 + 3 + 3 = 2 1 + 3 + 新基底 各データベクトル (各⾃の顔データ) 2 3 1 = = 新基底 (eigen face) 𝐴 = 𝑈Σ𝑉" 𝐴 = | 𝒖𝟏 | | 𝒖𝟐 | | 𝒖𝟑 | 𝜎& 𝜎' 𝜎( −𝒗& " − −𝒗' " − −𝒗( " − 𝐴 𝑉' 𝑈 Σ (Σ𝑉') 𝑈 = = A の各列(face)は、新基底(eigenface)の線形結合。 A 全体の中での信号の強さが特異値。 データごとの Mixture(Vの⾏) 信号の強さ (特異値) 新基底での座標 (各⾃の顔の成分) 新基底での座標 (各⾃の顔の成分)
  • 36. By Kenji Hiranabe with the kindest help of Prof. Gilbert Strang 36 ⼿で分解するには、 𝐴'𝐴(どんな𝐴でも対称⾏列となる)を使う。 𝐴 = 𝑈Σ𝑉" 𝐴"𝐴 = (𝑈Σ𝑉")"𝑈Σ𝑉" = 𝑉Σ'𝑉" となり、 𝐴"𝐴(対称⾏列)の対⾓化(固有値)を求めるのと同じ問題に帰着。 1. 𝐴"𝐴 を計算。 2. それを対⾓化、すなわち固有値𝜎'と固有ベクトル 𝒗 をn個求める。 3. それらが、 Σ', 𝑉 となる。 4. Σと𝑉が求まったら、 𝐴𝒗 = 𝜎𝒖 より、𝒗 に対応する 𝒖求めて、 𝑼とする。 これは⼿計算⽤で、通常、コンピュータの数値演算は全く違う ⽅法(シフト付きQRなど) をとる。 特異値/特異ベクトル
  • 37. By Kenji Hiranabe with the kindest help of Prof. Gilbert Strang 37 直感で SVD 出来ますか︖ 1. 𝐴 = 3 2. 𝐴 = 1 2 3. 𝐴 = 1 3 2 6 直感 or 計算で SVD 出来ますか︖ ポイント 𝐴 = 𝑈Σ𝑉! 単位直⾏⾏列 (⻑さ・⾓度を変えない) (回転と捉えて良い) 対⾓⾏列 (向きを変えない) (スケールと捉えて良い) 𝑈 𝑉 𝑈の次元は? 𝑉の次元は? ℝ" ℝ# 𝐴 ⾏空間 列空間 → = 1 3 1 = 1 5 1 2 5 1 = 1 5 1 −2 2 1 5 0 1 特異値/特異ベクトル
  • 38. Eigenfaces – Yale B Dataset By Kenji Hiranabe with the kindest help of Prof. Gilbert Strang 38 256値×32K 画素×64枚× 36⼈、から、特異値ベクトルを抽出
  • 39. 最初の 64 eigenfaces(ちょっと怖い…) By Kenji Hiranabe with the kindest help of Prof. Gilbert Strang 39
  • 40. By Kenji Hiranabe with the kindest help of Prof. Gilbert Strang 40 顔データを元よりも少数 次元の基底によって復元 する。 基底は、U を特異値の⼩ さい⽅を削除ししまった 近似。 このU平⾯に新しい顔を 射影し、その座標(少数) をαという。このαを使っ て、新しい顔を表現する。 (データ圧縮) 顔を次元を順次増 やして復元。 効率は良くないが、 ⽝も表現できるよ。 (だいぶ怖い)
  • 41. 参照⽂献と 謝辞 • Linear Algebra for Everyone (⽇本語 来年) http://math.mit.edu/everyone/ • MIT OpenCourseWare 18.06 http://web.mit.edu/18.06/www/vi deos.shtml • A 2020 Vision of Linear Algebra https://ocw.mit.edu/resources/res -18-010-a-2020-vision-of-linear- algebra-spring-2020/ • マトリックスワールド https://anagileway.com/2020/09/ 29/matrix-world-in-linear-algebra- for-everyone/ • 4つの部分空間 Tシャツ https://anagileway.com/2020/06/ 04/prof-gilbert-strang-linear- algebra/ This work is inspired by Prof. Strangʼs books and lecture videos. I deeply appreciate his work, passion and personality. By Kenji Hiranabe with the kindest help of Prof. Gilbert Strang 41
  • 42. By Kenji Hiranabe with the kindest help of Prof. Gilbert Strang 42 Tシャツ作った!
  • 43. Thank you for reading! Any comments or feedbacks are welcome to: Kenji Hiranabe (hiranabe@gmail.com) = 43