@@ -45,7 +45,7 @@ class AdvNeighborConfig(object):
4545 0.001.
4646 adv_grad_norm: type of tensor norm to normalize the gradient. Input will be
4747 converted to `nsl.configs.NormType` when applicable (e.g., `'l2'` ->
48- `NormType.L2`). Default set to L2 norm.
48+ `nls.configs. NormType.L2`). Default set to L2 norm.
4949 """
5050 feature_mask = attr .ib (default = None )
5151 adv_step_size = attr .ib (default = 0.001 )
@@ -112,7 +112,8 @@ class AdvTargetConfig(object):
112112
113113 Attributes:
114114 target_method: type of adversarial targeting method. The value needs to be
115- one of the enums from AdvTargetType (e.g., AdvTargetType.LEAST).
115+ one of the enums from `nsl.configs.AdvTargetType` (e.g.,
116+ `nsl.configs.AdvTargetType.LEAST`).
116117 random_seed: a Python integer as seed in 'random_uniform' op.
117118 """
118119 target_method = attr .ib (default = AdvTargetType .GROUND_TRUTH )
@@ -176,16 +177,17 @@ def all(cls):
176177
177178@attr .s
178179class DecayConfig (object ):
179- """Contains configuration for computing decayed value.
180+ """Contains configuration for decaying a value during training .
180181
181182 Attributes:
182- decay_steps: A scalar int32 or int64 Tensor or a Python number. How often to
183- apply decay. Must be positive.
184- decay_rate: A scalar float32 or float64 Tensor or a Python number. Default
185- set to 0.96.
186- min_value: minimal acceptable value after applying decay. Default set to 0.0
187- decay_type: Type of decay function to apply. Default set to
188- DecayType.EXPONENTIAL_DECAY.
183+ decay_steps: A scalar `int32` or `int64` Tensor or a Python number that
184+ specifies the decay frequency, specied in units of training steps. Must be
185+ positive.
186+ decay_rate: A scalar `float32` or `float64` Tensor or a Python number.
187+ Defaults to 0.96.
188+ min_value: minimal acceptable value after applying decay. Defaults to 0.0.
189+ decay_type: Type of decay function to apply. Defaults to
190+ `nsl.configs.DecayType.EXPONENTIAL_DECAY`.
189191 """
190192 decay_steps = attr .ib ()
191193 decay_rate = attr .ib (default = 0.96 )
@@ -224,17 +226,18 @@ class VirtualAdvConfig(object):
224226 """Contains configuration for virtual adversarial training.
225227
226228 Attributes:
227- adv_neighbor_config: an AdvNeighborConfig object for generating virtual
228- adversarial examples. Default set to AdvNeighborConfig.
229- distance_config: a DistanceConfig object for calculating virtual adversarial
230- loss. Default set to DistanceConfig.
229+ adv_neighbor_config: an `nsl.configs.AdvNeighborConfig` object for
230+ generating virtual adversarial examples. Defaults to
231+ `nsl.configs.AdvNeighborConfig()`.
232+ distance_config: a `nsl.configs.DistanceConfig` object for calculating
233+ virtual adversarial loss. Defaults to `nsl.configs.DistanceConfig()`.
231234 num_approx_steps: number of steps used to approximate the calculation of
232- Hessian matrix required for creating virtual adversarial examples. Default
233- set to 1.
235+ Hessian matrix required for creating virtual adversarial examples.
236+ Defaults to 1.
234237 approx_difference: the finite difference to approximate the calculation of
235- Hessian matrix required for creating virtual adversarial examples. (The
236- `xi` in Equation 12 in the paper: https://arxiv.org/pdf/1704.03976.pdf)
237- Default set to 1e-6.
238+ the Hessian matrix required for creating virtual adversarial examples,
239+ namely, the `xi` in Equation 12 in the paper:
240+ https://arxiv.org/pdf/1704.03976.pdf. Defaults to 1e-6.
238241 """
239242 adv_neighbor_config = attr .ib (default = AdvNeighborConfig ())
240243 distance_config = attr .ib (default = DistanceConfig ())
@@ -270,8 +273,9 @@ class GraphRegConfig(object):
270273 """Contains the configuration for graph regularization.
271274
272275 Attributes:
273- neighbor_config: An instance of `GraphNeighborConfig` that describes
274- neighbor attributes for graph regularization.
276+ neighbor_config: A `nsl.configs.GraphNeighborConfig` instance that describes
277+ neighbor attributes for graph regularization. Defaults to
278+ `nsl.configs.GraphNeighborConfig()`.
275279 multiplier: The multiplier or weight factor applied on the graph
276280 regularization loss term. This value has to be non-negative. Defaults to
277281 0.01.
0 commit comments