from deephyper.benchmark 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)
from deephyper.benchmark import HpProblem # import os # import sys # sys.path.append(os.path.dirname(os.path.dirname(os.path.abspath(__file__)))) from torch_wrapper import use_knl # noqa Problem = HpProblem() Problem.add_dim("batch_size", (1, 32)) Problem.add_dim("image_size", [32]) Problem.add_dim("conv1_in_chan", [3]) Problem.add_dim("conv1_out_chan", (3, 64)) Problem.add_dim("conv1_kern", (3, 8)) # Problem.add_dim("pool_size", [2]) hp = Problem.add_dim("pool_size", [2]) print(hp) Problem.add_dim("conv2_out_chan", (3, 64)) Problem.add_dim("conv2_kern", (3, 8)) # Problem.add_dim("fc1_out", (64, 256)) # Problem.add_dim("fc2_out", (32, 128)) Problem.add_dim("fc1_out", (64, 16384)) Problem.add_dim("fc2_out", (32, 16384)) Problem.add_dim("fc3_out", [10]) if use_knl: # Problem.add_dim("omp_num_threads", (8, 64)) Problem.add_dim("omp_num_threads", [64]) Problem.add_starting_point( batch_size=10, image_size=32,
from deephyper.benchmark import HpProblem Problem = HpProblem() sp = {} # Problem.add_dim("lr", (0.0009, 0.1)) for i in range(1, 18): Problem.add_dim(f"u{i}", (32, 128)) Problem.add_dim(f"a{i}", [None, "relu", "sigmoid", "tanh"]) sp[f"u{i}"] = 64 sp[f"a{i}"] = "relu" Problem.add_starting_point(**sp) Problem.add_starting_point( **{ "a1": None, "a10": "relu", "a11": "relu", "a12": "tanh", "a13": "tanh", "a14": "tanh", "a15": "relu", "a16": "relu", "a17": "tanh", "a2": "sigmoid", "a3": None, "a4": "sigmoid", "a5": "tanh", "a6": None,
from deephyper.benchmark import HpProblem Problem = HpProblem() Problem.add_dim('epochs', (5,30), default=5) Problem.add_dim('rnn_type', ['LSTM', 'GRU', 'SimpleRNN'], default='LSTM') Problem.add_dim('nhidden', (1, 100), default=1) #network parameters Problem.add_dim('activation', ['relu', 'elu', 'selu', 'tanh'], default='relu') Problem.add_dim('batch_size', (8, 1024), default=8) Problem.add_dim('dropout', (0.0, 1.0), default=0.0) Problem.add_dim('optimizer', ['sgd', 'rmsprop', 'adagrad', 'adadelta', 'adam', 'adamax', 'nadam'], default='sgd') # common optimizer parameters Problem.add_dim('learning_rate', (1e-04, 1e01), default=1e-4) if __name__ == '__main__': print(Problem)
from deephyper.benchmark import HpProblem Problem = HpProblem() Problem.add_dim('batch_size', (1, 8192)) Problem.add_dim('in_features', (128, 8192)) Problem.add_dim('out_features', (128, 8192)) Problem.add_dim('omp_num_threads', (8, 64)) Problem.add_dim('bias', [0, 1]) Problem.add_starting_point(batch_size=128, in_features=1024, out_features=512, omp_num_threads=64, bias=0) if __name__ == '__main__': print(Problem)
from deephyper.benchmark import HpProblem # import os # import sys # sys.path.append(os.path.dirname(os.path.dirname(os.path.abspath(__file__)))) from torch_wrapper import use_knl # noqa Problem = HpProblem() Problem.add_dim("batch_size", (1, 1024)) Problem.add_dim("image_size", (32, 64)) Problem.add_dim("in_channels", (2, 8)) Problem.add_dim("out_channels", (2, 16)) Problem.add_dim("kernel_size", (2, 4)) if use_knl: # KGF: unlike 1D and 3D conv*/ problems, not restricted to 64 threads: Problem.add_dim("omp_num_threads", (8, 64)) Problem.add_starting_point( batch_size=128, image_size=32, in_channels=2, out_channels=2, kernel_size=2, omp_num_threads=64, ) else: Problem.add_starting_point(batch_size=128, image_size=32, in_channels=2, out_channels=2,
from deephyper.benchmark import HpProblem # import os # import sys # sys.path.append(os.path.dirname(os.path.dirname(os.path.abspath(__file__)))) from torch_wrapper import use_knl # noqa Problem = HpProblem() Problem.add_dim("batch_size", (1, 8192)) Problem.add_dim("in_features", (128, 8192)) Problem.add_dim("out_features", (128, 8192)) Problem.add_dim("bias", [0, 1]) if use_knl: Problem.add_dim("omp_num_threads", (8, 64)) Problem.add_starting_point(batch_size=128, in_features=1024, out_features=512, bias=0, omp_num_threads=64) else: Problem.add_starting_point(batch_size=128, in_features=1024, out_features=512, bias=0) if __name__ == "__main__": print(Problem)
from deephyper.benchmark import HpProblem Problem = HpProblem() Problem.add_dim('log2_batch_size', (5, 10), 7) Problem.add_dim('nunits_1', (10, 100), 100) Problem.add_dim('nunits_2', (10, 30), 20) Problem.add_dim('dropout_1', (0.0, 1.0), 0.2) Problem.add_dim('dropout_2', (0.0, 1.0), 0.2) Problem.add_dim('optimizer_type', ['RMSprop', 'Adam'], 'RMSprop')
from deephyper.benchmark import HpProblem Problem = HpProblem() Problem.add_dim('epochs', (5, 500), 5) # benchmark specific parameters Problem.add_dim('rnn_type', ['LSTM', 'GRU', 'SimpleRNN'], 'LSTM') Problem.add_dim('embed_hidden_size', (1, 100), 1) Problem.add_dim('sent_hidden_size', (1, 100), 1) Problem.add_dim('query_hidden_size', (1, 100), 1) # network parameters Problem.add_dim('activation', ['relu', 'elu', 'selu', 'tanh'], 'relu') Problem.add_dim('batch_size', (8, 1024), 8) Problem.add_dim('dropout', (0.0, 1.0), 0.0) Problem.add_dim( 'optimizer', ['sgd', 'rmsprop', 'adagrad', 'adadelta', 'adam', 'adamax', 'nadam'], 'sgd') # common optimizer parameters #space['clipnorm'] = (1e-04, 1e01) #space['clipvalue'] = (1e-04, 1e01) # optimizer parameters Problem.add_dim('learning_rate', (1e-04, 1e01), 1e-04) #space['momentum'] = (0, 1e01) #space['decay'] = (0, 1e01) #space['nesterov'] = [False, True] #space['rho'] = (1e-04, 1e01) #space['epsilon'] = (1e-08, 1e01) #space['beta1'] = (1e-04, 1e01) #space['beta2'] = (1e-04, 1e01) if __name__ == '__main__':
from deephyper.benchmark import HpProblem # import os # import sys # sys.path.append(os.path.dirname(os.path.dirname(os.path.abspath(__file__)))) from torch_wrapper import use_knl # noqa Problem = HpProblem() Problem.add_dim("batch_size", (1, 1024)) Problem.add_dim("seq_length", (128, 1024)) Problem.add_dim("in_features", (128, 1024)) Problem.add_dim("hidden_units", (128, 1024)) Problem.add_dim("num_layers", (1, 2)) # Problem.add_dim("out_features", (128, 8192)) Problem.add_dim("bias", [0, 1]) if use_knl: Problem.add_dim("omp_num_threads", (8, 64)) Problem.add_starting_point( batch_size=128, seq_length=512, in_features=1024, hidden_units=512, num_layers=1, bias=0, omp_num_threads=64, ) else: Problem.add_starting_point( batch_size=128,
from deephyper.benchmark import HpProblem Problem = HpProblem() Problem.add_dim('batch_size', (1, 1024)) Problem.add_dim('image_size', (128, 1024)) Problem.add_dim('in_channels', (2, 64)) Problem.add_dim('out_channels', (2, 64)) Problem.add_dim('kernel_size', (2, 16)) Problem.add_dim('omp_num_threads', (8, 64)) Problem.add_starting_point(batch_size=10, image_size=128, in_channels=2, out_channels=2, kernel_size=2, omp_num_threads=64) if __name__ == '__main__': print(Problem)
from deephyper.benchmark import HpProblem # import os # import sys # sys.path.append(os.path.dirname(os.path.dirname(os.path.abspath(__file__)))) from torch_wrapper import use_knl # noqa Problem = HpProblem() Problem.add_dim("batch_size", (1, 512)) Problem.add_dim("height", (128, 1024)) Problem.add_dim("width", (128, 1024)) Problem.add_dim("in_channels", (2, 64)) Problem.add_dim("out_channels", (2, 64)) Problem.add_dim("kernel_size", (2, 16)) if use_knl: # KGF: unlike 1D and 3D conv*/ problems, not restricted to 64 threads: Problem.add_dim("omp_num_threads", (8, 64)) Problem.add_starting_point( batch_size=128, height=512, width=512, in_channels=3, out_channels=64, kernel_size=3, omp_num_threads=64, ) else: Problem.add_starting_point( batch_size=128,
from deephyper.benchmark 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.)) Problem.add_starting_point(units=10, activation=None, lr=0.01) if __name__ == '__main__': print(Problem)
from deephyper.benchmark import HpProblem Problem = HpProblem() Problem.add_dim('batch_size', (1, 4096)) Problem.add_dim('image_size', (128, 8192)) Problem.add_dim('in_channels', (2, 1024)) Problem.add_dim('out_channels', (2, 1024)) Problem.add_dim('kernel_size', (2, 64)) Problem.add_dim('omp_num_threads', [64]) Problem.add_starting_point(batch_size=10, image_size=128, in_channels=2, out_channels=2, kernel_size=2, omp_num_threads=64) if __name__ == '__main__': print(Problem)
from deephyper.benchmark import HpProblem Problem = HpProblem() Problem.add_dim('batch_size', (1, 512)) Problem.add_dim('height', (128, 1024)) Problem.add_dim('width', (128, 1024)) Problem.add_dim('in_channels', (2, 64)) Problem.add_dim('out_channels', (2, 64)) Problem.add_dim('kernel_size', (2, 16)) Problem.add_dim('omp_num_threads', (8, 64)) Problem.add_starting_point(batch_size=128, height=512, width=512, in_channels=3, out_channels=64, kernel_size=3, omp_num_threads=64) if __name__ == '__main__': print(Problem)
from deephyper.benchmark import HpProblem Problem = HpProblem() Problem.add_dim('epochs', (5, 500), 5) # benchmark specific parameters Problem.add_dim('nhidden', (1, 100), 1) Problem.add_dim('nunits', (1, 1000), 1) # network parameters Problem.add_dim('activation', ['relu', 'elu', 'selu', 'tanh'], 'relu') Problem.add_dim('batch_size', (8, 1024), 8) Problem.add_dim('dropout', (0.0, 1.0), 0.0) Problem.add_dim( 'optimizer', ['sgd', 'rmsprop', 'adagrad', 'adadelta', 'adam', 'adamax', 'nadam'], 'sgd') # common optimizer parameters #Problem.add_dim(['clipnorm'] = (1e-04, 1e01) #Problem.add_dim(['clipvalue'] = (1e-04, 1e01) # optimizer parameters Problem.add_dim('learning_rate', (1e-04, 1e01), 1e-04) #Problem.add_dim(['momentum'] = (0, 1e01) #Problem.add_dim(['decay'] = (0, 1e01) #Problem.add_dim(['nesterov'] = [False, True] #Problem.add_dim(['rho'] = (1e-04, 1e01) #Problem.add_dim(['epsilon'] = (1e-08, 1e01) #Problem.add_dim(['beta1'] = (1e-04, 1e01) #Problem.add_dim(['beta2'] = (1e-04, 1e01)
from deephyper.benchmark import HpProblem # import os # import sys # sys.path.append(os.path.dirname(os.path.dirname(os.path.abspath(__file__)))) from torch_wrapper import use_knl # noqa Problem = HpProblem() Problem.add_dim("batch_size", (1, 64)) Problem.add_dim("image_size", (16, 128)) Problem.add_dim("in_channels", (2, 64)) Problem.add_dim("out_channels", (2, 64)) Problem.add_dim("kernel_size", (2, 10)) if use_knl: Problem.add_dim("omp_num_threads", [64]) # Problem.add_dim("omp_num_threads", (8, 64)) Problem.add_starting_point( batch_size=10, image_size=28, in_channels=2, out_channels=2, kernel_size=2, omp_num_threads=64, ) else: Problem.add_starting_point( batch_size=10, image_size=28, in_channels=2, out_channels=2, kernel_size=2 )
# some_file.py import sys # insert at 1, 0 is the script path (or '' in REPL) sys.path.insert(1, '/home/yzamora/perf_pred/deephyper_repo/deephyper/') from deephyper.benchmark import HpProblem Problem = HpProblem() #Width of hidden layers Problem.add_dim('nunits', (1, 1000)) Problem.add_dim('depth', (1,20)) #Problem.add_dim('nunits_l2', (1, 1000)) Problem.add_dim('activation', ['relu', 'elu', 'selu', 'tanh']) Problem.add_dim('batch_size', (8, 100)) #Problem.add_dim('dropout_l1', (0.0, 1.0)) #Problem.add_dim('dropout_l2', (0.0, 1.0)) Problem.add_starting_point( nunits=1, activation='relu', batch_size=8, depth=1 ) if __name__ == '__main__': print(Problem)
from deephyper.benchmark import HpProblem # import os # import sys # sys.path.append(os.path.dirname(os.path.dirname(os.path.abspath(__file__)))) from torch_wrapper import use_knl # noqa Problem = HpProblem() Problem.add_dim("batch_size", (1, 4096)) Problem.add_dim("image_size", (128, 8192)) Problem.add_dim("in_channels", (2, 1024)) Problem.add_dim("out_channels", (2, 1024)) Problem.add_dim("kernel_size", (2, 64)) if use_knl: # Problem.add_dim("omp_num_threads", (8, 64)) Problem.add_dim("omp_num_threads", [64]) Problem.add_starting_point( batch_size=10, image_size=128, in_channels=2, out_channels=2, kernel_size=2, omp_num_threads=64, ) else: Problem.add_starting_point(batch_size=10, image_size=128, in_channels=2, out_channels=2,
import os import numpy as np from deephyper.benchmark import HpProblem from deephyper.benchmark.benchmark_functions_wrappers import polynome_2 # Problem definition Problem = HpProblem() num_dim = 10 for i in range(num_dim): Problem.add_dim(f'e{i}', (-10.0, 10.0)) Problem.add_starting_point(**{f'e{i}': 10.0 for i in range(num_dim)}) # Definition of the function which runs the model def run(param_dict): f, _, _ = polynome_2() num_dim = 10 x = np.array([param_dict[f'e{i}'] for i in range(num_dim)]) return f(x) # the objective if __name__ == '__main__': print(Problem)
from deephyper.benchmark import HpProblem Problem = HpProblem() Problem.add_dim('batch_size', (1, 32)) Problem.add_dim('image_size', [32]) Problem.add_dim('conv1_in_chan', [3]) Problem.add_dim('conv1_out_chan', (3, 64)) Problem.add_dim('conv1_kern', (3, 8)) Problem.add_dim('pool_size', [2]) Problem.add_dim('conv2_out_chan', (3, 64)) Problem.add_dim('conv2_kern', (3, 8)) Problem.add_dim('fc1_out', (64, 16384)) Problem.add_dim('fc2_out', (32, 16384)) Problem.add_dim('fc3_out', [10]) Problem.add_dim('omp_num_threads', [64]) Problem.add_starting_point(batch_size=10, image_size=32, conv1_in_chan=3, conv1_out_chan=16, conv1_kern=5, pool_size=2, conv2_out_chan=16, conv2_kern=5, fc1_out=128, fc2_out=84, fc3_out=10, omp_num_threads=64) if __name__ == '__main__': print(Problem)
import random from deephyper.benchmark import HpProblem NDIM = 2 Problem = HpProblem() def_values = [random.uniform(-3.0, 4.0) for i in range(NDIM)] for i, startVal in enumerate(def_values, 1): dim = f"x{i}" Problem.add_dim(dim, (-3.0, 4.0), default=startVal)
from deephyper.benchmark import HpProblem Problem = HpProblem() Problem.add_dim('batch_size', (1, 64)) Problem.add_dim('image_size', (16, 128)) Problem.add_dim('in_channels', (2, 64)) Problem.add_dim('out_channels', (2, 64)) Problem.add_dim('kernel_size', (2, 10)) Problem.add_dim('omp_num_threads', [64]) Problem.add_starting_point(batch_size=10, image_size=28, in_channels=2, out_channels=2, kernel_size=2, omp_num_threads=64) if __name__ == '__main__': print(Problem)
import os import numpy as np from deephyper.benchmark import HpProblem from deephyper.benchmark.benchmark_functions_wrappers import polynome_2 # Problem definition Problem = HpProblem() num_dim = 10 for i in range(num_dim): Problem.add_dim(f'e{i}', (-10, 10), i) # Definition of the function which runs the model def run(param_dict): f, (a, b), _ = polynome_2() num_dim = 10 x = np.array([param_dict[f'e{i}'] for i in range(num_dim)]) return f(x) # the objective if __name__ == '__main__': print(Problem)