Imported from https://github.com/sato9hara/sgd-influence