Imported from https://github.com/alexanderrichard/weakly-sup-action-learning