Ejemplo n.º 1
0
config = {
    'layout': [layer_1, layer_2],
    'weight_type': 'binary',
    'act_func_names': ['bs', 'bs'],
    'act_func_params': [[], []],
    'bias_vals': [None, None, None],
    'keep_probs': [keep_probs1, keep_probs2, keep_probs2],
    'flat_factor': [1., 1., 1.],
    'act_noise': [0., 0., 0.],
    'prior_value': 0.85,
    'sampling_sequence': 'stochastic'
}

va_acc_list = []
va_ce_list = []
ens_acc_list = []
ens_ce_list = []
for run in range(n_runs):
    ens_acc, ens_ce, va_acc, va_ce = run_experiment(run_config, init_config,
                                                    config, 'mnist_basic')
    va_acc_list.append(va_acc)
    va_ce_list.append(va_ce)
    ens_acc_list.append(ens_acc)
    ens_ce_list.append(ens_ce)

print_stats('Mod Accuracy', va_acc_list)
print_stats('Ens Accuracy', ens_acc_list)
print_stats('Mod CE', va_ce_list)
print_stats('Ens CE', ens_ce_list)
Ejemplo n.º 2
0
              'store_method': 'both',
              'burn_in': 15,
              'thinning': 5,
              'path': path}

act_func1 = get_activation_function('bs')
act_func2 = get_activation_function('bs')

act_func1.set_params([])
act_func2.set_params([])
act_funcs = [act_func1, act_func2]
layer_1 = 200# + 20 * int(task_id / 2)
layer_2 = 200# + 40 * int(task_id % 2)
keep_probs1 = 1.#.5 + (0.2 * int(task_id / 2))
keep_probs2 = 1.#.7 + (0.2 * int(task_id % 2))


config = {'layout': [layer_1, layer_2],
          'weight_type': 'binary',
          'act_funcs': act_funcs,
          'bias_vals': [None, None, None],
          'keep_probs': [keep_probs1, keep_probs2, keep_probs2],
          'flat_factor': [1., 1., 1.],
          'act_noise': [0., 0., 0.],
          'prior_value': 0.7,
          'sampling_sequence': 'stochastic'}

run_experiment(run_config, init_config, config, 'mnist_basic')