from algos import OptAlg from models import LPMC_Full data_folder = '../../../data/' if __name__ == "__main__": if not os.path.exists('./results'): os.makedirs('./results') print("Train LPMC_Full_S with TR-ABS and hybrid") model = LPMC_Full(data_folder, file='12.csv') ioa = OptAlg(alg_type='TR-ABS', direction='hybrid') res = {'time': [], 'LL': [], 'epochs': []} for i in range(20): tmp = model.optimize(ioa, **{'verbose': False, 'max_epochs': 1000, 'batch': 1000}) res['time'].append(tmp['opti_time']) res['LL'].append(tmp['fun']) res['epochs'].append(tmp['nep']) with open('results/TR-ABS_hybrid.json', 'w') as outfile: json.dump(res, outfile) print("{}/20 done!".format(i+1))
from models import LPMC_RR data_folder = '../../../data/' if __name__ == "__main__": parameters = {''} if not os.path.exists('./results'): os.makedirs('./results') print("Testing parameters for LPMC_RR_L") model = LPMC_RR(data_folder, file='12_13_14.csv') ioa = OptAlg(alg_type='LS-ABS', direction='hybrid-inv') base_param = { 'perc_hybrid': 30, 'thresh_upd': 1, 'count_upd': 2, 'window': 10, 'factor_upd': 2 } main_params = {'verbose': False, 'max_epochs': 1000, 'batch': 1000} main_params.update(base_param) draws = 20 res = {}
from algos import OptAlg from models import LPMC_Full data_folder = '../../../data/' if __name__ == "__main__": if not os.path.exists('./results'): os.makedirs('./results') print("Train LPMC_Full_S with LS-ABS and bfgs-inv") model = LPMC_Full(data_folder, file='12.csv') ioa = OptAlg(alg_type='LS-ABS', direction='bfgs-inv') res = {'time': [], 'LL': [], 'epochs': []} for i in range(20): tmp = model.optimize(ioa, **{'verbose': False, 'max_epochs': 1000, 'batch': 1000}) res['time'].append(tmp['opti_time']) res['LL'].append(tmp['fun']) res['epochs'].append(tmp['nep']) with open('results/LS-ABS_bfgs-inv.json', 'w') as outfile: json.dump(res, outfile) print("{}/20 done!".format(i+1))
from algos import OptAlg from models import MTMC data_folder = '../../../data/' if __name__ == "__main__": if not os.path.exists('./results'): os.makedirs('./results') print("Train MTMC with TR and hess") model = MTMC(data_folder) ioa = OptAlg(alg_type='TR', direction='hess') res = {'time': [], 'LL': [], 'epochs': []} for i in range(20): tmp = model.optimize( ioa, **{ 'verbose': False, 'max_epochs': 1000, 'batch': 1000 }) res['time'].append(tmp['opti_time']) res['LL'].append(tmp['fun']) res['epochs'].append(tmp['nep'])
from algos import OptAlg from models import MTMC data_folder = '../../../data/' if __name__ == "__main__": if not os.path.exists('./results'): os.makedirs('./results') print("Train MTMC with LS and bfgs") model = MTMC(data_folder) ioa = OptAlg(alg_type='LS', direction='bfgs') res = {'time': [], 'LL': [], 'epochs': []} for i in range(20): tmp = model.optimize( ioa, **{ 'verbose': False, 'max_epochs': 1000, 'batch': 1000 }) res['time'].append(tmp['opti_time']) res['LL'].append(tmp['fun']) res['epochs'].append(tmp['nep'])
from algos import OptAlg from models import LPMC_RR data_folder = '../../../data/' if __name__ == "__main__": if not os.path.exists('./results'): os.makedirs('./results') print("Train LPMC_RR_L with LS-ABS and hess") model = LPMC_RR(data_folder, file='12_13_14.csv') ioa = OptAlg(alg_type='LS-ABS', direction='hess') res = {'time': [], 'LL': [], 'epochs': []} for i in range(20): tmp = model.optimize(ioa, **{'verbose': False, 'max_epochs': 1000, 'batch': 1000}) res['time'].append(tmp['opti_time']) res['LL'].append(tmp['fun']) res['epochs'].append(tmp['nep']) with open('results/LS-ABS_hess.json', 'w') as outfile: json.dump(res, outfile) print("{}/20 done!".format(i+1))
from algos import OptAlg from models import LPMC_Full data_folder = '../../../data/' if __name__ == "__main__": if not os.path.exists('./results'): os.makedirs('./results') print("Train LPMC_Full_S with TR-ABS and bfgs") model = LPMC_Full(data_folder, file='12.csv') ioa = OptAlg(alg_type='TR-ABS', direction='bfgs') res = {'time': [], 'LL': [], 'epochs': []} for i in range(20): tmp = model.optimize( ioa, **{ 'verbose': False, 'max_epochs': 1000, 'batch': 1000 }) res['time'].append(tmp['opti_time']) res['LL'].append(tmp['fun']) res['epochs'].append(tmp['nep'])
from algos import OptAlg from models import LPMC_RR data_folder = '../../../data/' if __name__ == "__main__": if not os.path.exists('./results'): os.makedirs('./results') print("Train LPMC_RR_L with LS and grad") model = LPMC_RR(data_folder, file='12_13_14.csv') ioa = OptAlg(alg_type='LS', direction='grad') res = {'time': [], 'LL': [], 'epochs': []} for i in range(20): tmp = model.optimize(ioa, **{'verbose': False, 'max_epochs': 1000, 'batch': 1000}) res['time'].append(tmp['opti_time']) res['LL'].append(tmp['fun']) res['epochs'].append(tmp['nep']) with open('results/LS_grad.json', 'w') as outfile: json.dump(res, outfile) print("{}/20 done!".format(i+1))