Esempio n. 1
0
 def search(self, specfile, specname):
     "runs train mode multiple times across the parameterized specs"
     logger.info(
         f'Running lab mode:search with specfile:{specfile} specname:{specname}'
     )
     spec = spec_util.get(specfile, specname)
     # assert 'spec_params' in spec
     param_specs = spec_util.get_param_specs(spec)
     search.run_param_specs(param_specs)
Esempio n. 2
0
def read_spec_and_run(spec_file, spec_name, lab_mode):
    '''Read a spec and run it in lab mode'''
    logger.info(f'Running lab spec_file:{spec_file} spec_name:{spec_name} in mode:{lab_mode}')
    if lab_mode in TRAIN_MODES:
        spec = spec_util.get(spec_file, spec_name)
    else:  # eval mode
        lab_mode, prename = lab_mode.split('@')
        spec = spec_util.get_eval_spec(spec_file, prename)

    if 'spec_params' not in spec:
        run_spec(spec, lab_mode)
    else:  # spec is parametrized; run them in parallel using ray
        param_specs = spec_util.get_param_specs(spec)
        search.run_param_specs(param_specs)
Esempio n. 3
0
def get_spec_and_run(spec_file, spec_name, lab_mode):
    '''Read a spec and run it in lab mode'''
    logger.info(f'Running lab spec_file:{spec_file} spec_name:{spec_name} in mode:{lab_mode}')
    if '@' in lab_mode:  # process lab_mode@{predir/prename}
        lab_mode, pre_ = lab_mode.split('@')
    else:
        pre_ = None
    spec = get_spec(spec_file, spec_name, lab_mode, pre_)

    if 'spec_params' not in spec:
        run_spec(spec, lab_mode)
    else:  # spec is parametrized; run them in parallel using ray
        param_specs = spec_util.get_param_specs(spec)
        search.run_param_specs(param_specs)