diff --git a/package/samplers/demo/README.md b/package/samplers/demo/README.md index 83fe52d4..ad82762f 100644 --- a/package/samplers/demo/README.md +++ b/package/samplers/demo/README.md @@ -29,7 +29,7 @@ def objective(trial: optuna.Trial) -> float: if __name__ == "__main__": - module = optunahub.load("samplers/demo") + module = optunahub.load_module("samplers/demo") sampler = module.DemoSampler(seed=42) study = optuna.create_study(sampler=sampler) study.optimize(objective, n_trials=5) diff --git a/package/samplers/simple/README.md b/package/samplers/simple/README.md index 12fa21cf..f07e86eb 100644 --- a/package/samplers/simple/README.md +++ b/package/samplers/simple/README.md @@ -42,7 +42,7 @@ from optuna.trial import FrozenTrial class UserDefinedSampler( - optunahub.load("sampler/simple").SimpleSampler + optunahub.load_module("sampler/simple").SimpleSampler ): def __init__(self, search_space: dict[str, BaseDistribution]) -> None: super().__init__(search_space) diff --git a/package/samplers/simulated_annealing/README.md b/package/samplers/simulated_annealing/README.md index f72d300d..424dde18 100644 --- a/package/samplers/simulated_annealing/README.md +++ b/package/samplers/simulated_annealing/README.md @@ -40,7 +40,7 @@ def objective(trial: optuna.Trial) -> float: if __name__ == "__main__": - mod = optunahub.load("sampler/simulated_annealing") + mod = optunahub.load_module("sampler/simulated_annealing") sampler = mod.SimulatedAnnealingSampler() study = optuna.create_study(sampler=sampler) diff --git a/package/visualization/plot_hypervolume_history_with_rp/README.md b/package/visualization/plot_hypervolume_history_with_rp/README.md index 3dcc9938..3b9daade 100644 --- a/package/visualization/plot_hypervolume_history_with_rp/README.md +++ b/package/visualization/plot_hypervolume_history_with_rp/README.md @@ -53,7 +53,7 @@ def objective(trial): if __name__ == "__main__": - mod = optunahub.load("visualization/plot_hypervolume_history_with_rp") + mod = optunahub.load_module("visualization/plot_hypervolume_history_with_rp") study = optuna.create_study(directions=["minimize", "minimize"]) study.optimize(objective, n_trials=50) diff --git a/recipes/001_first.py b/recipes/001_first.py index 6efee629..7a142f4b 100644 --- a/recipes/001_first.py +++ b/recipes/001_first.py @@ -39,10 +39,10 @@ ################################################################################################### # Next, define your own sampler class by inheriting `SimpleSampler` class. # In this example, we implement a sampler that always returns a random value. -# The `SimpleSampler` class can be loaded using `optunahub.load` function. +# The `SimpleSampler` class can be loaded using `optunahub.load_module` function. # The `force_load` argument is set to `True` to force loading the sampler without caching and consent to use stats. -SimpleSampler = optunahub.load( +SimpleSampler = optunahub.load_module( "samplers/simple", auth=Auth.Token(os.environ["SECRET_GITHUB_TOKEN"]), ).SimpleSampler