TF 2.0 is out! Get hands-on practice at TF World, Oct 28-31. Use code TF20 for 20% off select passes. Register now


View source on GitHub

Creates an nsl.configs.GraphRegConfig object.


Used in the tutorials:


  • neighbor_prefix: The prefix in feature names that identifies neighbor-specific features. Defaults to 'NLnbr'.
  • neighbor_weight_suffix: The suffix in feature names that identifies the neighbor weight value. Defaults to '_weight'. Note that neighbor weight features will have prefix as a prefix and weight_suffix as a suffix. For example, based on the default values of prefix and weight_suffix, a valid neighbor weight feature is 'NL_nbr_0_weight', where 0 corresponds to the first neighbor of the sample.
  • max_neighbors: The maximum number of neighbors to be used for graph regularization. Defaults to 0, which disables graph regularization. Note that this value has to be less than or equal to the actual number of neighbors in each sample.
  • multiplier: The multiplier or weight factor applied on the graph regularization loss term. This value has to be non-negative. Defaults to 0.01.
  • distance_type: type of distance function. Input type will be converted to the appropriate nsl.configs.DistanceType value (e.g., the value 'l2' is converted to nsl.configs.DistanceType.L2). Defaults to the L2 norm.
  • reduction: type of distance reduction. See tf.compat.v1.losses.Reduction for details. Defaults to tf.losses.Reduction.SUM_BY_NONZERO_WEIGHTS.
  • sum_over_axis: the distance is the sum over the difference along the axis. See nsl.lib.pairwise_distance_wrapper for how this field is used. Defaults to None.
  • transform_fn: type of transform function to be applied on each side before computing the pairwise distance. Input type will be converted to nsl.configs.TransformType when applicable (e.g., the value 'softmax' maps to nsl.configs.TransformType.SOFTMAX). Defaults to 'none'.


An nsl.configs.GraphRegConfig object.