code: def random_search_max_confidence_recipe(sess, model, x, y, eps,
                                          clip_min, clip_max,
                                          report_path, batch_size=BATCH_SIZE,
                                          num_noise_points=10000):
    
    noise_attack = Noise(model, sess)
    threat_params = {"eps": eps, "clip_min": clip_min, "clip_max": clip_max}
    noise_attack_config = AttackConfig(noise_attack, threat_params)
    attack_configs = [noise_attack_config]
    assert batch_size % num_devices == 0
    new_work_goal = {noise_attack_config: num_noise_points}
    goals = [MaxConfidence(t=1., new_work_goal=new_work_goal)]
    bundle_attacks(sess, model, x, y, attack_configs, goals, report_path)
docs: Max confidence using random search.
  
    References:
    https://openreview.net/forum?id=H1g0piA9tQ
      Describes the max_confidence procedure used for the bundling in this recipe
    https://arxiv.org/abs/1802.00420
      Describes using random search with 1e5 or more random points to avoid
      gradient masking.
  
    :param sess: tf.Session
    :param model: cleverhans.model.Model
    :param x: numpy array containing clean example inputs to attack
    :param y: numpy array containing true labels
    :param nb_classes: int, number of classes
    :param eps: float, maximum size of perturbation (measured by max norm)
    :param eps_iter: float, step size for one version of PGD attacks
      (will also run another version with 25X smaller step size)
    :param nb_iter: int, number of iterations for one version of PGD attacks
      (will also run another version with 25X more iterations)
    :param report_path: str, the path that the report will be saved to.
    :batch_size: int, the total number of examples to run simultaneously