nsl.configs.VirtualAdvConfig
Stay organized with collections
Save and categorize content based on your preferences.
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.
Except as otherwise noted, the content of this page is licensed under the Creative Commons Attribution 4.0 License, and code samples are licensed under the Apache 2.0 License. For details, see the Google Developers Site Policies. Java is a registered trademark of Oracle and/or its affiliates.
Last updated 2022-08-12 UTC.
[null,null,["Last updated 2022-08-12 UTC."],[],[],null,["# nsl.configs.VirtualAdvConfig\n\n\u003cbr /\u003e\n\n|-------------------------------------------------------------------------------------------------------------------------------------------------------|\n| [View source on GitHub](https://github.com/tensorflow/neural-structured-learning/blob/v1.4.0/neural_structured_learning/configs/configs.py#L278-L299) |\n\nContains configuration for virtual adversarial training. \n\n nsl.configs.VirtualAdvConfig(\n adv_neighbor_config=attr_dict['adv_neighbor_config'].default,\n distance_config=attr_dict['distance_config'].default,\n num_approx_steps=attr_dict['num_approx_steps'].default,\n approx_difference=attr_dict['approx_difference'].default\n )\n\n\u003cbr /\u003e\n\n\u003cbr /\u003e\n\n\u003cbr /\u003e\n\n| Attributes ---------- ||\n|-----------------------|--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|\n| `adv_neighbor_config` | an [`nsl.configs.AdvNeighborConfig`](../../nsl/configs/AdvNeighborConfig) object for generating virtual adversarial examples. Defaults to [`nsl.configs.AdvNeighborConfig()`](../../nsl/configs/AdvNeighborConfig). |\n| `distance_config` | a [`nsl.configs.DistanceConfig`](../../nsl/configs/DistanceConfig) object for calculating virtual adversarial loss. Defaults to [`nsl.configs.DistanceConfig()`](../../nsl/configs/DistanceConfig). |\n| `num_approx_steps` | number of steps used to approximate the calculation of Hessian matrix required for creating virtual adversarial examples. Defaults to 1. |\n| `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. |\n\n\u003cbr /\u003e\n\nMethods\n-------\n\n### `__eq__`\n\n __eq__(\n other\n )\n\nMethod generated by attrs for class VirtualAdvConfig.\n\n### `__ge__`\n\n __ge__(\n other\n )\n\nMethod generated by attrs for class VirtualAdvConfig.\n\n### `__gt__`\n\n __gt__(\n other\n )\n\nMethod generated by attrs for class VirtualAdvConfig.\n\n### `__le__`\n\n __le__(\n other\n )\n\nMethod generated by attrs for class VirtualAdvConfig.\n\n### `__lt__`\n\n __lt__(\n other\n )\n\nMethod generated by attrs for class VirtualAdvConfig.\n\n### `__ne__`\n\n __ne__(\n other\n )\n\nMethod generated by attrs for class VirtualAdvConfig."]]