You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
"""This example demonstrates the usage of BayesOpt with Ray Tune.It also checks that it is usable with a separate scheduler."""importtimefromrayimporttunefromray.tune.schedulersimportAsyncHyperBandSchedulerfromray.tune.suggestimportConcurrencyLimiterfromray.tune.suggest.bayesoptimportBayesOptSearchdefevaluation_fn(step, width, height):
return (0.1+width*step/100) ** (-1) +height*0.1defeasy_objective(config):
# Hyperparameterswidth, height=config["width"], config["height"]
forstepinrange(config["steps"]):
# Iterative training function - can be any arbitrary training procedureintermediate_score=evaluation_fn(step, width, height)
# Feed the score back back to Tune.tune.report(iterations=step, mean_loss=intermediate_score)
time.sleep(0.1)
if__name__=="__main__":
importargparseparser=argparse.ArgumentParser()
parser.add_argument(
"--smoke-test", action="store_true", help="Finish quickly for testing"
)
parser.add_argument(
"--server-address",
type=str,
default=None,
required=False,
help="The address of server to connect to if using Ray Client.",
)
args, _=parser.parse_known_args()
ifargs.server_address:
importrayray.init(f"ray://{args.server_address}")
algo=BayesOptSearch(utility_kwargs={"kind": "ucb", "kappa": 2.5, "xi": 0.0})
algo=ConcurrencyLimiter(algo, max_concurrent=4)
scheduler=AsyncHyperBandScheduler()
analysis=tune.run(
easy_objective,
name="my_exp",
metric="mean_loss",
mode="min",
search_alg=algo,
scheduler=scheduler,
num_samples=10ifargs.smoke_testelse1000,
config={
"steps": 100,
"width": tune.uniform(0, 20),
"height": tune.uniform(-100, 100),
},
)
print("Best hyperparameters found were: ", analysis.best_config)
Issue Severity
High: It blocks me from completing my task.
The text was updated successfully, but these errors were encountered:
joseph-long
added
bug
Something that is supposed to be working; but isn't
triage
Needs triage (eg: priority, bug/not-bug, and owning component)
labels
Jun 3, 2022
What happened + What you expected to happen
Expected: Bayesian optimization example from the docs should run to completion
Observed: Example for BayesOptSearch runs for several iterations before it terminates with a TypeError deep in the guts of the framework
Logs:
Versions / Dependencies
Using macOS 12.4 Monterey on M1 Max.
Reproduction script
Directly from the docs:
Issue Severity
High: It blocks me from completing my task.
The text was updated successfully, but these errors were encountered: