Skip to content

Commit a8f2e90

Browse files
Neural-Link Teamtensorflow-copybara
authored andcommitted
Clarifies the meaning of the AdvRegConfig.feature_mask field.
PiperOrigin-RevId: 305547503
1 parent 3674768 commit a8f2e90

File tree

1 file changed

+6
-3
lines changed

1 file changed

+6
-3
lines changed

neural_structured_learning/configs/configs.py

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -90,9 +90,12 @@ def make_adv_reg_config(
9090
9191
Args:
9292
multiplier: multiplier to adversarial regularization loss. Defaults to 0.2.
93-
feature_mask: mask (w/ 0-1 values) applied on the gradient. The shape should
94-
be the same as (or broadcastable to) input features. If set to `None`, no
95-
feature mask will be applied.
93+
feature_mask: mask (w/ values of 0.0 or 1.0) applied on the gradient. Its
94+
shape should be the same as (or broadcastable to) the input features:
95+
input features corresponding to mask values of 0.0 are *not* be perturbed,
96+
while those corresponding to mask values of 1.0 are considered
97+
perturbable. If set to `None`, all input features are considered
98+
perturbable.
9699
adv_step_size: step size to find the adversarial sample. Defaults to 0.001.
97100
adv_grad_norm: type of tensor norm to normalize the gradient. Input will be
98101
converted to `NormType` when applicable (e.g., a value of 'l2' will be

0 commit comments

Comments
 (0)