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

Seeding the Random Number Generators? #902

Open
dreavjr opened this issue Sep 8, 2023 · 2 comments
Open

Seeding the Random Number Generators? #902

dreavjr opened this issue Sep 8, 2023 · 2 comments

Comments

@dreavjr
Copy link

dreavjr commented Sep 8, 2023

Currently, in the documentation, it's unclear whether it's possible to control the RNGs' seeding, and if that's possible, where (server, client, problem, study, sampling?) and how to perform that seeding.

@sagipe
Copy link
Member

sagipe commented Oct 2, 2023

Hi,

Currently, it's only possible to control the RNG seeding at a Designer level, which can happen on the server code itself (e.g. in the policy factory code).

Part of what makes Vizier a good global optimizer is that it's stochastic, and we build a new Designer for every batch of trials. We typically only supply the seed when we want to replicate a specific trial that e.g. a user complained about, based on the seed that was used to generate the suggestion (and it stored in the trial metadata).

Do you have a specific use case where you'd want to control the seed from the client side?

Best,
Sagi

@dreavjr
Copy link
Author

dreavjr commented Oct 3, 2023

Seeding at the server level would work be totally fine for my use case. Do you have an example (or documentation) on how to use the Designer class to accomplish that?

For illustration, this is my current usage:

problem = vz.ProblemStatement()
problem.search_space.root.add_float_param('lr_exp', search_space['lr_exp_min'], search_space['lr_exp_max'])
problem.search_space.root.add_float_param('wd_exp', search_space['wd_exp_min'], search_space['wd_exp_max'])
problem.metric_information.append(vz.MetricInformation(name='dummy_metric', goal=vz.ObjectiveMetricGoal.MAXIMIZE))

study_config = vz.StudyConfig.from_problem(problem)
study_config.algorithm = 'QUASI_RANDOM_SEARCH'

server = servers.DefaultVizierServer(host='localhost', database_url=None)
clients.environment_variables.server_endpoint = server.endpoint
study_client = clients.Study.from_study_config(study_config, owner='owner', study_id = 'example_study_id')

suggestions = study_client.suggest(count=samples_n)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants