Closed mlittmanabbvie closed 2 years ago
Hello @mlittmanabbvie,
The api-ref section of the readme and the faq was updated with the new information about pathos. I modified your example to use pathos:
import numpy as np
import pandas as pd
from hyperactive import Hyperactive
from hyperactive import RepulsingHillClimbingOptimizer
def f():
def optimization_func(opt):
return 5
h = Hyperactive(distribution="pathos")
search_space = {
"exp": list(range(0, 5)),
"slope": list(np.arange(0.001, 10, step=0.05)),
"clust": [5],
}
h.add_search(
optimization_func,
search_space=search_space,
n_iter=10,
optimizer=RepulsingHillClimbingOptimizer(
epsilon=0.05,
distribution="normal",
n_neighbours=3,
rand_rest_p=0.03,
repulsion_factor=3,
),
n_jobs=1,
max_score=None,
initialize={"warm_start": [{"exp": 2, "slope": 5, "clust": 5}]},
early_stopping={"tol_rel": 0.001, "n_iter_no_change": 3},
random_state=0,
memory=True,
memory_warm_start=None,
)
h.add_search(optimization_func, search_space=search_space, n_iter=10)
h.run()
f()
This works fine on my system. Let me know if it also works on yours.
Look into the FAQ of the readme. Can the bug be resolved by one of those solutions? No
Describe the bug When using multiple optimizers and passing a local function, I am getting the error listed below.
Code to reproduce the behavior
Error message from command line
System information:
Additional context In the previous question you had mentioned support for pathos. How do I use that in order to run this successfully?