code: def test_perturb_on_batch(self, model_fn):
      w, x0, y0, lr, adv_config, _ = self._set_up_linear_regression()
      inputs = {"feature": x0, "label": y0}
      model = model_fn(input_shape=(2,), weights=w)
      adv_model = adversarial_regularization.AdversarialRegularization(
          model, label_keys=["label"], adv_config=adv_config
      )
      adv_model.compile(
          optimizer=tf.keras.optimizers.SGD(lr), loss=["MSE"]
      )
      adv_inputs = adv_model.perturb_on_batch(inputs)
  
      y_hat = np.dot(x0, w)
      adv_step_size = adv_config.adv_neighbor_config.adv_step_size
      x_adv = x0 + adv_step_size * np.sign((y_hat - y0) * w.T)
      self.assertAllClose(x_adv, adv_inputs["feature"])
      self.assertAllClose(y0, adv_inputs["label"])
  
imports: from __future__ import absolute_import
  from __future__ import division
  from __future__ import print_function
  import collections
  import os
  from absl.testing import parameterized
  import neural_structured_learning.configs
  from neural_structured_learning.keras import adversarial_regularization
  import numpy
  import tensorflow
  from tensorflow.python.framework import test_util
label_desc: Use image node_id 19 for calling the AdversarialRegularizationTest obj's underlying member method code with example usage: obj.test_perturb_on_batch(model_fn) without return types