docstr: build MTNet model
  :param config:
  :return:
docstr_tok: ["build","MTNet","model",":","param","config",":",":","return",":"]
code: def build(self, config):
      """
      build MTNet model
      :param config:
      :return:
      """
      training = True if self.mc else None
      # long-term time series historical data inputs
      long_input = Input(
          shape=(self.long_num, self.time_step, self.feature_num)
      )
      # short-term time series historical data
      short_input = Input(shape=(self.time_step, self.feature_num))
  
      # ------- no-linear component----------------
      # memory and context : (batch, long_num, last_rnn_size)
      memory = self.__encoder(
          long_input,
          num=self.long_num,
          name="memory",
          training=training,
      )
      # memory = memory_model(long_input)
      context = self.__encoder(
          long_input,
          num=self.long_num,
          name="context",
          training=training,
      )
      # context = context_model(long_input)
      # query: (batch, 1, last_rnn_size)
      query_input = Reshape(
          (1, self.time_step, self.feature_num), name="reshape_query"
      )(short_input)
      query = self.__encoder(
          query_input, num=1, name="query", training=training
      )
      # query = query_model(query_input)
  
      # prob = memory * query.T, shape is (long_num, 1)
      query_t = Permute((2, 1))(query)
      prob = Lambda(lambda xy: tf.matmul(xy[0], xy[1]))(
          [memory, query_t]
      )
      prob = Softmax(axis=-1)(prob)
      # out is of the same shape of context: (batch, long_num, last_rnn_size)
      out = multiply([context, prob])
      # concat: (batch, long_num + 1, last_rnn_size)
  
      pred_x = concatenate([out, query], axis=1)
      reshaped_pred_x = Reshape(
          (self.last_rnn_size * (self.long_num + 1),),
          name="reshape_pred_x",
      )(pred_x)
      nonlinear_pred = Dense(
          units=self.output_dim,
          kernel_initializer=TruncatedNormal(stddev=0.1),
          bias_initializer=Constant(0.1),
      )(reshaped_pred_x)
  
      # ------------ ar component ------------
      if self.ar_window > 0:
          ar_pred_x = Reshape(
              (self.ar_window * self.feature_num,), name="reshape_ar"
          )(short_input[:, -self.ar_window :])
          linear_pred = Dense(
              units=self.output_dim,
              kernel_initializer=TruncatedNormal(stddev=0.1),
              bias_initializer=Constant(0.1),
          )(ar_pred_x)
      else:
          linear_pred = 0
      y_pred = Add()([nonlinear_pred, linear_pred])
      self.model = Model(
          inputs=[long_input, short_input], outputs=y_pred
      )
      # lr decay
      # def lr_scheduler(epoch, r):
      #     max_lr = 0.03
      #     min_lr = 0.0001
      #     lr = min_lr + (max_lr - min_lr) * math.exp(-epoch / 60)
      #     return lr
      # callbacks = [tf.keras.callbacks.LearningRateScheduler(lr_scheduler, verbose=1)]
      # initial_lr = 0.003
      # rate = math.exp(-1 / 60)
      # lr_schedule = tf.keras.optimizers.schedules.ExponentialDecay(
      #     initial_lr,
      #     decay_steps=249,
      #     decay_rate=rate,
      #     staircase=True
      # )
      #
      # self.model.compile(loss="mae",
      #                    metrics=metrics,
      #                    optimizer=tf.keras.optimizers.Adam(learning_rate=lr_schedule))
  
      self.model.compile(
          loss=self.loss,
          metrics=[self.metric],
          optimizer=tf.keras.optimizers.Adam(lr=self.lr),
      )
  
      return self.model
  
imports: import pickle
  import numpy
  import time
  from tensorflow.keras.models import Model
  from tensorflow.keras.layers import *
  from tensorflow.keras.initializers import TruncatedNormal, Constant
  import tensorflow.keras.backend
  import tensorflow
  from bigdl.orca.automl.metrics import Evaluator
  from bigdl.orca.automl.model.abstract import BaseModel
label_desc: Use image node_id 4 for calling the MTNetKeras obj's underlying member method code with example usage: obj.build(config) and returns: self