import tensorflow as tf

                                    features_nonzero)
        else:
            raise ValueError('Undefined model!')

        # Optimizer
        pos_weight = float(adj.shape[0] * adj.shape[0] - adj.sum()) / adj.sum()
        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)
