Below is the note of the hinge loss, the image is from Stanford 2017 CS231N Slides, the note is added by myself.