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)
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)
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 # 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() 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, 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)
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)
# 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)
# problem.py from deephyper.benchmark import HpProblem Problem = HpProblem() Problem.add_dim('log2_batch_size', (5, 10)) Problem.add_dim('nunits_1', (10, 100)) Problem.add_dim('nunits_2', (10, 30)) Problem.add_dim('dropout_1', (0.0, 1.0)) Problem.add_dim('dropout_2', (0.0, 1.0)) Problem.add_dim('optimizer_type', ['RMSprop', 'Adam']) Problem.add_starting_point(log2_batch_size=7, nunits_1=100, nunits_2=20, dropout_1=0.2, dropout_2=0.2, optimizer_type='RMSprop')
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, seq_length=512, in_features=1024, hidden_units=512, num_layers=1, bias=0, )
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)