Representing visual entities with deep hierarchical and compositional models