Amortized Bethe Free Energy Minimization for Learning MRFs