def get_trial_instance_manager(experiment_config: dict): """Returns an instance of TrialInstanceManager for |experiment_config|.""" if not db_utils.query(models.Experiment).filter( models.Experiment.name == experiment_config['experiment']).first(): create_experiments(experiment_config) default_num_trials = 100 return scheduler.TrialInstanceManager(default_num_trials, experiment_config)
def get_trial_instance_manager(experiment_config: dict): """Returns an instance of TrialInstanceManager for |experiment_config|.""" with db_utils.session_scope() as session: experiment_exists = bool( session.query(models.Experiment).filter( models.Experiment.name == experiment_config['experiment']).first()) if not experiment_exists: create_experiments(experiment_config) default_num_trials = 100 return scheduler.TrialInstanceManager(default_num_trials, experiment_config)