[ML] Tensor: Scalar, Vector, Matrix.
·
Programming/ML
Tensor 종류1. Scalar (0차원 tensor)하나의 숫자로 표현되는 가장 기본적인 형태.크기(magnitude)만을 가지며 방향은 없음.예시: 온도(25°C), 나이(20), 가격(1000원)# 파이썬/NumPy에서의 표현scalar = 5.02. Vector (1차원 tensor)숫자들의 순서가 있는 array(배열): Numbers' ordered list.Magnitude(크기)와 Direction(방향)을 모두 가짐.선형대수에서는 공간 상의 한 점 또는 방향을 나타내는 화살표로 해석: Vector Space의 element!기계학습 및 딥러닝에서는 데이터 instance(=single sample)의 특성(feature)들을 담는 container로 사용되어 하나의 instance를 표..
[CV] Intersection and Ideal Point; Homogeneous Coordinate and Cross Product
·
.../Math
Intersection and Ideal Point이 글에서는 homogeneous coordinates(동차 좌표)와 cross product(교차곱)을 이용하여 두 직선의 교점을 찾는 방법을 다룸.또한, 평행한 직선의 경우에 ideal point(이상점)이 나오는 경우도 다룸.두 직선의 교점을 구하는 방법단계별 설명1. Homogeneous Coordinates(동차 좌표):주어진 두 직선을 동차 좌표 $\mathbf{l}_1 = \begin{bmatrix}a_1 & b_1 & c_1\end{bmatrix}^\top$와 $\mathbf{l}_2 = \begin{bmatrix} a_2& b_2 & c_2\end{bmatrix}^\top$로 표현함.2. Cross Product Calculation(교차..
[Math] Hessian: Summary
·
Programming/DIP
이 문서는 Numerator Layout Convention 을 사용함.Hessian : Summary 2nd order derivative of multivariable function.여기서 multivariable function은 입력은 vector, 출력은 scalar 인 함수를 의미함: ML에서의 loss function을 생각해 볼 것.Hessian matrix $H[f](\textbf{x})$는 다음과 같음.$$\begin{aligned}H[f](\textbf{x})=H(\textbf{x})&=\left(J\left[\nabla f(\textbf{x})\right]\right)^\top \\ &= \begin{bmatrix}\dfrac{\partial^2 f}{\partial x_1^2} ..
[Math] Plane Equation : 평면의 방정식
·
.../Math
Plane EquationPlane Equation은 다음과 같음.$$\textbf{n}^\top\textbf{r}_\text{plane}+b_\text{bias}=0$$where$\textbf{n}$ : normal vector to a plane.$\textbf{r}_{\text{plane}}$ : plane에 속하는 점들의 position vector$b_{\text{bias}}$ : bias. (scalar)임.왼쪽 그림에서Point $\textbf{P}$와 $\textbf{P}_0$는 평면 위의 서로 다른 점이며 Position Vector $\textbf{r}$과 $\textbf{r}_0$로 표현됨.$\textbf{n}$은 평면에 대한 Normal Vector (법선벡터)임.( 평면의 속하는 ..
[Math] Distance between Point and Plane : 점과 직선의 거리
·
.../Math
점과 직선의 거리Position Vector $\textbf{x}$ (아래 그림에서 Point $Q$에 대한 Position Vector)와$\textbf{n}\cdot \textbf{p}+b=0$을 만족하는 Position Vector $\textbf{p}$들로 구성되는 평면(Plane $P$)과의Distance(거리 , $d$)는 다음과 같음.$$d=\dfrac{|\textbf{n}\cdot\textbf{x}+b|}{\|\textbf{n}\|}$$ where$\|\textbf{n}\|$ : $\textbf{n}$의 L-2 norm (or magnitude, length)임. (엄밀하게 쓰면, $\|\textbf{n}\|_2$)증명Point $Q$와 Plane $P$와의 거리는 Plane Equatio..
[Math] Definition of Vector Space and Sub-Space
·
.../Math
Vector 의 엄밀한(?) 정의는 Vector Space의 Element임.즉, Vector를 제대로 이해하려면 Vector Space에 대한 정의를 확실히 이해해야 한다.Vector Space의 정의.Vector Space는 아래를 만족하는 Non-Empty Set을 가르킴.Vector들을 Element로 가지는 Non-Empty Set(집합)임.Vector Space의 Element를 Vector라고 부름.다음과 같은 2개의 연산이 정의됨AdditionScalar Multiplication위 두 연산은 다음의 10가지 axioms(공리)를 만족해야함.Vector space $V$에 속하는 모든 $\textbf{u}$, $\textbf{v}$, $\textbf{w}$와, 모든 scalar $c$와 $..