class_docstr: Base class for attacking a model with word substiutitions using a
  genetic algorithm.
  
  Args:
      pop_size (int): The population size. Defaults to 20.
      max_iters (int): The maximum number of iterations to use. Defaults to 50.
      temp (float): Temperature for softmax function used to normalize probability dist when sampling parents.
          Higher temperature increases the sensitivity to lower probability candidates.
      give_up_if_no_improvement (bool): If True, stop the search early if no candidate that improves the score is found.
      post_crossover_check (bool): If True, check if child produced from crossover step passes the constraints.
      max_crossover_retries (int): Maximum number of crossover retries if resulting child fails to pass the constraints.
          Applied only when `post_crossover_check` is set to `True`.
          Setting it to 0 means we immediately take one of the parents at random as the child upon failure.
class_docstr_tok: ["Base","class","for","attacking","a","model","with","word","substiutitions","using","a","genetic","algorithm",".","Args",":","pop_size","(","int",")",":","The","population","size",".","Defaults","to","20.","max_iters","(","int",")",":","The","maximum","number","of","iterations","to","use",".","Defaults","to","50.","temp","(","float",")",":","Temperature","for","softmax","function","used","to","normalize","probability","dist","when","sampling","parents",".","Higher","temperature","increases","the","sensitivity","to","lower","probability","candidates",".","give_up_if_no_improvement","(","bool",")",":","If","True",",","stop","the","search","early","if","no","candidate","that","improves","the","score","is","found",".","post_crossover_check","(","bool",")",":","If","True",",","check","if","child","produced","from","crossover","step","passes","the","constraints",".","max_crossover_retries","(","int",")",":","Maximum","number","of","crossover","retries","if","resulting","child","fails","to","pass","the","constraints",".","Applied","only","when","`","post_crossover_check","`","is","set","to","`","True","`",".","Setting","it","to","0","means","we","immediately","take","one","of","the","parents","at","random","as","the","child","upon","failure","."]
code: def extra_repr_keys(self):
      return [
          "pop_size",
          "max_iters",
          "temp",
          "give_up_if_no_improvement",
          "post_crossover_check",
          "max_crossover_retries",
      ]
  
imports: from abc import ABC, abstractmethod
  import numpy
  import torch
  from textattack.goal_function_results import GoalFunctionResultStatus
  from textattack.search_methods import PopulationBasedSearch, PopulationMember
  from textattack.shared.validators import transformation_consists_of_word_swaps
label_desc: Use image node_id 12 for calling the GeneticAlgorithm obj's underlying member method code with example usage: obj.extra_repr_keys() and returns: list