code: def test_train_with_2_outputs(self):
      w, x0, y0, lr, adv_config, _ = self._set_up_linear_regression()
      inputs = {
          "feature": tf.constant(x0),
          "label1": tf.constant(y0),
          "label2": tf.constant(-y0),
      }
  
      input_layer = tf.keras.Input(shape=(2,), name="feature")
      layer1 = tf.keras.layers.Dense(
          w.shape[-1],
          use_bias=False,
          kernel_initializer=tf.keras.initializers.Constant(w),
      )
      layer2 = tf.keras.layers.Dense(
          w.shape[-1],
          use_bias=False,
          kernel_initializer=tf.keras.initializers.Constant(-w),
      )
      model = tf.keras.Model(
          inputs={"feature": input_layer},
          outputs=[layer1(input_layer), layer2(input_layer)],
      )
  
      adv_model = adversarial_regularization.AdversarialRegularization(
          model, label_keys=["label1", "label2"], adv_config=adv_config
      )
      adv_model.compile(
          optimizer=tf.keras.optimizers.SGD(lr),
          loss="MSE",
          metrics=[tf.keras.metrics.MeanAbsoluteError()],
      )
      history = adv_model.fit(x=inputs, batch_size=1, steps_per_epoch=1)
  
      expected_metric = np.abs(y0 - np.dot(x0, w)).mean()
      self.assertAllClose(
          expected_metric,
          history.history["mean_absolute_error_label1"][0],
      )
      self.assertAllClose(
          expected_metric,
          history.history["mean_absolute_error_label2"][0],
      )
  
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 12 for calling the AdversarialRegularizationTest obj's underlying member method code with example usage: obj.test_train_with_2_outputs() without return types