code: def sdae(
      X_corrupted,
      layers,
      dropout_rate=0.0,
      act_fn="relu",
      seed=None,
      name="SDAE",
  ):
      fn = act_functions.get(act_fn, None)
      if fn is None:
          raise ValueError(
              "Invalid type of activation function {}\n"
              "Supported functions: {}".format(
                  act_fn, act_functions.keys()
              )
          )
  
      # Weight initialization
      L = len(layers)
      rng = get_rng(seed)
      weights, biases = [], []
      with tf.variable_scope(name):
          for i in range(L - 1):
              w = xavier_uniform(
                  (layers[i], layers[i + 1]), random_state=rng
              )
              weights.append(
                  tf.get_variable(
                      name="W_{}".format(i),
                      dtype=tf.float32,
                      initializer=tf.constant(w),
                  )
              )
              biases.append(
                  tf.get_variable(
                      name="b_{}".format(i),
                      dtype=tf.float32,
                      shape=(layers[i + 1]),
                      initializer=tf.zeros_initializer(),
                  )
              )
  
      # Construct the auto-encoder
      h_value = X_corrupted
      for i in range(L - 1):
          # The encoder
          if i <= int(L / 2) - 1:
              h_value = fn(
                  tf.add(tf.matmul(h_value, weights[i]), biases[i])
              )
          # The decoder
          elif i > int(L / 2) - 1:
              h_value = fn(
                  tf.add(tf.matmul(h_value, weights[i]), biases[i])
              )
          # The dropout for all the layers except the final one
          if i < (L - 2):
              h_value = tf.nn.dropout(h_value, rate=dropout_rate)
          # The encoder output value
          if i == int(L / 2) - 1:
              encoded_value = h_value
  
      sdae_value = h_value
  
      # L2 loss
      loss_w = tf.constant(0.0)
      for i in range(L - 1):
          loss_w = tf.add(
              loss_w,
              tf.nn.l2_loss(weights[i]) + tf.nn.l2_loss(biases[i]),
          )
  
      return sdae_value, encoded_value, loss_w
  
imports: import tensorflow.compat.v1
  from ...utils import get_rng
  from ...utils.init_utils import xavier_uniform
label_desc: Use image node_id 1 for calling a global function with example usage: sdae(X_corrupted, layers, dropout_rate, act_fn, seed, name) and returns: sdae_value,  encoded_value,  loss_w