return eer


if __name__ == '__main__':
    # Determine path to configuration file. This path manipulation is
    # here so that the script will run successfully regardless of the
    # current working directory.
    local_dir = os.path.dirname(__file__)
    config_path = os.path.join(local_dir, 'neat.cfg')

    train_loader = ASVDatasetshort(None, do_lfcc=True, index_list=index_train,
                                   do_standardize=True)
    test_loader = ASVDataset(None, is_train=False, is_eval=False, index_list=index_test,
                             do_lfcc=True, do_standardize=True)

    winner, config, stats = run(config_path, n_generation, train_loader, spoofed_class)
    make_visualize(winner, config, stats)

    winner_net = neat.nn.RecurrentNetwork.create(winner, config)

    train_eer = evaluate(winner_net, train_loader)
    eer = evaluate(winner_net, test_loader)

    print("\n")
    print("**** training equal error rate = {}  ****".format(train_eer))

    print("\n")
    print("**** equal error rate = {}  ****".format(eer))

    pickle.dump(winner, open('best_genome_eoc_class_2_lfcc', 'wb'))
                                         use_gate=USE_GATE,
                                         loading_bar=False)
        dev_eer_list.append(eer)
        dev_accuracy_list.append(accuracy)

        eer, accuracy = evaluate_eer_acc(winner,
                                         config,
                                         evalloader,
                                         backprop=backprop,
                                         use_gate=USE_GATE,
                                         loading_bar=False)
        eval_eer_list.append(eer)
        eval_accuracy_list.append(accuracy)

        if i == 0:
            make_visualize(winner, config, stats, topology=False)

    print("\n")
    print("DEV equal error rate", dev_eer_list)
    print("accuracy", dev_accuracy_list)

    print("\n")

    array_eer = np.array(dev_eer_list)

    print("DEV EER stats")
    print("min =", array_eer.min())
    print("max =", array_eer.max())
    print("median =", np.median(array_eer))
    print("average =", array_eer.mean())
    print("std =", array_eer.std())