iT邦幫忙

0

課堂筆記 - 深度學習 Deep Learning (14)

  • 分享至 

  • twitterImage
  •  

了解計算的公式後要來學習如何校正logistic regression:

  • Error Measure for Logistic Regression

首先複習一下前一篇的最後結論:y-hat = p(y=1|x) 在x中y=1發生的機率

=> 當y=1 時 p(y|x) = y-hat ; 當y=0 時 p(y|x) = 1-(y-bar)
https://ithelp.ithome.com.tw/upload/images/20211027/20142783FFtoqH16bb.png

整理後可以得到:
https://ithelp.ithome.com.tw/upload/images/20211027/201427839YyS6dLYBh.png

不懂就...先記起來

總之我們想要盡量的逼近我們的目標,也就是求出Max(p(y|x)),
於是想要使用單調遞增的ln()函數去盡量逼近,得出Max(ln(p(y|x)))
就是高中學的natural log,ln(x)微分後會是1/x

同時也想要盡量減少誤差,於是這邊使用的Error Function 一樣使用ln()去計算的話 => min(ln(p(y|x)))
由此可得https://ithelp.ithome.com.tw/upload/images/20211027/20142783i1sVFpRFqM.png

套用進一開始假設的E(w1,w2,b) = -ln(p(y|x)),
p(y|x)則用剛剛整理好的公式帶入 =>https://ithelp.ithome.com.tw/upload/images/20211027/20142783vyi4CsSoDA.png

就可以得到Logistic Regression的 Error Function,也就是Cross-entropy loss function
https://ithelp.ithome.com.tw/upload/images/20211027/20142783cSx7ys7jLT.png


圖片
  直播研討會
圖片
{{ item.channelVendor }} {{ item.webinarstarted }} |
{{ formatDate(item.duration) }}
直播中

尚未有邦友留言

立即登入留言