Representation learning for control