def retro_analyze_experiment(predir): '''Retro analyze an experiment''' logger.info('Running retro_analyze_experiment') trial_spec_paths = glob(f'{predir}/*_t*_spec.json') # remove trial and session spec paths experiment_spec_paths = ps.difference(glob(f'{predir}/*_spec.json'), trial_spec_paths) experiment_spec_path = experiment_spec_paths[0] spec = util.read(experiment_spec_path) info_prepath = spec['meta']['info_prepath'] if not os.path.exists(f'{info_prepath}_trial_data_dict.json'): return # only run analysis if experiment had been ran trial_data_dict = util.read(f'{info_prepath}_trial_data_dict.json') analysis.analyze_experiment(spec, trial_data_dict)
def retro_analyze_experiment(predir): '''Retro analyze an experiment''' logger.info('Running retro_analyze_experiment') if ps.is_empty(glob(f'{predir}/info/*_trial_data_dict.json')): logger.info( 'Skipping retro_analyze_experiment since no experiment was ran.') return # only run analysis if experiment had been ran trial_spec_paths = glob(f'{predir}/*_t*_spec.json') # remove trial and session spec paths experiment_spec_paths = ps.difference(glob(f'{predir}/*_spec.json'), trial_spec_paths) experiment_spec_path = experiment_spec_paths[0] spec = util.read(experiment_spec_path) info_prepath = spec['meta'].get('info_prepath') trial_data_dict = util.read(f'{info_prepath}_trial_data_dict.json') analysis.analyze_experiment(spec, trial_data_dict)
def run(self): for t in range(_.get(self.spec, 'meta.max_trial')): logger.debug(f'trial {t}') (self.trial_df_dict[t], self.trial_fitness_df_dict[t]) = self.init_trial().run() self.df, self.fitness_df = analysis.analyze_experiment(self) self.close() return self.df, self.fitness_df
def retro_analyze_experiment(predir): '''Retro-analyze all experiment level datas.''' logger.info('Retro-analyzing experiment from file') from slm_lab.experiment.control import Experiment _, _, _, spec_name, _, _ = util.prepath_split(predir) prepath = f'{predir}/{spec_name}' spec, info_space = util.prepath_to_spec_info_space(prepath) if 'search' not in spec: return experiment = Experiment(spec, info_space) experiment.trial_data_dict = trial_data_dict_from_file(predir) if not ps.is_empty(experiment.trial_data_dict): return analysis.analyze_experiment(experiment)
def run(self): self.trial_data_dict = self.search.run() self.data = analysis.analyze_experiment(self) self.close() return self.data
def run(self): trial_data_dict = search.run_ray_search(self.spec) experiment_df = analysis.analyze_experiment(self.spec, trial_data_dict) self.close() return experiment_df
def run(self): self.trial_data_dict = self.search.run() self.data = analysis.analyze_experiment(self) self.close() return self.data