Algorithms for Learning Markov Field Policies