Energy-Based Models for Object-Oriented Learning