class_docstr: HotFlip generator.
  
  This implemention uses a single backward pass to estimate the gradient of
  each token and uses them to heuristically estimate the impact of perturbing
  the token.
  
  This generator works for both classification and regression models. In the
  case of classification models, the returned counterfactuals are guaranteed to
  have a different prediction class as the original example. In the case of
  regression models, the returned counterfactuals are guaranteed to be on the
  opposite side of a user-provided threshold as the original example.
  
  The returned counterfactuals are guaranteed to be minimal in the sense that
  no strict subset of the applied token perturbations would have resulted in a
  prediction flip.
class_docstr_tok: ["HotFlip","generator",".","This","implemention","uses","a","single","backward","pass","to","estimate","the","gradient","of","each","token","and","uses","them","to","heuristically","estimate","the","impact","of","perturbing","the","token",".","This","generator","works","for","both","classification","and","regression","models",".","In","the","case","of","classification","models",",","the","returned","counterfactuals","are","guaranteed","to","have","a","different","prediction","class","as","the","original","example",".","In","the","case","of","regression","models",",","the","returned","counterfactuals","are","guaranteed","to","be","on","the","opposite","side","of","a","user-provided","threshold","as","the","original","example",".","The","returned","counterfactuals","are","guaranteed","to","be","minimal","in","the","sense","that","no","strict","subset","of","the","applied","token","perturbations","would","have","resulted","in","a","prediction","flip","."]
docstr: Checks whether a subset of 'cand_set' exists in 'sets'.
docstr_tok: ["Checks","whether","a","subset","of","'cand_set","'","exists","in","'sets","'","."]
code: def _subset_exists(self, cand_set, sets):
      """Checks whether a subset of 'cand_set' exists in 'sets'."""
      for s in sets:
          if s.issubset(cand_set):
              return True
      return False
  
imports: from collections.abc import Iterator, Mapping
  import itertools
  from typing import Any, cast, Optional
  from absl import logging
  from lit_nlp.api import components
  from lit_nlp.api import dataset
  from lit_nlp.api import model
  from lit_nlp.api import types
  from lit_nlp.components import cf_utils
  from lit_nlp.lib import utils
  import numpy
label_desc: Use image node_id 6 for calling the HotFlip obj's underlying member method code with example usage: obj._subset_exists(cand_set, sets) and returns: False, True