コード例 #1
0
ファイル: demo_branin.py プロジェクト: simudream/apsis
def demo_branin(steps=20, random_steps=5, cv=5, disable_auto_plot=False):
    conn = Connection(server_address)


    optimizers = ["RandomSearch", "BayOpt"]
    optimizer_arguments= [{}, {"initial_random_runs": random_steps} ]


    param_defs = {
        "x": {"type": "MinMaxNumericParamDef", "lower_bound": -5, "upper_bound": 10},
        "y": {"type": "MinMaxNumericParamDef", "lower_bound": 0, "upper_bound": 15},
    }

    exp_ids = []
    for i, o in enumerate(optimizers):
        exp_id = conn.init_experiment(o, o, param_defs,
                         minimization=True, optimizer_arguments=optimizer_arguments[i])#{"multiprocessing": "none"})
        exp_ids.append(exp_id)

    print("Initialized all optimizers.")

    for i in range(steps*cv):
        if i > 0 and i%10 == 0:
            print("finished %i" %i)
        for e_id in exp_ids:
            single_branin_evaluation_step(conn, e_id)
コード例 #2
0
ファイル: demo_branin.py プロジェクト: fgerzer/apsis
def demo_branin(steps=20, random_steps=5, cv=5, disable_auto_plot=False):
    conn = Connection(server_address)

    optimizers = ["RandomSearch", "BayOpt"]
    optimizer_arguments = [{}, {"initial_random_runs": random_steps}]

    param_defs = {
        "x": {
            "type": "MinMaxNumericParamDef",
            "lower_bound": -5,
            "upper_bound": 10
        },
        "y": {
            "type": "MinMaxNumericParamDef",
            "lower_bound": 0,
            "upper_bound": 15
        },
    }

    exp_ids = []
    for i, o in enumerate(optimizers):
        exp_id = conn.init_experiment(
            o,
            o,
            param_defs,
            minimization=True,
            optimizer_arguments=optimizer_arguments[i]
        )  #{"multiprocessing": "none"})
        exp_ids.append(exp_id)

    print("Initialized all optimizers.")

    for i in range(steps * cv):
        if i > 0 and i % 10 == 0:
            print("finished %i" % i)
        for e_id in exp_ids:
            single_branin_evaluation_step(conn, e_id)
コード例 #3
0
ファイル: start_script.py プロジェクト: fgerzer/apsis
    if z == "A":
        result *= 10
    if z == "B":
        result *= 0.8
    if result > 10:
        return math.log(result, 10) * 10
    else:
        return result


#app.run()

start_time = time.time()
server_address = "http://localhost:5000"

conn = Connection(server_address=server_address)

param_defs = {
    "x": pd.MinMaxNumericParamDef(-5, 10),
    "y": pd.MinMaxNumericParamDef(0, 15)
    #, "z": pd.NominalParamDef(["A", "B", "C"])
}

pd_dict = param_defs_to_dict(param_defs)
optimizer_arguments = {
    "initial_random_runs": 5,
    "acquisition_hyperparams": {},
    "num_gp_restarts": 5,
    #"acquisition": "ExpectedImprovement", #TODO string/gfunction translation?
    "kernel_params": {},
    "kernel": "matern52",
コード例 #4
0
ファイル: start_script.py プロジェクト: simudream/apsis
    f2 = s*(1-t)*math.cos(x)+s
    result = f1**2 + f2
    if z == "A":
        result *= 10
    if z == "B":
        result *= 0.8
    if result > 10:
        return math.log(result, 10)*10
    else:
        return result
#app.run()

start_time = time.time()
server_address = "http://localhost:5000"

conn = Connection(server_address=server_address)

param_defs = {
    "x": pd.MinMaxNumericParamDef(-5, 10),
    "y": pd.MinMaxNumericParamDef(0, 15)
    #, "z": pd.NominalParamDef(["A", "B", "C"])
}

pd_dict = param_defs_to_dict(param_defs)
optimizer_arguments = {
            "initial_random_runs": 5,
            "acquisition_hyperparams": {},
            "num_gp_restarts": 5,
            #"acquisition": "ExpectedImprovement", #TODO string/gfunction translation?
            "kernel_params": {},
            "kernel": "matern52",