아예 백지 상태인건 아닌데, 어디서 들어본 개념들이 머릿속에서 난잡하게 흐트러져 있음.
선대 공부할때 가장 주의해야 할 부분 : 정의랑 특징을 막 나열해서 외웠는데, 막상 어떻게 쓰이고 다른 개념이랑 어떻게 연결되는지 정리를 안하고 넘어가서 파편적인 지식으로 남았다는 것. (사실 근데 이건 책 부터가 definition & proof 위주로 쓰여있어서, 무지성으로 외우는 식으로 변하기 쉬워서 그런 듯)

linear algebra 내용 자체로 의미 있다기보기다는, 특수한 matrix의 성질을 활용해서 다른 중요한 내용을 증명한다던지 새로운 방법을 유도하는 경우가 많다. Tool로 사용된다고 보면 됨.

 

즉, 처음 배울때만 각잡고 공부하되, 이후엔 모르는 개념 나올때마다 복습하면서 관련 개념이 어떻게 현실에서 쓰이는지 공부하는게 효율적.



Terms : 한글 - 영어

직교행렬 orthogonal matrix
정방행렬 square matrix

 

 

기초 표현들

v : nx1 (column vector)
$||v||$ : vector norm (L2 norm, magnitude of vector - 출저)
(내적) $v \cdot w$ = $||v||||w||\cos(\theta)$
$v^{T} v = ||v||^2$

$v^{T} v$ : 1x1
$vv^{T}$ : nxn

Dot, outer product represented with the column vector

 

개념들


- rank

the dimension of the vector space generated (or spanned) by its columns.
maximal number of linearly independent columns of A (내가 기억하는 정의)
This is identical to the dimension of the vector space spanned by its rows.

 

rank에 대한 새로운 관점 (Ref PDF1 참고)

rank 1 = row/col 벡터 중 딱 하나만 basis 이룸; 나머지 벡터는 이 basis로 표현 가능

= 행렬이 1개의(차원?) 유의미한 정보만 표현

 

rank k  = sum of k rank-1 matrices that are linearly independent

= 한 행렬이 다른 행렬의 linear combination으로 표현되지 않는 independent한 rank-1 행렬 k개의 합

= rank k 행렬의 row/col은 k개의 basis 형성

= 이 행렬로는 k차원의 유의미한 정보 표현 가능

 

 

- orthogonal & orthonormal (basis, dimension, span) 

두 '벡터'에 대해 정의되는 개념 (행렬을 orthonormal하다고 하지 않음)

orthogonal : 수직, dot product 값이 0 (cos90 = 0 이므로)

orthonormal : orthogonal + 벡터 크기가 1

orthonormal basis = 두 벡터가 서로 수직 + (||V|| = 1) + basis 형성 (서로 linearly independent)

 

만약 n개의 basis 벡터가 있다면, basis 벡터들의 linear combination으로 n dimension의 다른 모든 벡터 표현 가능 (= span)

 

- orthogonal matrix

a real-valued square matrix whose columns and rows are orthonormal vectors.⭐️
UU^T = U^T U = I 
=> ★ 다크프로그래머 105번글 참고
+ wolfram alpha

 

square matrix에서만 정의됨;

symmetric matrix랑 자주 엮임

EVD, SVD에서 등장하고 A^k 계산 시 유용하게 쓰임

 

- eigenvector, eigenvalue

defined only in square matrix

 

선대개 공부하면서/다른 과목 들을때도 엄청 많이 나오는데, 왜 중요하냐?)

👉🏻 (geometrical 기하학적 이해부터 하자) 모든 행렬은 특정한 형태의 transformation으로 볼 수 있다 (ex. 회전, 길이 늘리거나 줄이는 scaling, 평행이동 등). eigenvector는 행렬의 transformation이 작동하는 axes라고 볼 수 있다. Transformation이 뭐든 간에, eigenvector에 적용하면 eigenvalue 만큼의 scale이 곱해지는 효과밖에 없다

$ Av = \lambda v $

 

사실 이것만 봐선 왜 중요한지 모르겠음.

그냥 쓰이는데가 엄청 많다는 것을 이해하자. 가장 와닿는건 PCA.

 

 

- eigenvalue decomposition (spectral decomposition, EVD)

 

square matrix를 eigenvector를 열로 가지는 행렬 + eigenvalue diagonal matrix로 쪼개는 방법 (matrix diagonalization)

어따 써먹음?
powers of A 구할 때; 안그래도 A 엄청 큰데, A^100 같은거 직접 구하기 힘듦
→ decompose해서 k하면, 중간 diagonal matrix만 k승 됨. 훨씬 계산 쉬워짐
Contemp linear algebra p.473
그기마 lec3 마지막 low-rank approximation


square matrix, det(A-lambda*E) = 0 (characteristic equation) 일때만 가능
(다크프로그래머 글 참고)

