Learning in humans and machines