Exemplo n.º 1
0
 def __init__(self, train_len, trial):
     self.train_len = train_len
     experiment_dir = paths.experiment(constants.EXPERIMENT_PATH,
                                       'rand_prunable')
     train_len_dir = os.path.join(experiment_dir,
                                  'train{}'.format(train_len))
     self.output_dir = paths.trial(train_len_dir, trial)
 def __init__(self, trial):
   self.output_dir = paths.trial(paths.experiment(constants.EXPERIMENT_PATH, 'same_init'), trial)
def trial(trial_name):
  return paths.trial(EXPERIMENT_PATH, trial_name)
Exemplo n.º 4
0
                print(text.format(*counters))
        else:
            for trial in range(len(self.counters[self.print_order[0]])):
                print('Trial {}'.format(trial + 1))
                for text in self.print_order:
                    print(text.format(*self.counters[text][trial]))


avg_printer = AveragePrinter(len(sys.argv) > 2 and sys.argv[2] == '-a')
exp_path = paths.experiment(constants.EXPERIMENT_PATH, sys.argv[1])
trial_nums = [
    int(re.findall('\d+', trial_dir)[0]) for trial_dir in os.listdir(exp_path)
]
print("Found {} trials".format(max(trial_nums)))
for trial in range(1, max(trial_nums) + 1):
    trial_path = paths.trial(exp_path, trial)
    if not os.path.isdir(trial_path):
        print("Warning: skipping trial {}, does not exist".format(trial))
        continue

    first_run_path = paths.run(trial_path, 0)
    first_run_train_acc = float(
        subprocess.check_output(
            ['tail', '-n', '1',
             paths.log(first_run_path, 'train')]).strip().split(',')[-1])
    avg_printer.do_print(trial, '\tFirst run train acc: {}',
                         [first_run_train_acc])
    first_run_test_acc = float(
        subprocess.check_output(
            ['tail', '-n', '1',
             paths.log(first_run_path, 'test')]).strip().split(',')[-1])
 def __init__(self, trial):
     self.output_dir = paths.trial(
         paths.experiment(constants.EXPERIMENT_PATH,
                          'half_less_aggressive'), trial)
 def __init__(self, trial):
     self.output_dir = paths.trial(constants.EXPERIMENT_PATH, trial,
                                   'pruned_neurons')
 def __init__(self, trial):
   self.output_dir = paths.trial(paths.experiment(constants.EXPERIMENT_PATH, 'big_two_layer'), trial)