Artificially intelligent hydrogels responding to external stimuli such as temperature and pH