# Path: geepee/utils.py
# def unflatten_dict(params, params_args):
#     keys, indices, shapes = params_args[0], params_args[1], params_args[2]
#     vals = np.split(params, indices)
#     params_dict = {}
#     for i, key in enumerate(sorted(keys)):
#         params_dict[key] = np.reshape(vals[i], shapes[key])
#     return params_dict


import sys
import geepee.pep_models as pep
import math
import numpy as np
import time
import argparse
import os
from geepee.utils import unflatten_dict
from metrics import *
sys.path.append('../../../')
sys.path.append('../../utils/')

parser = argparse.ArgumentParser(description='run binary classification experiment',
            formatter_class=argparse.ArgumentDefaultsHelpFormatter)
parser.add_argument('-d', '--dataset',
            action="store", dest="dataset",
            help="dataset name, eg. boston, power", default="australian")
parser.add_argument('-m', '--pseudos', type=int,
            action="store", dest="n_pseudos",
            help="number of pseudo points, eg. 10", default=10)
parser.add_argument('-w', '--sweeps', type=int,
            action="store", dest="n_sweeps",
            help="number of EP sweeps, eg. 10", default=1)
parser.add_argument('-b', '--minibatch', type=int,
            action="store", dest="minibch_size",
            help="minibatch size, eg. 10", default=50)
parser.add_argument('-e', '--no_epochs', type=int,
            action="store", dest="no_epochs",
            help="number of epochs, eg. 100", default=100)
parser.add_argument('-s', '--seed', type=int,
            action="store", dest="random_seed",

# Path: geepee/utils.py
# def unflatten_dict(params, params_args):
#     keys, indices, shapes = params_args[0], params_args[1], params_args[2]
#     vals = np.split(params, indices)
#     params_dict = {}
#     for i, key in enumerate(sorted(keys)):
#         params_dict[key] = np.reshape(vals[i], shapes[key])
#     return params_dict


# Path: exps/gpc/pep/run_sparse_cla.py
import sys
import geepee.pep_models as pep
import math
import numpy as np
import time
import argparse
import os
from geepee.utils import unflatten_dict
from metrics import *

sys.path.append('../../../')
sys.path.append('../../utils/')

parser = argparse.ArgumentParser(description='run binary classification experiment',
            formatter_class=argparse.ArgumentDefaultsHelpFormatter)
parser.add_argument('-d', '--dataset',
            action="store", dest="dataset",
            help="dataset name, eg. boston, power", default="australian")
parser.add_argument('-m', '--pseudos', type=int,
            action="store", dest="n_pseudos",
            help="number of pseudo points, eg. 10", default=10)
parser.add_argument('-w', '--sweeps', type=int,
            action="store", dest="n_sweeps",
            help="number of EP sweeps, eg. 10", default=1)
parser.add_argument('-b', '--minibatch', type=int,
            action="store", dest="minibch_size",
            help="minibatch size, eg. 10", default=50)
parser.add_argument('-e', '--no_epochs', type=int,
            action="store", dest="no_epochs",
            help="number of epochs, eg. 100", default=100)
parser.add_argument('-s', '--seed', type=int,
            action="store", dest="random_seed",

            help="random seed, eg. 10", default=123)