コード例 #1
0
ファイル: main_steps.py プロジェクト: nevrez/CNN_randRNN
def get_save_depth_params():
    parser = get_initial_parser()
    params = parser.parse_args()
    params.net_model = 'all'
    params.proceed_step = RunSteps.COLORIZED_DEPTH_SAVE
    params = init_save_dirs(params)
    return params
コード例 #2
0
def get_finetuned_extraction_params():
    parser = get_initial_parser()
    parser.add_argument("--batch-size", dest="batch_size", default=64, type=int)
    parser.add_argument("--split-no", dest="split_no", default=1, type=int, choices=range(1, 11), help="Split number")
    params = parser.parse_args()
    params.proceed_step = RunSteps.FINE_EXTRACTION
    return params
コード例 #3
0
ファイル: main_steps.py プロジェクト: nevrez/CNN_randRNN
def get_recursive_params(proceed_step):
    parser = get_initial_parser()
    parser.add_argument("--split-no",
                        dest="split_no",
                        default=1,
                        type=int,
                        choices=range(1, 11),
                        help="Split number")
    parser.add_argument("--num-rnn",
                        dest="num_rnn",
                        default=128,
                        type=int,
                        help="Number of RNN")
    parser.add_argument("--save-features",
                        dest="save_features",
                        default=0,
                        type=int,
                        choices=[0, 1])
    parser.add_argument("--batch-size",
                        dest="batch_size",
                        default=1000,
                        type=int)
    parser.add_argument(
        "--trial",
        dest="trial",
        default=0,
        type=int,
        help=
        "Trial number is for running the same model with the same params for evaluation "
        "the effect of randomness.")
    parser.add_argument(
        "--reuse-randoms",
        dest="reuse_randoms",
        default=1,
        choices=[0, 1],
        type=int,
        help="Handles whether the random weights are gonna save/load or not")
    parser.add_argument("--fusion-levels",
                        dest="fusion_levels",
                        default=0,
                        choices=[0, 1],
                        type=int,
                        help="Handles whether fusion is performed")
    parser.add_argument("--load-features",
                        dest="load_features",
                        default=0,
                        type=int,
                        choices=[0, 1])
    parser.add_argument("--pooling",
                        dest="pooling",
                        default=Pools.RANDOM,
                        choices=Pools.ALL,
                        type=str.lower,
                        help="Pooling type")
    params = parser.parse_args()
    params.proceed_step = proceed_step
    return params
コード例 #4
0
ファイル: main_steps.py プロジェクト: nevrez/CNN_randRNN
def get_extraction_params():
    parser = get_initial_parser()
    parser.add_argument("--batch-size",
                        dest="batch_size",
                        default=64,
                        type=int)
    params = parser.parse_args()
    params.proceed_step = RunSteps.FIX_EXTRACTION
    return params
コード例 #5
0
def get_finetune_params():
    parser = get_initial_parser()
    parser.add_argument("--split-no", dest="split_no", default=1, type=int, choices=range(1, 11), help="Split number")
    parser.add_argument("--batch-size", dest="batch_size", default=16, type=int)
    parser.add_argument("--lr", dest="lr", default=0.0001, type=float, help='Initial learning rate')
    parser.add_argument("--momentum", dest="momentum", default=0.95, type=float, help='Momentum rate')
    parser.add_argument("--step-size", dest="step_size", default=10, type=int,
                        help='Number of epoch for each learning rate decay')
    parser.add_argument("--gamma", dest="gamma", default=0.1, type=float, help="Factor rate of learning rate decay")
    parser.add_argument("--num-epochs", dest="num_epochs", default=40, type=int)
    parser.add_argument("--trial", dest="trial", default=0, type=int,
                        help="Trial number is used to run the same model with the same params to evaluate "
                             "the effect of randomness.")
    params = parser.parse_args()
    params.proceed_step = RunSteps.FINE_TUNING
    return params
コード例 #6
0
def save_sunrgbd_scene():
    parser = get_initial_parser()
    params = parser.parse_args()
    params.debug_mode = 0
    params.dataset_path = "../data/sunrgbd/"
    if params.data_type == DataTypes.RGB:
        params.data_type = DataTypesSUNRGBD.RGB
    elif params.data_type == DataTypes.Depth:
        params.data_type = DataTypesSUNRGBD.Depth
    else:
        print('{}{}The parameter {}--data-type{} should be {} RGB or Depth{}!{}'.
              format(PrForm.BOLD, PrForm.RED, PrForm.BLUE, PrForm.RED, PrForm.GREEN, PrForm.RED, PrForm.END_FORMAT))
        return
    params.proceed_step = RunSteps.SAVE_SUNRGBD
    logfile_name = params.log_dir + '/' + params.proceed_step + '/' + params.data_type + '_save.log'
    init_logger(logfile_name, params)
    process_dataset_save(params)