class_docstr: Tests regularizer methods.
docstr: Tests adv_regularizer returns expected adv_loss.
docstr_tok: ["Tests","adv_regularizer","returns","expected","adv_loss","."]
code: def testAdvRegularizer(self):
      """Tests adv_regularizer returns expected adv_loss."""
      adv_neighbor = np.array([1.0, 1.0, 1.0, 0.0, 1.0])
      target = np.array([1.0, 1.0, 1.0, 1.0, 1.0])
  
      adv_loss = regularizer.adv_regularizer(
          tf.constant(adv_neighbor),
          tf.constant(target),
          mock_model_fn,
          mock_loss_fn,
      )
      actual_loss = self.evaluate(adv_loss)
      self.assertNear(
          actual_loss,
          np.sum((adv_neighbor - target) ** 2.0) / len(target),
          1e-5,
      )
  
file_path: neural-structured-learning/neural_structured_learning/lib/regularizer_test.py
imports: from __future__ import absolute_import
  from __future__ import division
  from __future__ import print_function
  import neural_structured_learning.configs
  from neural_structured_learning.lib import regularizer
  import numpy
  import tensorflow
label_desc: Use image node_id 1 for calling the RegularizerTest obj's underlying member method code with example usage: obj.testAdvRegularizer() without return types