Imported from https://github.com/lukasruff/CVDD-PyTorch