Imported from https://github.com/pumpikano/tf-magnet-loss