quaternion-based-loss-function