def run_trial_test(spec_file, spec_name=False): spec = spec_util.get(spec_file, spec_name) spec = spec_util.override_test_spec(spec) spec_util.tick(spec, 'trial') trial = Trial(spec) trial_metrics = trial.run() assert isinstance(trial_metrics, dict)
def run_trial_test(spec_file, spec_name=False): spec = spec_util.get(spec_file, spec_name) spec = util.override_test_spec(spec) info_space = InfoSpace() info_space.tick('trial') trial = Trial(spec, info_space) trial_data = trial.run() assert isinstance(trial_data, pd.DataFrame)
def run_trial_test(spec_file, spec_name=False, distributed=False): spec = spec_util.get(spec_file, spec_name) spec = util.override_test_spec(spec) info_space = InfoSpace() info_space.tick('trial') if distributed: spec['meta']['distributed'] = True if os.environ.get('CI') != 'true': # CI has not enough CPU spec['meta']['max_session'] = 2 trial = Trial(spec, info_space) trial_data = trial.run() assert isinstance(trial_data, pd.DataFrame)
def generic_algo_test(spec, algo_name): '''Need new InfoSpace() per trial otherwise session id doesn't tick correctly''' trial = Trial(spec, info_space=InfoSpace()) trial_data = trial.run() folders = [x for x in os.listdir('data/') if x.startswith(algo_name)] assert len(folders) == 1 path = 'data/' + folders[0] sess_data = util.read(path + '/' + algo_name + '_t0_s0_session_df.csv') rewards = sess_data['0.2'].replace("reward", -1).astype(float) print(f'rewards: {rewards}') maxr = rewards.max() '''Delete test data folder and trial''' shutil.rmtree(path) del trial return maxr
def test_algo(spec_file, spec_name): spec = spec_util.get(spec_file, spec_name) spec = util.override_test_spec(spec) trial = Trial(spec) trial_data = trial.run()
def run_trial_test(spec_file, spec_name): spec = spec_util.get(spec_file, spec_name) spec = util.override_test_spec(spec) trial = Trial(spec) trial_data = trial.run() assert isinstance(trial_data, pd.DataFrame)
def test_base(spec_file, spec_name): spec = spec_util.get(spec_file, spec_name) spec['meta']['train_mode'] = True trial = Trial(spec) trial_data = trial.run()
def test_trial(test_spec): trial = Trial(test_spec) trial_data = trial.run() assert isinstance(trial_data, pd.DataFrame)
def test_trial(test_spec): spec_util.tick(test_spec, 'trial') spec_util.save(test_spec, unit='trial') trial = Trial(test_spec) trial_metrics = trial.run() assert isinstance(trial_metrics, dict)
def test_trial(test_spec, test_info_space): test_info_space.tick('trial') trial = Trial(test_spec, test_info_space) trial_data = trial.run() assert isinstance(trial_data, pd.DataFrame)
def test_trial(test_spec): trial = Trial(test_spec) trial_data = trial.run() # TODO trial data checker method assert isinstance(trial_data, pd.DataFrame)
def test_trial(test_spec, test_info_space): test_info_space.tick('trial') analysis.save_spec(test_spec, test_info_space, unit='trial') trial = Trial(test_spec, test_info_space) trial_data = trial.run() assert isinstance(trial_data, pd.DataFrame)