Counterfactual Maximum Likelihood Estimation for Training Deep Networks