참고
https://jeongchul.tistory.com/603

 

 

- unitary matrix 

https://en.wikipedia.org/wiki/Unitary_matrix
a complex square matrix U is unitary if its conjugate transpose U* is also its inverse,
U*U = UU* = UU^-1 = I

 


- ⭐️ symmetric matrix

→ ⭐️중요! 특이한 성질 많음

def) A = A^T
★ AA^T, A^T A symmetric
https://math.stackexchange.com/questions/686111/what-does-it-mean-for-aat-to-be-symmetric

★ 실원소(real-valued) 대칭행렬은 항상 고유값 대각화(EVD)가 가능하며 더구나 직교행렬(orthogonal matrix)로 대각화가 가능하다
=> 다크프로그래머 105번글

★ Eigenvectors of distinct eigenvalues of a symmetric real matrix are orthogonal
http://www.doc.ic.ac.uk/~ae/papers/lecture05.pdf

 

 

- SVD

mxn matrix X을 분해 = $U \Sigma V^{*}$ = rotation/reflection * scaling * rotation/reflection

→ (geometrical interpretation) 모든 mxn 행렬은 2번의 rotationr/reflection + 1번의 scaling인 transformation으로 해석 가능하다는 사실!

 

U, V는 각각 $XX^T$, $X^{T}X$를 고유값분해(Eigenvalue decomposition)해서 얻어진 orthogonal matrix.

$XX^T$ = $U\Sigma^{2}U^T$= symmetric = EVD into orthogonal mat 가능

 

다음과 같은 관계 형성 :

V는 $X^{T}X$의 eigenvector 열벡터 모아둔 것 = X의 right singular vec

비슷하게 U도 관계 정의 가능.

신기한건 $\Sigma^2 = D$이므로, singular value 제곱이 eigenvalue임을 알 수 있다.

Ref PDF1 참고


eigendecomposition은 square matrix + 여러 다른 조건 필요함. SVD는 mxn의 아무 matrix에나 가능하다는 점에서 의의가 있음 (more generalized version)


SVD, EVD 정리

BiS400C lec2에서 정리한 것
-SVD는 쉽게 말해서 general한 mxn 행렬을 대각화 하는 것. 행렬을 잘게 쪼갠다고 생각. 
-대각화 했을때 나타나는 행렬들 U, sigma, V는 각자 다른 의미 지님. 
U는 A'A를 eigendecomposition 했을때 나타나는 eigenvector matrix, 
V는 동일한 작업을 AA'에 했을때 나타나는 eigenvector matrix, 
sigma는 A'A 혹은 AA'의 공동 eigenvalue들의 square root를 모아둔 diagonal matrix임.

-Symmetric matrix의 경우, SVD랑 eigendecomposition 및 여러 다른 decomposition이 동일하다.
(Eigendecomposition이 eigenvector 행렬이랑 eigenvalue 대각행렬 구하는거임.)
-Symmetric matrix의 eigendecomposition은 orthogonal matrix로 대각화됨. 따라서, 이때 구해지는 eigenvector들은 orthonormal임. 
(참고로 A'A 와 AA' 가 symmetric)
-A'A 와 AA' 는 non-zero eigenvalue를 공유함

SVD : https://darkpgmr.tistory.com/106
Eigendecompo : https://darkpgmr.tistory.com/105
꼭 보기!

 

활용

EVD, SVD 같은 diagonalization 활용 - A^k 계산하는 경우

orthogonal matrix + diagonal matrix로 diagonalize 된다면, A^k 할 시 중간의 diagonal matrix만 k승 되는 형태로 바뀜.

엄청 큰 행렬 A를 k번 곱하기 vs diagonal matrix scalar값의 k승 구하기

당연히 후자가 더 빠르지. 

 

 

- PCA

(Stanford CS168) PCA 작동원리 설명 - Ref PDF1 참고

 

대충 요약하면 $\

 

 

Reference

- 다크프로그래머
선대개 기초 공식 나열 : https://darkpgmr.tistory.com/103
eigenvalue/vector, eigendecomposition, linearly independent, basis, orthogonal / orthonormal / orthogonal matrix : 105번 글
SVD : 106번 글

다크프로그래머 선형대수학.zip
8.23MB

 

- (고등학교 수준) 선형대수기초 정리 : https://blog.daum.net/eigenvalue/10856412

 

- (PDF1) Stanford CS168 Lec #9 - SVD and low-rank matrix approximation

svd_lowrank_approx.pdf
0.87MB

 

 

- (MIT OCW) https://ocw.mit.edu/courses/mathematics/18-065-matrix-methods-in-data-analysis-signal-processing-and-machine-learning-spring-2018/video-lectures/index.htm

 

관련 수업

BiS400C 인공지능 lec2

CS482C 그기마 lec2 → SVD 활용해서 convergence 증명 / lec3 → EVD 활용한 A^k 계산

 

+ Recent posts