def plot_per_experiment():
    for filename in glob.glob('*all_model*'):
        with open(filename, 'rb') as f:
            results = cPickle.load(f)
        results.pop(0)  # Remove params

        dnn_relu_models = results[0:10]
        dnn_sigmoid_models = results[10:20]
        dnn_tanh_models = results[20:30]
        gdbn_models = results[30:40]
        dbn_models = results[40:50]

        plt.figure(filename)
        plt.ylabel('Accuracy (m)', fontsize=40)
        plt.xlabel('Layers', fontsize=40)
        plt.grid(True)
        plt.tick_params(axis='both', which='major', labelsize=20)
        plt.xticks(range(0, 15, 1))
        plt.xlim([0, 10])
        plt.ylim([0, 9])

        plt.plot(get_metrics(results=dnn_relu_models), label='DNN Relu', linewidth=5.0)
        plt.plot(get_metrics(results=dnn_sigmoid_models), label='DNN Sigmoid', linewidth=5.0)
        plt.plot(get_metrics(results=dnn_tanh_models), label='DNN Tanh', linewidth=5.0)
        plt.plot(get_metrics(results=gdbn_models), label='GR-DBN', linewidth=5.0)
        plt.plot(get_metrics(results=dbn_models), label='DBN', linewidth=5.0)
        plt.legend(fontsize='x-large')
    plt.show()
def get_latex_table():
    with open('traditional_algorithms_sklearn_seed_5', 'rb') as f:
        results = cPickle.load(f)
        results.pop(0)  # Remove params

    with open('all_models_with_out_noise_neither_dropout_theano_seed_5', 'rb') as f:
        deep_results = cPickle.load(f)

    results.append(deep_results[8])
    results.append(deep_results[18])
    results.append(deep_results[28])
    results.append(deep_results[38])
    results.append(deep_results[48])

    get_metrics(results=results, latex=True)
def plot_all_experiments():
    plt.figure("Depth experiement")
    plt.ylabel('Accuracy (m)', fontsize=30)
    plt.xlabel('Layers', fontsize=30)
    plt.ylim([0, 10])
    plt.yticks(range(0, 11))
    plt.grid(True)
    plt.tick_params(axis='both', which='major', labelsize=20)
    for filename in glob.glob('*seed*'):
        with open(filename, 'rb') as f:
            results = cPickle.load(f)
        results.pop(0)  # Remove params

        lst_error = get_metrics(
            results=results
        )
        plt.plot(lst_error, label=filename, linewidth=5.0)
    plt.legend(fontsize='large')
    plt.show()