Goal-Based Imitation as Probabilistic Inference over Graphical Models