'Take in a dictionary of parameters and applies attack-specific checks
before saving them as attributes.
Attack-specific parameters:
:param eps: (optional float) attack step size (input variation)
:param ord: (optional) Order of the norm (mimics NumPy).
Possible values: np.inf, 1 or 2.
:param y: (optional) A tensor with the model labels. Only provide
this parameter if you\'d like to use true labels when crafting
adversarial samples. Otherwise, model predictions are used as
labels to avoid the "label leaking" effect (explained in this
paper: https://arxiv.org/abs/1611.01236). Default is None.
Labels should be one-hot-encoded.
:param y_target: (optional) A tensor with the labels to target. Leave
y_target=None if y is also set. Labels should be
one-hot-encoded.
:param clip_min: (optional float) Minimum input component value
:param clip_max: (optional float) Maximum input component value'

def parse_params(self, eps=0.3, ord=np.inf, y=None, y_target=None, clip_min=None, clip_max=None, **kwargs):

    self.eps = eps
    self.ord = ord
    self.y = y
    self.y_target = y_target
    self.clip_min = clip_min
    self.clip_max = clip_max
    if ((self.y is not None) and (self.y_target is not None)):
        raise ValueError('Must    not    set    both    y    and    y_target')
    if (self.ord not in [np.inf, int(1), int(2)]):
        raise ValueError('Norm    order    must    be    either    np.inf,    1,    or    2.')
    if ((self.back == 'th') and (self.ord != np.inf)):
        raise NotImplementedError('The    only    FastGradientMethod    norm    implemented    for    Theano    is    np.inf.')
    return True
