Learning the Compositional Nature of Visual Objects