jpsember / ml_old

Python and machine learning experiments
0 stars 0 forks source link

Add SVM loss #7

Closed jpsember closed 7 years ago

jpsember commented 7 years ago

http://cs231n.github.io/linear-classify/#svm

jpsember commented 7 years ago

img_20170126_142308

This is what our function should look like.

We should have a custom SVM loss node that is able to dynamically determine loss (and gradient) based upon the training sample's label, yi.

jpsember commented 7 years ago

Let's attempt this first with the 'toy example':

http://cs231n.github.io/neural-networks-case-study/

jpsember commented 7 years ago
jpsember commented 7 years ago

Results agree with toy example from lecture notes:

screen shot 2017-01-27 at 5 32 11 pm

jpsember commented 7 years ago

This is the function, including the SVM cost and regularization loss:

screen shot 2017-01-27 at 5 33 31 pm