A single-layer neural network with a thresholding activation function
Perceptron Criterion
따라서 좋은 parameter에 대한 기준이 필요함
그래서 각 샘플 i에 대해서
그래서 objective function to be minimized를 다음과 같이 정의하게 된다.
이때, M(w)={(xi,yi)∣yiwTxi<0} : 즉 misclassified samples under w
Batch gradient descent의 식은 다음과 같다.
Stocastic gradient descent의 식은 다음과 같다.
Limitation
Lineary separable한 경우에는 convergence를 반드시 보장할 수 있다. 하지만, non-separable case의 경우에는 single perceptron으로는 해결할 수 없다.
따라서 Multi-layer perceptron (MLP)로 나아가게 된다. 왜냐하면 MLP는 non-linear decision boundary를 가질 수 있기 때문이다.
이게 가능하다는 것은 Universal Approximation Theorem에 의해서 보장할 수 있다.
Any continuous function f:[0,1]d→[0,1] can be approximated arbitrarily well by a neural network with at least 1 hidden layer with a finite number of weights
Deep Learning
Deep learning can be thought as a composition of differentiable functions.
→ The representation power of MLP is from composing functions
이때 문제가 될 수 있는 지점은 미분 불가능한 함수 에 대한 고려이다. 사실 이전의 perceptron이 사용한 sign 함수도 관련해서 문제가 발생할 수 있다. 하지만 실질적으로 이전의 perceptron에서는 크게 문제가 발생하지 않았다.
왜냐하면 추론의 단계에서는 sign(wTx) 를 사용했지만, loss function을 정의할 때는 sign 함수를 쓰지 않았기 때문이다. 하지만 이러한 방식은 multi-layer perceptron에서는 더 이상 사용하기 힘들어졌다.
그래서 non-linear하면서 대부분의 정의역에서 기울기가 0이 아닌 함수를 찾기 시작하였고 대표적인 예시가 다음 6가지이다.
FC layer
xi : input feature (scalar)
Optimization
이때, hi : output of i’th hidden layers
따라서 모든 레이어에 대해서
∂Wl∂L,∂bl∂L
→ closed form solution을 구하는 것은 non-feasible
그래서 back propagation을 구하는 것!
Back-propagation
Squared Error for Regression
Cross Entropy Error for Classification
Binary class
Multiple class
사실상 binary classification의 경우 true label은 0, 1 아니면 1, 0
→ True label은 해당 class만 1임 (살짝 더 정리해볼 것)
→ 사실상 정답 레이블만 one-hot encoding되어있을 것
→ predicted label은 binary의 경우 logistic, multi의 경우 softmax를 통해 확률로 변환
→ KL divergence를 통해 empirical distribution과의 차이를 줄인다고 생각해주면 됨
Derivation
Softmax layer for classification
→ 기존에 다 진행하다가 classification의 경우 맨 마지막에 softmax layer를 넣어주면 됨.
KL Divergence
여기서 p(x)logp(x)는 상수이고, 실질적으로는 KL을 낮추는 것은 cross entropy를 낮추는 것과 같다.
Cross entropy
p:true distribution, q : estimated distribution
Relation between KL and Cross entorpy
Since p is a true distribution, so it is constant and non-negative.
Minimizing the KL(p∣∣q) is equivalent to minimizing cross-entropy loss.