Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Update example.py #178

Merged
merged 2 commits into from
Nov 15, 2024
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 6 additions & 4 deletions template/example.py
Original file line number Diff line number Diff line change
Expand Up @@ -18,17 +18,19 @@ def objective(trial: optuna.Trial) -> float:

# TODO: Change the variables here to test your package.
package_name = "samplers/your_sampler"
y0z marked this conversation as resolved.
Show resolved Hide resolved
repo_owner = "Your GitHub Account Name"
ref = "Your Git Branch Name"
test_local = True

if test_local:
# This is an example of how to load a sampler from your local optunahub-registry.
sampler = optunahub.load_local_module(
package=package_name, registry_root="./package/"
package=package_name,
registry_root="./", # Path to the root of the optunahub-registry.
).YourSampler()
else:
# This is an example of how to load a sampler from your fork of the optunahub-registry.
# Please remove repo_owner and ref arguments before submitting a pull request.
sampler = optunahub.load_module(
package=package_name, repo_owner=repo_owner, ref=ref
package=package_name, repo_owner="Your GitHub Account ID", ref="Your Git Branch Name"
).YourSampler()

study = optuna.create_study(sampler=sampler)
Expand Down