import tensorflow as tf

        norm = adj.shape[0] * adj.shape[0] / float((adj.shape[0] * adj.shape[0]
                                                    - adj.sum()) * 2)
        with tf.name_scope('optimizer'):
            # Optimizer for Non-Variational Autoencoders
            if model_name in ('gcn_ae', 'linear_ae', 'deep_gcn_ae'):
                opt = OptimizerAE(preds = model.reconstructions,
                                  labels = tf.reshape(tf.sparse_tensor_to_dense(placeholders['adj_orig'],
                                                                                validate_indices = False), [-1]),
                                  pos_weight = pos_weight,
                                  norm = norm)
            # Optimizer for Variational Autoencoders
            elif model_name in ('gcn_vae', 'linear_vae', 'deep_gcn_vae'):
                opt = OptimizerVAE(preds = model.reconstructions,
                                   labels = tf.reshape(tf.sparse_tensor_to_dense(placeholders['adj_orig'],
                                                                                 validate_indices = False), [-1]),
                                   model = model,
                                   num_nodes = num_nodes,
                                   pos_weight = pos_weight,
                                   norm = norm)

        # Normalization and preprocessing on adjacency matrix
        adj_norm = preprocess_graph(adj)
        adj_label = sparse_to_tuple(adj + sp.eye(adj.shape[0]))

        # Initialize TF session
        sess = tf.Session()
