Imported from https://github.com/unsky/focal-loss