def parse_params(self,
                   y_target=None,
                   image_target=None,
                   initial_num_evals=100,
                   max_num_evals=10000,
                   stepsize_search='grid_search',
                   num_iterations=64,
                   gamma=0.01,
                   constraint='l2',
                   batch_size=128,
                   verbose=True,
                   clip_min=0,
                   clip_max=1):
    """
    :param y: A tensor of shape (1, nb_classes) for true labels.
    :param y_target:  A tensor of shape (1, nb_classes) for target labels.
    Required for targeted attack.
    :param image_target: A tensor of shape (1, **image shape) for initial
    target images. Required for targeted attack.
    :param initial_num_evals: initial number of evaluations for
                              gradient estimation.
    :param max_num_evals: maximum number of evaluations for gradient estimation.
    :param stepsize_search: How to search for stepsize; choices are
                            'geometric_progression', 'grid_search'.
                            'geometric progression' initializes the stepsize
                             by ||x_t - x||_p / sqrt(iteration), and keep
                             decreasing by half until reaching the target
                             side of the boundary. 'grid_search' chooses the
                             optimal epsilon over a grid, in the scale of
                             ||x_t - x||_p.
    :param num_iterations: The number of iterations.
    :param gamma: The binary search threshold theta is gamma / sqrt(d) for
                   l2 attack and gamma / d for linf attack.
    :param constraint: The distance to optimize; choices are 'l2', 'linf'.
    :param batch_size: batch_size for model prediction.
    :param verbose: (boolean) Whether distance at each step is printed.
    :param clip_min: (optional float) Minimum input component value
    :param clip_max: (optional float) Maximum input component value
    """

    # ignore the y and y_target argument
    self.y_target = y_target
    self.image_target = image_target
    self.initial_num_evals = initial_num_evals
    self.max_num_evals = max_num_evals
    self.stepsize_search = stepsize_search
    self.num_iterations = num_iterations
    self.gamma = gamma
    self.constraint = constraint
    self.batch_size = batch_size
    self.clip_min = clip_min
    self.clip_max = clip_max
    self.verbose = verbose
def parse_params ( self , y_target = None , image_target = None , initial_num_evals = 100 , max_num_evals = 10000 , stepsize_search = 'grid_search' , num_iterations = 64 , gamma = 0.01 , constraint = 'l2' , batch_size = 128 , verbose = True , clip_min = 0 , clip_max = 1 ) : self . y_target = y_target self . image_target = image_target self . initial_num_evals = initial_num_evals self . max_num_evals = max_num_evals self . stepsize_search = stepsize_search self . num_iterations = num_iterations self . gamma = gamma self . constraint = constraint self . batch_size = batch_size self . clip_min = clip_min self . clip_max = clip_max self . verbose = verbose
:param y: A tensor of shape (1, nb_classes) for true labels.
    :param y_target:  A tensor of shape (1, nb_classes) for target labels.
    Required for targeted attack.
    :param image_target: A tensor of shape (1, **image shape) for initial
    target images. Required for targeted attack.
    :param initial_num_evals: initial number of evaluations for
                              gradient estimation.
    :param max_num_evals: maximum number of evaluations for gradient estimation.
    :param stepsize_search: How to search for stepsize; choices are
                            'geometric_progression', 'grid_search'.
                            'geometric progression' initializes the stepsize
                             by ||x_t - x||_p / sqrt(iteration), and keep
                             decreasing by half until reaching the target
                             side of the boundary. 'grid_search' chooses the
                             optimal epsilon over a grid, in the scale of
                             ||x_t - x||_p.
    :param num_iterations: The number of iterations.
    :param gamma: The binary search threshold theta is gamma / sqrt(d) for
                   l2 attack and gamma / d for linf attack.
    :param constraint: The distance to optimize; choices are 'l2', 'linf'.
    :param batch_size: batch_size for model prediction.
    :param verbose: (boolean) Whether distance at each step is printed.
    :param clip_min: (optional float) Minimum input component value
    :param clip_max: (optional float) Maximum input component value