Imported from https://github.com/LIVIAETS/surface-loss