Predictive Learning in Energy-based Models with Attractor Structures