fgsm
FGSM
¶
Bases: TensorOp
Create an adversarial sample from input data using the Fast Gradient Sign Method.
See https://arxiv.org/abs/1412.6572 for an explanation of adversarial attacks.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
data
|
str
|
Key of the input to be attacked. |
required |
loss
|
str
|
Key of the loss value to use for gradient computation. |
required |
outputs
|
str
|
The key under which to save the output. |
required |
epsilon
|
float
|
The strength of the perturbation to use in the attack. |
0.01
|
clip_low
|
Optional[float]
|
a minimum value to clip the output by (defaults to min value of data when set to None). |
None
|
clip_high
|
Optional[float]
|
a maximum value to clip the output by (defaults to max value of data when set to None). |
None
|
mode
|
Union[None, str, Iterable[str]]
|
What mode(s) to execute this Op in. For example, "train", "eval", "test", or "infer". To execute regardless of mode, pass None. To execute in all modes except for a particular one, you can pass an argument like "!infer" or "!train". |
None
|
ds_id
|
Union[None, str, Iterable[str]]
|
What dataset id(s) to execute this Op in. To execute regardless of ds_id, pass None. To execute in all ds_ids except for a particular one, you can pass an argument like "!ds1". |
None
|