View source on GitHub |
Contains configuration for virtual adversarial training.
nsl.configs.VirtualAdvConfig(
adv_neighbor_config=attr_dict['adv_neighbor_config'].default,
distance_config=attr_dict['distance_config'].default,
num_approx_steps=attr_dict['num_approx_steps'].default,
approx_difference=attr_dict['approx_difference'].default
)
Attributes | |
---|---|
adv_neighbor_config
|
an nsl.configs.AdvNeighborConfig object for
generating virtual adversarial examples. Defaults to
nsl.configs.AdvNeighborConfig() .
|
distance_config
|
a nsl.configs.DistanceConfig object for calculating
virtual adversarial loss. Defaults to nsl.configs.DistanceConfig() .
|
num_approx_steps
|
number of steps used to approximate the calculation of Hessian matrix required for creating virtual adversarial examples. Defaults to 1. |
approx_difference
|
the finite difference to approximate the calculation of
the Hessian matrix required for creating virtual adversarial examples,
namely, the xi in Equation 12 in the paper:
https://arxiv.org/pdf/1704.03976.pdf. Defaults to 1e-6.
|
Methods
__eq__
__eq__(
other
)
Method generated by attrs for class VirtualAdvConfig.
__ge__
__ge__(
other
)
Method generated by attrs for class VirtualAdvConfig.
__gt__
__gt__(
other
)
Method generated by attrs for class VirtualAdvConfig.
__le__
__le__(
other
)
Method generated by attrs for class VirtualAdvConfig.
__lt__
__lt__(
other
)
Method generated by attrs for class VirtualAdvConfig.
__ne__
__ne__(
other
)
Method generated by attrs for class VirtualAdvConfig.