from deephyper.problem import HpProblem Problem = HpProblem() Problem.add_dim('units', (1, 100)) Problem.add_dim('activation', ['NA', 'relu', 'sigmoid', 'tanh']) Problem.add_dim('lr', (0.0001, 1.)) Problem.add_starting_point( units=10, activation='relu', lr=0.01) if __name__ == '__main__': print(Problem)
""" problem.py """ import ConfigSpace as cs from deephyper.problem import HpProblem Problem = HpProblem() # call signature: Problem.add_dim(name, value) Problem.add_dim('units1', (1, 64)) # int in range 1-64 Problem.add_dim('units2', (1, 64)) # int in range 1-64 Problem.add_dim('dropout1', (0.0, 1.0)) # float in range 0-1 Problem.add_dim('dropout2', (0.0, 1.0)) # float in range 0-1 Problem.add_dim('batch_size', (5, 500)) # int in range 5-500 Problem.add_dim('log10_learning_rate', (-5.0, 0.0)) # float lr range from 10^-5 to 1 # one of ['relu', ..., ] Problem.add_dim('activation', ['relu', 'elu', 'selu', 'tanh']) optimizer = Problem.add_dim('optimizer', [ 'Adam', 'RMSprop', 'SGD', 'Nadam', 'Adagrad' ]) # Only vary momentum if optimizer is SGD momentum = Problem.add_dim("momentum", (0.5, 0.9)) Problem.add_condition(cs.EqualsCondition(momentum, optimizer, "SGD")) # Add a starting point to try first Problem.add_starting_point( units1=16,
from deephyper.problem import HpProblem Problem = HpProblem() Problem.add_dim("lr", [1e-4, 5e-4, .001, .005, .01, .1]) Problem.add_dim("trade_off", [.01, .05, .1, .5, 1]) Problem.add_dim("cycle_length", [2, 4, 5, 8, 10]) Problem.add_dim("weight_decay", [1e-5, 1e-4, 1e-3, 5e-2, .01, .1]) Problem.add_starting_point(lr=1e-4, trade_off=.01, cycle_length=2, weight_decay = 1e-5) if __name__ == "__main__": print(Problem)
from deephyper.problem import HpProblem Problem = HpProblem() Problem.add_dim("lr", [1e-4, 5e-4, .001, .005, .01, .1]) Problem.add_dim("trade_off", [.01, .05, .1, .5, 1]) Problem.add_dim("intra_loss_coef", [.01, .05, .1, .5, 1]) Problem.add_dim("inter_loss_coef", [.01, .05, .1, .5, 1]) Problem.add_dim("em_loss_coef", [.01, .05, .1, .5, 1]) Problem.add_dim("cycle_length", [2, 4, 8, 10]) Problem.add_dim("weight_decay", [1e-4, 1e-3, 5e-2, .01, .1]) Problem.add_dim("ad_net_mult_lr", [.01, .05, .1, .5, .75, 1.1, 1.5]) Problem.add_dim("beta_1", [.7, .8, .9]) Problem.add_dim("beta_2", [.8, .9, .99]) Problem.add_starting_point(lr=1e-4, trade_off=.01, intra_loss_coef=.01, inter_loss_coef=.01, em_loss_coef=.01, cycle_length=2, \ weight_decay = 1e-4, ad_net_mult_lr = .01, beta_1 = .7, beta_2 = .8) if __name__ == "__main__": print(Problem)
from deephyper.problem import HpProblem Problem = HpProblem() Problem.add_dim("units", (1, 100)) Problem.add_dim("activation", [None, "relu", "sigmoid", "tanh"]) Problem.add_dim("lr", (0.0001, 1.0)) Problem.add_starting_point(units=10, activation=None, lr=0.01) if __name__ == "__main__": print(Problem)
from deephyper.problem import HpProblem Problem = HpProblem() Problem.add_dim("epochs", (5, 500)) Problem.add_dim("nunits_l1", (1, 1000)) Problem.add_dim("nunits_l2", (1, 1000)) Problem.add_dim("activation_l1", ["relu", "elu", "selu", "tanh"]) Problem.add_dim("activation_l2", ["relu", "elu", "selu", "tanh"]) Problem.add_dim("batch_size", (8, 1024)) Problem.add_dim("dropout_l1", (0.0, 1.0)) Problem.add_dim("dropout_l2", (0.0, 1.0)) Problem.add_starting_point( epochs=5, nunits_l1=1, nunits_l2=2, activation_l1="relu", activation_l2="relu", batch_size=8, dropout_l1=0.0, dropout_l2=0.0, ) if __name__ == "__main__": print(Problem)