def create_obj_func(params):
    if choice_default == 0:
        default_params = {
            'w_regular': 0.1,
            'rf_dim': 400,
            'step_size': 0.5,
            'x_kernel_width': 0.0001,
            'params_kernel_width': 15,
            'num_iters': 500,
            'num_samples_params': 100,
            'batch_size': 100,
            'freq_calc_metrics': 1,
        }
    else:
        default_params = {
            'cache_size': 50,
            'freq_update_full_model': 100,
            'num_epochs': 3,
        }
    default_params = resolve_conflict_params(params, default_params)
    # print('Default params:', default_params)

    learner = DualSVRG(
        **params,
        **default_params,
    )
    return learner
Пример #2
0
def create_obj_func(params):
    if choice_default == 0:
        default_params = {
            'w_regular': 0.1,
            'rf_dim': 400,
            'step_size': 0.5,
            'x_kernel_width': 0.0001,
            'params_kernel_width': 15,
            'num_iters': 500,
            'num_samples_params': 100,
            'batch_size': 100,
            'freq_calc_metrics': 1,
        }
    else:
        default_params = {
            'regular_param': 1e-2,
            'learning_rate_scale': 0.7,
            'gamma': 2.0,
            'rf_dim': 400,
            'num_epochs': 1,
            'cache_size': 50,
            'freq_update_full_model': 100,
            'oracle': 'coverage',
            'core_max': 100,
            'coverage_radius': 0.9,
            'loss_func': 'logistic',
            'smooth_hinge_theta': 0.5,
            'smooth_hinge_tau': 0.5,
            'batch_size': 200,
            'freq_calc_metrics': 300,
        }
    default_params = resolve_conflict_params(params, default_params)
    print('Default params:', default_params)

    learner = DualSVRG(
        **params,
        **default_params,
    )
    return learner