Join us at TensorFlow World, Oct 28-31. Use code TF20 for 20% off select passes. Register now

nsl.configs.make_adv_reg_config

View source on GitHub

Creates AdvRegConfig object.

nsl.configs.make_adv_reg_config(
    multiplier=attr.fields(AdvRegConfig).multiplier.default,
    feature_mask=attr.fields(AdvNeighborConfig).feature_mask.default,
    adv_step_size=attr.fields(AdvNeighborConfig).adv_step_size.default,
    adv_grad_norm=attr.fields(AdvNeighborConfig).adv_grad_norm.default
)

Args:

  • multiplier: multiplier to adversarial regularization loss. Default set to 0.2.
  • feature_mask: mask (w/ 0-1 values) applied on gradient. The shape should be the same as (or broadcastable to) input features. If set to None, no feature mask will be applied.
  • adv_step_size: step size to find the adversarial sample. Default set to 0.001.
  • adv_grad_norm: type of tensor norm to normalize the gradient. Input will be converted to NormType when applicable (e.g., 'l2' -> NormType.L2). Default set to L2 norm.

Returns:

An AdvRegConfig object.