code: def model_creator(config):
      if config.get("num_channels"):
          num_channels = config["num_channels"]
      else:
          n_hid = config["nhid"] if config.get("nhid") else 30
          levels = config["levels"] if config.get("levels") else 8
          num_channels = [n_hid] * (levels - 1)
  
      model = TemporalConvNet(
          past_seq_len=config["past_seq_len"],
          future_seq_len=config["future_seq_len"],
          input_feature_num=config["input_feature_num"],
          output_feature_num=config["output_feature_num"],
          num_channels=num_channels.copy(),
          kernel_size=config.get("kernel_size", 7),
          dropout=config.get("dropout", 0.2),
          repo_initialization=config.get("repo_initialization", True),
      )
      if config.get("normalization", False):
          model = NormalizeTSModel(model, config["output_feature_num"])
      inputs = np.zeros(
          shape=(1, config["past_seq_len"], config["input_feature_num"])
      )
      # init weights matrix
      model(inputs)
      learning_rate = config.get("lr", 1e-3)
      model.compile(
          optimizer=getattr(
              tf.keras.optimizers, config.get("optim", "Adam")
          )(learning_rate),
          loss=config.get("loss", "mse"),
          metrics=[config.get("metics", "mse")],
      )
      return model
  
file_path: BigDL/python/chronos/src/bigdl/chronos/model/tf2/TCN_keras.py
imports: from tokenize import group
  import numpy
  import tensorflow
  from bigdl.nano.tf.keras import Model
  from tensorflow.keras.layers import Conv1D, BatchNormalization, Activation, Dropout, Input, Layer
  from bigdl.chronos.model.tf2.keras_model_wrapper import NormalizeTSModel
label_desc: Use image node_id 1 for calling a global function with example usage: model_creator(config) and returns: model