Implicit Training of Energy Model for Structure Prediction