Python Loss-margin Resources