code: def build_linear_subclass_model(input_shape, weights, num_output=1):
      del input_shape
  
      class CustomLinearModel(tf.keras.Model):
          def __init__(self, weights, num_output, name=None):
              super(CustomLinearModel, self).__init__(name=name)
              self.init_weights = weights
              self.num_output = num_output
              self.dense = tf.keras.layers.Dense(
                  num_output,
                  use_bias=False,
                  name="dense",
                  kernel_initializer=tf.keras.initializers.Constant(
                      weights
                  ),
              )
  
          def call(self, inputs):
              return self.dense(inputs[FEATURE_NAME])
  
          def get_config(self):
              return {
                  "name": self.name,
                  "weights": self.init_weights,
                  "num_output": self.num_output,
              }
  
      return CustomLinearModel(weights, num_output)
  
imports: from __future__ import absolute_import
  from __future__ import division
  from __future__ import print_function
  import os
  from absl.testing import parameterized
  from neural_structured_learning import configs
  from neural_structured_learning.keras import graph_regularization
  import numpy
  import tensorflow
  from google.protobuf import text_format
  from tensorflow.python.framework import test_util
label_desc: Use image node_id 4 for calling a global function with example usage: build_linear_subclass_model(input_shape, weights, num_output) and returns: CustomLinearModel, self, dict