GroupEnc: encoder with group loss for global structure preservation