예제 #1
0
파일: finetune.py 프로젝트: nymwa/arteraro
def run():
    for n in make_index_list(load_config()):
        base_dir = Path(str(n)).resolve()
        base_dir.mkdir(exist_ok=True)
        script = TrainRunScript(n, base_dir)
        with open(base_dir / 'finetune.sh', 'w') as f:
            f.write(str(script))
예제 #2
0
파일: pretrain.py 프로젝트: nymwa/arteraro
def run():
    config = load_config()
    first_trial = 0
    for n in range(config['pretrain']['trials']):
        base_dir = Path(str(n)).resolve()
        base_dir.mkdir(exist_ok=True)
        script = PretrainDataRunScript(base_dir, n, first_trial)
        with open(base_dir / 'data.sh', 'w') as f:
            f.write(str(script))
    return first_trial
예제 #3
0
def run():
    for n in make_index_list(load_config()):
        base_dir = Path(str(n)).resolve()
        base_dir.mkdir(exist_ok=True)
        main_script = PretrainRunScript(n, base_dir)
        worker_script = WorkerRunScript(n, base_dir)
        with open(base_dir / 'pretrain.sh', 'w') as f:
            f.write(str(main_script))
        with open(base_dir / 'worker.sh', 'w') as f:
            f.write(str(worker_script))
예제 #4
0
파일: pretrain.py 프로젝트: nymwa/arteraro
def sub(first_trial):
    config = load_config()
    indices = [n for n in range(config['pretrain']['trials'])]
    if first_trial is not None:
        indices = [n for n in indices if n != first_trial]
        sub_script = DataSubScript([first_trial])
        with open('first_sub.sh', 'w') as f:
            f.write(str(sub_script))
    sub_script = DataSubScript(indices)
    with open('sub.sh', 'w') as f:
        f.write(str(sub_script))
예제 #5
0
def valid_rescore_errant_results(dataset):
    config = load_config()
    result_list = []
    for l in config['rescore']['lambda']:
        base_dir = make_ensemble_base_dir(dataset, 'valid')
        lmil = int(l * 1000)
        output = base_dir / 'result.{}.cat2'.format(lmil)
        if output.exists():
            result = ErrantCat2Result(None, None, output, l = l)
            result_list.append(result)
    return result_list
예제 #6
0
파일: result.py 프로젝트: nymwa/arteraro
def make_rescore_result_list(result_class, dataset, stage):
    config = load_config()
    result_list = []
    for l in config['rescore']['lambda']:
        base_dir = make_ensemble_base_dir(dataset, stage)
        lmil = int(l * 1000)
        output = base_dir / 'result.{}.res'.format(lmil)
        if output.exists():
            result = result_class(None, None, output, l=l)
            result_list.append(result)
    return result_list
예제 #7
0
파일: result.py 프로젝트: nymwa/arteraro
 def __init__(self, dataset, stage):
     self.config = load_config()
     self.dataset = dataset
     self.stage = stage
     self.make()
예제 #8
0
파일: script.py 프로젝트: nymwa/arteraro
 def __init__(self):
     super().__init__()
     self.config = load_config()
     self.header()
     self.make()