code: def create_tf_model(
      compress_rate,
      input_dim,
      optimizer="adadelta",
      loss="binary_crossentropy",
      lr=0.001,
  ):
      from tensorflow.keras.layers import Input, Dense
      from tensorflow.keras.models import Model
      from tensorflow.keras import backend
  
      inp = Input(shape=(input_dim,))
      encoded = Dense(
          int(compress_rate * input_dim), activation="relu"
      )(inp)
      decoded = Dense(input_dim, activation="sigmoid")(encoded)
      autoencoder = Model(inp, decoded)
      autoencoder.compile(optimizer=optimizer, loss=loss)
      backend.set_value(autoencoder.optimizer.learning_rate, lr)
      return autoencoder
  
file_path: analytics-zoo/pyzoo/zoo/chronos/detector/anomaly/ae_detector.py
imports: from zoo.chronos.detector.anomaly.abstract import AnomalyDetector
  from zoo.chronos.detector.anomaly.util import roll_arr, scale_arr
  import numpy
label_desc: Use image node_id 1 for calling a global function with example usage: create_tf_model(compress_rate, input_dim, optimizer, loss, lr) and returns: autoencoder