Learning the Inversion of Control