학교공부/기계학습

[기계학습] 각 모델들의 Cost function과 Gradient

Dev_Camp 2023. 10. 21. 21:34

Linear Regression

Linear regression에서의 MSE cost와 그 gradient는 다음과 같다.

 

다음은 그 유도 과정이다.

 

 

 

 

Logistic Regression

logistic regression의 cost function인 Cross Entropy(CE)의 classic form과 vector form은 다음과 같다.

 

그리고 CE의 gradient를 구하면

 

 

다음은 이를 증명하는 과정이다.

 

 

 

 

 

Perceptron

다음은 perceptron의 cost function이다.

 

이를 통해 gradient를 구할 수 있다.

 

 

 

 

Multi-Layer Perceptron

 

출력층

 

은닉층

 

 

 

결과적으로 다음과 같이 정리될 수 있다.

 

 

 

Minibatch SGD algorithm

 

 

 

 

 

Softmax Classifier

softmax classifier의 CE는 다음과 같다.

 

그리고 해당 CE의 gradient를 구하면