Working version of HingeLoss code used for competition, though it still seems "touchy" numerically