def test_bohb(cs): bohb = BOHB(cs, train, maximal_iter, num_iter=iter_num, p=0.2, n_workers=n_work) bohb.set_restart() bohb.run() bohb.plot_statistics(method="BOHB-lenet") print(bohb.get_incumbent(5)) return bohb.get_incumbent(5)
def test_methods_mean_variance(cs): iterations = args.iter_c for i in range(1, 1 + iterations): weight = [1.0, 0.5, 0.25, 0.125, 0.125] bo = SMAC(cs, train, maximal_iter, num_iter=iter_num, n_workers=n_work) bo.run() bo.plot_statistics(method="BO-lenet-%d" % i) hyperband = Hyperband(cs, train, maximal_iter, num_iter=iter_num, n_workers=n_work) hyperband.set_restart() hyperband.run() hyperband.plot_statistics(method="HB-lenet-%d" % i) bohb = BOHB(cs, train, maximal_iter, num_iter=iter_num, p=0.2, n_workers=n_work) bohb.set_restart() bohb.run() bohb.plot_statistics(method="BOHB-lenet-%d" % i) xfhb = XFHB(cs, train, maximal_iter, num_iter=iter_num, n_workers=n_work, info_type='Weighted', init_weight=weight, random_mode=False) xfhb.set_restart() xfhb.run() xfhb.plot_statistics(method="XFHB-lenet-disable_w-%d" % i) xfhb = XFHB(cs, train, maximal_iter, num_iter=iter_num, n_workers=n_work, info_type='Weighted', update_enable=True, update_delta=1, init_weight=weight, random_mode=False) xfhb.set_restart() xfhb.run() xfhb.plot_statistics(method="XFHB-lenet-update_w-%d" % i)
def test_update_rule(cs): iterations = args.iter_c for i in range(1, 1 + iterations): high_start_w = [1.0, 0.9, 0.72, 0.504, 0.3024, 0.1512] low_start_w = [1.0, 0.6, 0.5, 0.4, 0.4] weight = [1.0, 0.5, 0.25, 0.125, 0.125] zero_start = [0.0, 0.0, 0.0, 0.0, 0.0] xfhb = XFHB(cs, train, maximal_iter, num_iter=iter_num, n_workers=n_work, info_type='Weighted', update_enable=True, update_delta=1, init_weight=weight, random_mode=False) xfhb.set_restart() xfhb.run() xfhb.plot_statistics(method="XFHB-lenet-update_w_random_f-%d" % i) xfhb = XFHB(cs, train, maximal_iter, num_iter=iter_num, n_workers=n_work, info_type='Weighted', update_enable=True, update_delta=1, init_weight=weight, random_mode=True) xfhb.set_restart() xfhb.run() xfhb.plot_statistics(method="XFHB-lenet-update_w_random_t-%d" % i) xfhb = XFHB(cs, train, maximal_iter, num_iter=iter_num, n_workers=n_work, info_type='Weighted', init_weight=weight) xfhb.set_restart() xfhb.run() xfhb.plot_statistics(method="XFHB-lenet-not_update_w-%d" % i) hyperband = Hyperband(cs, train, maximal_iter, num_iter=iter_num, n_workers=n_work) hyperband.set_restart() hyperband.run() hyperband.plot_statistics(method="HB-lenet-new-%d" % i) bohb = BOHB(cs, train, maximal_iter, num_iter=iter_num, p=0.2, n_workers=n_work) bohb.set_restart() bohb.run() bohb.plot_statistics(method="BOHB-lenet-new-%d" % i)