class_docstr: Example model for using `PairwiseDistance` by subclassing.
class_docstr_tok: ["Example","model","for","using","`","PairwiseDistance","`","by","subclassing","."]
code: def __init__(self, distance_config, **kwargs):
      super(_PairwiseRegularizedModel, self).__init__(**kwargs)
      self._regularizer = layers.PairwiseDistance(
          distance_config, name="graph_loss"
      )
      self._unregularized_model = tf.keras.Sequential(
          [
              tf.keras.layers.Dense(16, activation="relu"),
              tf.keras.layers.Dense(3),
          ]
      )
  
file_path: neural-structured-learning/neural_structured_learning/keras/layers/layers_test.py
imports: from __future__ import absolute_import
  from __future__ import division
  from __future__ import print_function
  import itertools
  from absl.testing import parameterized
  from neural_structured_learning import configs
  from neural_structured_learning.keras import layers
  import numpy
  import tensorflow
label_desc: Use image node_id 1 to create a new _PairwiseRegularizedModel object from inherited base classes: tf.keras with example: obj = _PairwiseRegularizedModel(distance_config)