class_docstr: Selects instances by expected gradient length [Set07]_.
class_docstr_tok: ["Selects","instances","by","expected","gradient","length","[","Set07","]","_","."]
docstr: Parameters
  ----------
  num_classes : int
      Number of classes.
  batch_size : int, default=50
      Batch size in which the query strategy scores the instances.
  device : str or torch.device, default=None
      Torch device on which the computation will be performed.
  pbar : 'tqdm' or None, default='tqdm'
      Displays a progress bar if 'tqdm' is passed.
docstr_tok: ["Parameters","--","--","--","--","--","num_classes",":","int","Number","of","classes",".","batch_size",":","int",",","default=50","Batch","size","in","which","the","query","strategy","scores","the","instances",".","device",":","str","or","torch.device",",","default=None","Torch","device","on","which","the","computation","will","be","performed",".","pbar",":","'tqdm","'","or","None",",","default='tqdm'","Displays","a","progress","bar","if","'tqdm","'","is","passed","."]
code: def __init__(
      self, num_classes, batch_size=50, device="cuda", pbar="tqdm"
  ):
      """
      Parameters
      ----------
      num_classes : int
          Number of classes.
      batch_size : int, default=50
          Batch size in which the query strategy scores the instances.
      device : str or torch.device, default=None
          Torch device on which the computation will be performed.
      pbar : 'tqdm' or None, default='tqdm'
          Displays a progress bar if 'tqdm' is passed.
      """
      self.batch_size = batch_size
      self.num_classes = num_classes
      self.device = device
      self.pbar = pbar
  
      self.scores_ = None
  
imports: import numpy
  from small_text.integrations.pytorch.exceptions import PytorchNotFoundError
  from small_text.query_strategies import constraints, QueryStrategy, EmbeddingBasedQueryStrategy
  from small_text.utils.clustering import init_kmeans_plusplus_safe
  from small_text.utils.context import build_pbar_context
  from small_text.utils.data import list_length
label_desc: Use image node_id 1 to create a new ExpectedGradientLength object from inherited base classes: QueryStrategy with example: obj = ExpectedGradientLength(num_classes, batch_size, device, pbar)