Learning Structured Representations For Generalization In The Physical World