import tensorflow as tf

    elif actL == 'esp' or actL == 'relu': #r2 score

         norm= tf.reduce_mean( tf.squared_difference(Y,tf.reduce_mean(Y)) )
         accuracy = 1 - tf.divide( tf.reduce_mean(tf.squared_difference(an, Y)), norm)

    elif actL == 'softmax': #accuracy score for multiclass classification

         Yp = tf.sigmoid(betan*hn)
         correct = tf.equal(tf.argmax(Yp), tf.argmax(Y))
         accuracy= tf.reduce_mean(tf.cast(correct, "float"))

    #-----------------Initialize the graph and start the session-------------------------------------------------

    init = tf.global_variables_initializer()

    with tf.Session() as sess:

        # Run the initialization
        sess.run(init)
        jj=0

        for epoch in range(num_iterations):

            _ , epoch_cost, epoch_grad, epoch_acc_train = sess.run([min, cost, grads_var, accuracy], feed_dict={X: X_tr, Y: Y_tr})

            # Print the cost every interval epoch (here uses the inhomogenous interval but you can change it)
            if  jj< e_len and epoch % epoch_sample[jj] == 0:
            #if  epoch % 50 == 0:

                print("Epoch %i, Cost: %f, Train accuracy: %f" % (epoch, epoch_cost,epoch_acc_train))
