Gradient-based Counterfactual Explanations using Tractable Probabilistic Models