def update(): opt.dataset_root = '/media/data/kukleva/lab/YTInstructions' opt.data = os.path.join(opt.dataset_root, 'VISION_txt') opt.gt = os.path.join(opt.data, opt.gt) opt.ext = 'txt' opt.feature_dim = 3000 opt.bg = True opt.zeros = True update_opt_str() logger = path_logger() vars_iter = list(vars(opt)) for arg in sorted(vars_iter): logger.debug('%s: %s' % (arg, getattr(opt, arg)))
def all_actions(): return_stat_all = None if opt.dataset == 'bf': actions = ['coffee', 'cereals', 'tea', 'milk', 'juice', 'sandwich', 'scrambledegg', 'friedegg', 'salat', 'pancake'] if opt.dataset == 'yti': actions = ['changing_tire', 'coffee', 'jump_car', 'cpr', 'repot'] lr_init = opt.lr for action in actions: opt.subaction = action if not opt.resume: opt.lr = lr_init update_opt_str() if opt.viterbi: return_stat_single = baseline(iterations=1) else: return_stat_single = baseline(iterations=7) return_stat_all = join_return_stat(return_stat_all, return_stat_single) parse_return_stat(return_stat_all)
def update(): opt.dataset_root = '/media/data/kukleva/lab/Breakfast' data_subfolder = [ 'feat/kinetics', 'feat/data', 'feat/s1', 'feat/video', opt.data ][opt.data_type] opt.data = os.path.join(opt.dataset_root, data_subfolder) opt.gt = os.path.join(opt.data, opt.gt) opt.ext = ['gz', 'gz', 'txt', 'avi', opt.ext][opt.data_type] opt.feature_dim = [400, 64, 64, 0, opt.feature_dim][opt.data_type] opt.bg = False opt.zeros = False update_opt_str() logger = path_logger() vars_iter = list(vars(opt)) for arg in sorted(vars_iter): logger.debug('%s: %s' % (arg, getattr(opt, arg)))
def logger_setup(): update_opt_str() path_logger()
def grid_search(f): epochs = [30, 60, 90] dims = [20, 30, 40] lrs = [1e-2, 1e-3, 1e-4] # for epoch, dim, lr in grid: grid = [[30, 20, 1e-3], [30, 30, 1e-3], [30, 40, 1e-3]] radius = [1.0, 1.5, 2.0] epochs = [5, 10, 20] dims = [20, 50, 100, 200] # for r in radius: # for epoch in epochs: # for dim in dims: # opt.bg_trh = r # logger.debug('\n\nSET: radius: %.1e dim: %d epochs: %d\n' % # (r, dim, epoch)) # weights = [10.0, 20.0] # bg_trh = [1, 1.5, 2] # concats = [3, 9] # dims = [40, 80] # epochs = [30, 60] # # for concat in concats: # for epoch in epochs: # for dim in dims: grid = [[40, 90, 1e-2], [20, 90, 1e-4], [30, 90, 1e-4], [40, 90, 1e-4]] epochs = [30, 60, 90] dims = [20, 30, 40] # lrs = [1e-3, 1e-2, 1e-4] lrs = [1e-5] # resume_template = 'grid.vit._%s_mlp_!pose_full_vae1_time10.0_epochs%d_embed%d_n2_ordering_gmm1_one_!gt_lr%s_lr_zeros_b0_v1_l0_c1_' resume_template = 'fixed.order._%s_mlp_!pose_full_vae0_time10.0_epochs%d_embed%d_n1_!ordering_gmm1_one_!gt_lr%s_lr_zeros_b0_v1_l0_c1_' # for dim, epoch, lr in grid: for epoch in epochs: for lr in lrs: for dim in dims: opt.embed_dim = dim opt.epochs = epoch # opt.concat = concat opt.lr = lr # opt.time_weight = w # opt.bg_trh = w # opt.resume_str = resume_template % (opt.subaction, epoch, dim, str(lr)) logger.debug('\n\nSET: dim: %d epochs: %d, lr: %.1e\n' % (dim, epoch, lr)) update_opt_str() for arg in vars(opt): logger.debug('%s: %s' % (arg, getattr(opt, arg))) f()