code: def create_encoder_layers2(
      x, net_dim=64, latent_dim=128, reuse=False
  ):
      with tf.variable_scope("encoder", reuse=tf.AUTO_REUSE):
          conv1 = tf.layers.conv2d(
              x,
              filters=net_dim,
              kernel_size=5,
              strides=(2, 2),
              padding="same",
              name="conv1",
          )
          normalized1 = tf.layers.batch_normalization(
              conv1, name="normalization1"
          )
  
          lrelu1 = tf.nn.leaky_relu(normalized1)
  
          conv2 = tf.layers.conv2d(
              lrelu1,
              filters=2 * net_dim,
              kernel_size=5,
              strides=(2, 2),
              padding="same",
              name="conv2",
          )
  
          normalized2 = tf.layers.batch_normalization(
              conv2, name="normalization2"
          )
          lrelu2 = tf.nn.leaky_relu(normalized2)
  
          conv3 = tf.layers.conv2d(
              lrelu2,
              filters=4 * net_dim,
              kernel_size=5,
              strides=(2, 2),
              padding="same",
              name="conv3",
          )
  
          normalized3 = tf.layers.batch_normalization(
              conv3, name="normalization3"
          )
          lrelu3 = tf.nn.leaky_relu(normalized3)
  
          reshaped = tf.reshape(lrelu3, [-1, 4 * 4 * 4 * net_dim])
  
          z = tf.contrib.layers.fully_connected(reshaped, latent_dim)
  
          return z
  
file_path: adversarial-robustness-toolbox/utils/resources/create_inverse_gan_models.py
imports: import logging
  import time
  import os
  import numpy
  import tensorflow
  from art.utils import load_mnist
label_desc: Use image node_id 3 for calling a global function with example usage: create_encoder_layers2(x, net_dim, latent_dim, reuse) and returns: z