Imported from https://github.com/dougbrion/pytorch-classification-uncertainty