Unifying perception and curiosity