Missed TensorFlow World? Check out the recap. Learn more

nsl.configs.AdvNeighborConfig

View source on GitHub

Class AdvNeighborConfig

Contains configuration for generating adversarial neighbors.

Attributes:

  • feature_mask: mask (w/ 0-1 values) applied on the 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 nsl.configs.NormType when applicable (e.g., 'l2' -> nls.configs.NormType.L2). Default set to L2 norm.

__init__

__init__(
    feature_mask=attr_dict['feature_mask'].default,
    adv_step_size=attr_dict['adv_step_size'].default,
    adv_grad_norm=attr_dict['adv_grad_norm'].default
)

Initialize self. See help(type(self)) for accurate signature.

Methods

__eq__

__eq__(other)

Return self==value.

__ge__

__ge__(other)

Automatically created by attrs.

__gt__

__gt__(other)

Automatically created by attrs.

__le__

__le__(other)

Automatically created by attrs.

__lt__

__lt__(other)

Automatically created by attrs.

__ne__

__ne__(other)

Check equality and either forward a NotImplemented or return the result negated.