import tensorflow as tf

    residuals -- list containing the value of the residuals at predefinite training intervals. As we are only interested in the
                 sign of the residuals, we define it as the difference between the predicted output \hat{y} (an in the code)
                 and the training labels y (Y in the code).
    """

    ops.reset_default_graph()                      # reset the computational graph
    tf.set_random_seed(1)                          # to keep consistent results

    #----------training/test set features-------------------------

    X_tr = np.transpose(X_train)                    # the transpose is taken to adapt to TF convenntion. This is also
    f , m = X_tr.shape                              # f: number of features, m: number of training examples
