Loss function(손실 함수)
- Loss function is a metric that shows how bad is the model prediction.
- [0, INF]
- Binary Cross-Entropy Loss(Log Loss), 2개의 카테고리로 구분 시 이용
- Negative log likelihood(NLL), 2개 이상의 카테고리로 구분 시 이용
Gradient Descent(경사 하강법)
- Gradient: Slope of a function for a given point
- Descent: Going down
- 손실 함수의 최솟값을 찾기 위해 경사 하강법을 이용한다.
x좌표의 차이가 매우 작은 두 점의 좌표를 이용해, 현재의 기울기를 구한다.
- Amount of change is decided by gradient magnitude and learning rate. (proportion, 비례)
- What if we apply too high learning rate?
It will oscillate or diverge rather than converge.
- What if we apply too low learning rate?
1. Take too many updates to arrive minima
2. Can be stuck into local minima
- Step of Gradient Descent
1. Initialize model parameters at random
2. Calculate loss in current state
3. Find a direction to reduce the loss(Gredient)
4. Change the parameter values slightly to the direction
5. Repeat 2 - 4
https://angeloyeo.github.io/2020/08/16/gradient_descent.html
Error BackPropagation(역전파)
- Each neuron sends back its current error to the its input to tell whether the value in the previous step has to be increased or decreased.
- For every parameter, we can calculate the gredient based on the input of parameters and error of its input.
- The gradient of each parameter is calculated by Backpropagation.
- After the calculation, we update the entire parameter simultaneously.
'정리 > Data&AI' 카테고리의 다른 글
활성화 함수와 손실 함수 (0) | 2022.10.20 |
---|---|
Batch와 Epoch (0) | 2022.10.13 |
Overfitting, Hyperparameters (0) | 2022.10.04 |
Python에서 OOP하기 (0) | 2022.09.14 |
Jupyter Notebook관련 이것 저것 (0) | 2022.09.14 |