def test_fixed_knobs(self, budget): knob_config = { 'fixed': FixedKnob('fixed'), 'fixed2': FixedKnob(2), 'early_stop': PolicyKnob('EARLY_STOP') } advisor = make_advisor(knob_config, budget) assert isinstance(advisor, FixedAdvisor)
def get_knob_config(): return { 'epochs': FixedKnob(2), 'hidden_layer_count': IntegerKnob(1, 2), 'hidden_layer_units': IntegerKnob(2, 128), 'learning_rate': FloatKnob(1e-5, 1e-1, is_exp=True), 'batch_size': CategoricalKnob([16, 32, 64, 128]), 'image_size': FixedKnob(32) }
def get_knob_config(): return { 'max_epochs': FixedKnob(10), 'learning_rate': FloatKnob(1e-5, 1e-2, is_exp=True), 'batch_size': CategoricalKnob([16, 32, 64, 128]), 'max_image_size': CategoricalKnob([32, 64, 128, 224]), }
def get_knob_config(): return { 'int': IntegerKnob(1, 32), 'float': FloatKnob(1e-5, 1), 'cat': CategoricalKnob(['a', 'b', 'c']), 'fixed': FixedKnob('fixed') }
def get_knob_config(): return { 'trial_epochs': FixedKnob(300), 'lr': FloatKnob(1e-4, 1, is_exp=True), 'lr_decay': FloatKnob(1e-3, 1e-1, is_exp=True), 'opt_momentum': FloatKnob(0.7, 1, is_exp=True), 'opt_weight_decay': FloatKnob(1e-5, 1e-3, is_exp=True), 'batch_size': CategoricalKnob([32, 64, 128]), 'drop_rate': FloatKnob(0, 0.4), 'max_image_size': FixedKnob(32), 'share_params': PolicyKnob('SHARE_PARAMS'), # Affects whether training is shortened by using early stopping 'quick_train': PolicyKnob('EARLY_STOP'), 'early_stop_train_val_samples': FixedKnob(1024), 'early_stop_patience_epochs': FixedKnob(5) }
def get_knob_config(): return { 'max_iter': FixedKnob(20), 'kernel': CategoricalKnob(['rbf', 'linear', 'poly']), 'gamma': CategoricalKnob(['scale', 'auto']), 'C': FloatKnob(1e-4, 1e4, is_exp=True), 'max_image_size': CategoricalKnob([16, 32]) }
def get_knob_config(): return { 'epochs': FixedKnob(10), 'word_embed_dims': IntegerKnob(16, 128), 'word_rnn_hidden_size': IntegerKnob(16, 128), 'word_dropout': FloatKnob(1e-3, 2e-1, is_exp=True), 'learning_rate': FloatKnob(1e-2, 1e-1, is_exp=True), 'batch_size': CategoricalKnob([16, 32, 64, 128]), }
def get_knob_config(): return { 'max_epochs': FixedKnob(10), 'hidden_layer_count': IntegerKnob(1, 2), 'hidden_layer_units': IntegerKnob(2, 128), 'learning_rate': FloatKnob(1e-5, 1e-1, is_exp=True), 'batch_size': CategoricalKnob([16, 32, 64, 128]), 'max_image_size': CategoricalKnob([16, 32, 48]), 'quick_train': PolicyKnob('EARLY_STOP') # Whether early stopping would be used }
def test_arch_knob_without_budget(self, budget, arch_knob): knob_config = { 'arch': arch_knob, 'fixed': FixedKnob('fixed'), 'downscale': PolicyKnob('DOWNSCALE'), 'early_stop': PolicyKnob('EARLY_STOP'), 'skip_train': PolicyKnob('SKIP_TRAIN'), 'quick_eval': PolicyKnob('QUICK_EVAL') } advisor = make_advisor(knob_config, budget) assert isinstance(advisor, RandomAdvisor)
def test_arch_knob_with_enas_policies(self, day_budget, arch_knob): knob_config = { 'arch': arch_knob, 'fixed': FixedKnob('fixed'), 'share_params': PolicyKnob('SHARE_PARAMS'), 'downscale': PolicyKnob('DOWNSCALE'), 'early_stop': PolicyKnob('EARLY_STOP'), 'skip_train': PolicyKnob('SKIP_TRAIN'), 'quick_eval': PolicyKnob('QUICK_EVAL') } advisor = make_advisor(knob_config, day_budget) assert isinstance(advisor, EnasAdvisor)