Imported from https://github.com/ermongroup/ssdkl