Beispiel #1
0
def launch_hyperparameter_scan(hyperparameter_input_csv, hyperparameter_output_log, generate_input, job_chunk_size, interest_cols, categorical, reset_all, torque, gpu, gpu_node, nohup, n_jobs_relaunch, crossover_p, model_complexity_factor,n_jobs, val_loss_column, add_softmax, additional_command, cuda, hyperparameter_yaml, randomseed, additional_opts, max_epochs):
	"""Run randomized hyperparameter scan of neural network hyperparameters."""
	from methylnet.hyperparameter_scans import coarse_scan, find_top_jobs
	custom_jobs=[]
	if n_jobs_relaunch:
		custom_jobs=find_top_jobs(hyperparameter_input_csv, hyperparameter_output_log,n_jobs_relaunch, crossover_p, val_loss_column)
	if os.path.exists(hyperparameter_yaml):
		from ruamel.yaml import safe_load as load
		with open(hyperparameter_yaml) as f:
			new_grid = load(f.read())
	else:
		new_grid = {}
	coarse_scan(hyperparameter_input_csv, hyperparameter_output_log, generate_input, job_chunk_size, interest_cols, reset_all, torque, gpu, gpu_node, nohup, mlp=True, custom_jobs=custom_jobs, model_complexity_factor=model_complexity_factor,n_jobs=n_jobs, categorical=categorical,add_softmax=add_softmax, additional_command=additional_command, cuda=cuda, new_grid=new_grid, randomseed=randomseed, additional_opts=additional_opts, max_epochs=max_epochs)
Beispiel #2
0
def launch_hyperparameter_scan(
        hyperparameter_input_csv, hyperparameter_output_log, generate_input,
        job_chunk_size, stratify_column, reset_all, torque, gpu, gpu_node,
        nohup, model_complexity_factor, set_beta, n_jobs, n_jobs_relaunch,
        crossover_p, val_loss_column, additional_command, cuda,
        hyperparameter_yaml, randomseed, additional_opts, max_epochs):
    """Launch randomized grid search of neural network hyperparameters."""
    from methylnet.hyperparameter_scans import coarse_scan, find_top_jobs
    custom_jobs = []
    if n_jobs_relaunch:
        custom_jobs = find_top_jobs(hyperparameter_input_csv,
                                    hyperparameter_output_log, n_jobs_relaunch,
                                    crossover_p, val_loss_column)
    if os.path.exists(hyperparameter_yaml):
        from ruamel.yaml import safe_load as load
        with open(hyperparameter_yaml) as f:
            new_grid = load(f)
        #print(new_grid)
    else:
        new_grid = {}
    coarse_scan(hyperparameter_input_csv,
                hyperparameter_output_log,
                generate_input,
                job_chunk_size,
                stratify_column,
                reset_all,
                torque,
                gpu,
                gpu_node,
                nohup,
                mlp=False,
                model_complexity_factor=model_complexity_factor,
                set_beta=set_beta,
                n_jobs=n_jobs,
                custom_jobs=custom_jobs,
                additional_command=additional_command,
                cuda=cuda,
                new_grid=new_grid,
                randomseed=randomseed,
                additional_opts=additional_opts,
                max_epochs=max_epochs)