고양이 | 자동차 | 개구리 | |
---|---|---|---|
cat | 3.2 | 1.3 | 2.2 |
car | 5.1 | 4.9 | 2.5 |
flog | -1.7 | 2.0 | -3.1 |
Losses | 2.9 | 0 | 12.9 |
SVM loss
고양이
= max(0, 5.1 - 3.2 + 1) + max(0, -1.7 - 3.2 + 1)
= max(0, 2.9) + 0
= 2.9
자동차
= max(0, 1.3 - 4.9 + 1) + max(0,2.0 - 4.9 + 1 )
= max(0, -2.6) + max(0, -1.9)
= 0 + 0
= 0
개구리
= max(0, 2.2 - (-3.1) + 1) + max(0, 2.5 - (-3.1) + 1 )
= max(0, 6.3) + max(0, 6.6)
= 6.3 + 6.6
= 12.9
L = (2.9 + 0 + 12.9) / 3
= 5.27
https://www.slideshare.net/slideshow/embed_code/key/uikyji64aEyeE2
http://vision.stanford.edu/teaching/cs231n-demos/linear-classify/
https://wewinserv.tistory.com/74
http://aikorea.org/cs231n/linear-classify/#svmvssoftmax
https://www.quora.com/What-is-the-difference-between-softmax-and-svm-classifiers