Variational Inverse Control with Events: A General Framework for Data-Driven Reward Definition