Building Models that Learn to Discover Structure and Relations