Imported from https://github.com/cvqluu/Additive-Margin-Softmax-Loss-Pytorch