본 게시글은 강필성 교수님의 다변량 데이터 분석 강의를 기반으로 작성되었습니다.
작성자 : 16기 최규빈
Brain Structure
인간의 뇌는 뉴런 사이의 전기신호를 통해 메시지를 전달
사람의 뇌를 모사해서 컴퓨터에 표현하자!
An organism with only 1 neuron
$x_0$ = 상수
$x_1, x_2$ = 변수
$w_0, w_1, w_2$ = 가중치(학습 대상)
$h$ = 활성화함수
$y$ = 추정치
$t$ = 실제값(target)
$L$ = loss function
전반부
가중치와 변수를 곱한 후 더해 스칼라 값으로 만들어 줌
후반부
해당 값을 활성화 함수에 통과시켜 변환 후 넘겨줌
Input node
Input variables
Hidden node
Take the weighted sum of input values and perform a non-linear activation
Role of activation
previous layer의 정보들이 다음 단계로 넘길 때 전달할 양을 결정해준다
Logistic / Logit 함수라고도 표현
input x와 target t 사이의 관계를 잘 설명하는 weight w를 찾는 과정
측정 방법
loss function을 통해 확인
Regression
주로 squared loss 사용
Classification
주로 cross-entropy 사용
Cost function
loss는 개별적인 값, cost는 모델 전체적인 값에 대한 설명
Blue line : minimize 해야 하는 목적함수
Black circle : 현재의 solution
화살표의 방향 : 현재 solution의 qulity를 올리기 위해 움직일 방향
Gradient : 1차 미분값
1. 현재 gradient가 0인가?
Yes -> 학습 종료
No -> 학습 진행
2. gradient가 0이 되기 위해 어떻게 해야 하는가?
gradient와 반대 방향으로 current weight를 이동한다
3. 얼마나 움직여야 하는가?
Not sure
아주 작은 w의 변화율에 대해
$$
f(w + \Delta w) = f(w) + \frac{f'(w)}{1!}\Delta w + \frac{f''(w)}{2!}\Delta w + \cdots
$$
$$
w_{new} = w_{old} - \alpha f'(w),\quad where; 0 < \alpha < 1
$$
$$
f(w_{new}) = f(w_{old} - \alpha f'(w_{old})) \cong f(w_{old}) - \alpha|f'(w)]^2 < f(w_{old})
$$
Use chain rule
$$
\frac{\partial L}{\partial y} = y-t \quad \frac{\partial y}{\partial h} = 1
$$
$$
\frac{\partial h}{\partial a} = \frac{exp(-a)}{(1+exp(-a))^2} = \frac{1}{1 + exp(-a)} \cdot \frac{exp(-a)}{1 + exp(-a)} = h(1-h)
$$
$$
\frac{\partial a}{\partial w_i} = x_i
$$
Gradients for w and x
$$
\frac{\partial L}{\partial w_i} = \frac{\partial L}{\partial y} \cdot \frac{\partial y}{\partial h} \cdot \frac{\partial h}{\partial a} \cdot \frac{\partial a}{\partial w_i} = (y-t) \cdot 1 \cdot h(1-h) \cdot x_i
$$
$$
{w_i}^{new} = {w_i}^{old} - \alpha \times (y-t) \cdot 1 \cdot h(1-h) \cdot x_i
$$
얼마나 자주 가중치를 업데이트 하는가?
개별적 instance를 가지고 weight update
모든 instance를 사용해 loss를 평균낸 후 한번에 weight update
SGD와 BGD의 절충안
N개의 instance를 사용해 weight-update
한번에 얼마나 업데이트 하는가?
$\alpha$가 너무 클 경우, 발산 가능성 있음
$\alpha$가 너무 작을 경우, 너무 느림
적절한 learning rate 필요
Adam, RMSProp 등의 방법론 자주 이용
1. Classification
Linear한 Hyper plane으로 구별
2. Regression
Multiple linaer regression
비선형 관계의 예측이 불가능하다
복잡한 문제를 작고 간단한 문제들오 decompose하자
Logistic Regression | Decision Tree | MLP | |
---|---|---|---|
No. of lines | 1 | No restriction | User defined |
Direction of lines | No restriction | Vertical to an axis | No restriction |
Feed-forward Neural Network with One Hidden Layer
The output node is a combination of all perceptrons
N. of output nodes = N. of classes
인공 신경망(ANN)의 복잡도(complexity) 결정하는 역할
best prediction을 만들어내는 weight를 찾는 과정
너무 많은 iteration은 overfitting을 유발
Chapter 8. Association Rule Mining (1) | 2023.05.11 |
---|---|
Chapter 7. Ensemble Learning (1) | 2023.05.11 |
[다변량 데이터 분석] Chapter.05 (0) | 2023.03.28 |
[다변량 데이터 분석] Chapter.04 (1) | 2023.03.21 |
[다변량 데이터 분석] Chapter.03 (0) | 2023.03.19 |
댓글 영역