Exemple #1
0
def experiment(balance_seed, split_num):
    logger = initialize_logger(this_script_name, balance_seed, other=split_num)
    for pct_usage in np.arange(0.1, 1.1, 0.1):
        pct_usage = round(pct_usage, 2)
        agent = RnnAgent(device,
                         logger,
                         'subj',
                         25,
                         num_epochs,
                         lr,
                         None,
                         'dev',
                         128,
                         pct_usage=pct_usage,
                         balance_seed=balance_seed,
                         split_num=split_num)
        agent.run()
        for geo in np.arange(0.1, 1.0, 0.1):
            geo = round(geo, 2)
            agent = RnnAgent(device,
                             logger,
                             'subj',
                             25,
                             num_epochs,
                             lr,
                             aug_mode,
                             'dev',
                             128,
                             pct_usage=pct_usage,
                             balance_seed=balance_seed,
                             split_num=split_num,
                             geo=geo)
            agent.run()
Exemple #2
0
def experiment(balance_seed, split_num):
	logger = initialize_logger(
		this_script_name, balance_seed, other=split_num)
	for small_prop in np.arange(0.1, 1.0, 0.1):
		small_prop = round(small_prop, 2)
		for small_label in [0, 1]:
			for undersample in [False, True]:
				agent = RnnAgent(device, logger, 'subj', 25, num_epochs, lr,
								 None, 'dev', 128, 
								 small_label=small_label, 
								 small_prop=small_prop, 
								 balance_seed=balance_seed,
								 split_num=split_num, 
								 undersample=undersample)
				agent.run()
			for geo in np.arange(0.1, 1.0, 0.1):
				geo = round(geo, 2)
				agent = RnnAgent(device, logger, 'subj', 25, num_epochs, lr,
								 aug_mode, 'dev', 128, 
								 small_label=small_label, 
								 small_prop=small_prop, 
								 balance_seed=balance_seed, 
								 split_num=split_num,
								 geo=geo)
				agent.run()
Exemple #3
0
def experiment(balance_seed, split_num):
    logger = initialize_logger(this_script_name, balance_seed, other=split_num)
    for small_prop in np.arange(0.2, 1.0, 0.2):
        small_prop = round(small_prop, 2)
        param_prop_map = param_map[small_prop]
        for small_label in [0, 1]:
            for undersample in [False, True]:
                if undersample:
                    num_epochs = param_prop_map['under']
                else:
                    num_epochs = param_prop_map['over']
                agent = RnnAgent(device,
                                 logger,
                                 'sfu',
                                 input_length,
                                 num_epochs,
                                 lr,
                                 None,
                                 'dev',
                                 128,
                                 small_label=small_label,
                                 small_prop=small_prop,
                                 balance_seed=balance_seed,
                                 split_num=split_num,
                                 undersample=undersample)
                agent.run()
            geo, num_epochs = param_prop_map['aug']
            geo = round(geo, 2)
            agent = RnnAgent(device,
                             logger,
                             'sfu',
                             input_length,
                             num_epochs,
                             lr,
                             aug_mode,
                             'dev',
                             128,
                             small_label=small_label,
                             small_prop=small_prop,
                             balance_seed=balance_seed,
                             split_num=split_num,
                             geo=geo)
            agent.run()
def experiment(balance_seed):
	logger = initialize_logger(this_script_name, balance_seed)
	for pct_usage in np.arange(0.1, 1.1, 0.1):
		pct_usage = round(pct_usage, 2)
		param_pct_map = param_map[pct_usage]

		geo, num_epochs = param_pct_map['aug']
		agent = RnnAgent(device, logger, 'sst', 25, num_epochs, lr,
						 'synonym', 'test', 128, 
						 pct_usage=pct_usage, 
						 balance_seed=balance_seed, 
						 geo=geo)
		agent.run()

		num_epochs = param_pct_map['no']
		agent = RnnAgent(device, logger, 'sst', 25, num_epochs, lr, 
						 None, 'test', 128, 
						 pct_usage=pct_usage, 
						 balance_seed=balance_seed)
		agent.run()
def experiment(balance_seed):
    logger = initialize_logger(this_script_name, balance_seed)
    for small_prop in np.arange(0.1, 1.0, 0.1):
        small_prop = round(small_prop, 2)
        param_prop_map = param_map[small_prop]
        for small_label in [0, 1]:
            geo, num_epochs = param_prop_map['aug']
            agent = RnnAgent(device,
                             logger,
                             'sst',
                             25,
                             num_epochs + 1,
                             lr,
                             'synonym',
                             'test',
                             128,
                             small_label=small_label,
                             small_prop=small_prop,
                             balance_seed=balance_seed,
                             geo=geo)
            agent.run()
            for undersample in [False, True]:
                if undersample:
                    num_epochs = param_prop_map['under']
                else:
                    num_epochs = param_prop_map['over']
                agent = RnnAgent(device,
                                 logger,
                                 'sst',
                                 25,
                                 num_epochs + 1,
                                 lr,
                                 None,
                                 'test',
                                 128,
                                 small_label=small_label,
                                 small_prop=small_prop,
                                 balance_seed=balance_seed,
                                 undersample=undersample)
                agent.run()
def experiment(balance_seed, split_num):
	logger = initialize_logger(
		this_script_name, balance_seed, other=split_num)
	for pct_usage in np.arange(0.2, 1.1, 0.2):
		pct_usage = round(pct_usage, 2)
		param_pct_map = param_map[pct_usage]

		num_epochs = param_pct_map['no']
		agent = RnnAgent(device, logger, 'sfu', input_length, num_epochs, lr,
						 None, 'dev', 128, 
						 pct_usage=pct_usage, 
						 balance_seed=balance_seed,
						 split_num=split_num)
		agent.run()
		geo, num_epochs = param_pct_map['aug']
		agent = RnnAgent(device, logger, 'sfu', input_length, num_epochs, lr,
						 aug_mode, 'dev', 128, 
						 pct_usage=pct_usage, 
						 balance_seed=balance_seed, 
						 split_num=split_num,
						 geo=geo)
		agent.run()
Exemple #7
0
        for geo in geos:
            agent = BiLSTMAgent(config, pct_usage, frac, geo)
            agent.run()


def estimate_optimal_epochs(pct_usage):
    '''
	Estimate optimal number of epochs for a pct_usage, 
	using midrange frac and geo parameters
	'''
    frac = 1 / 4
    geo = 0.5
    agent = BiLSTMAgent(config, pct_usage, frac, geo)
    agent.run()


def grid_search_pcts():
    percentages = ([0.02, 0.04, 0.06, 0.08] +
                   [round(0.1 * i, 2) for i in range(1, 11)])
    for pct_usage in percentages:
        grid_search(pct_usage)


if __name__ == "__main__":
    config = get_config()
    initialize_logger()

    grid_search(1)

    # agent = BiLSTMAgent(config, pct_usage)
    # agent.run()