cs231n / cs231n.github.io

Public facing notes page
MIT License
10.06k stars 4.06k forks source link

svm.ipynb subtley does not require calculation of regularization term #253

Open ArthurConmy opened 3 years ago

ArthurConmy commented 3 years ago

While completing the SVM task of assignment one, I noticed an irregularity which I hope was not intended (if so, it is quite evil!).

Note that in the below screenshot, to the right of the screen I've forgotten to add the loss and yet still the difference is zero (making me think I've implemented loss correctly):

Screenshot from 2021-01-25 22-18-14

And now properly calculating the loss:

Screenshot from 2021-01-25 22-18-35

also has difference zero as a sanity check. I begin to see a difference when the regularization is 0.005, but this is much larger than the current value of 0.000005, so of course there may be unintended consequences of increasing the regularization parameter this much (as yet untested).