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

Replica Sampler #247

Merged
merged 10 commits into from
Jun 18, 2020
Merged

Replica Sampler #247

merged 10 commits into from
Jun 18, 2020

Conversation

orbitfold
Copy link
Collaborator

@orbitfold orbitfold commented Jun 12, 2020

I want a sampler that will behave the following way:

sampler = BasicSweep({'a': [1, 2, 3], 'b' : [4, 5]})
replica_sampler = ReplicaSampler(sampler, 'ensemble')
for _ in range(1000):
    params = replica_sampler.next()
    print(params)

Would create a new sampler that would iterate across the values of basic sweep many times adding a new column for the ensemble index. Would work for any finite sampler. In the example above it would output param dictionaries as so:

{'a': 1, 'b': 4, 'ensemble' : 0}
...
{'a': 3, 'b': 5, 'ensemble' : 0}
{'a': 1, 'b': 4, 'ensemble' : 1}
...
{'a': 3, 'b': 5, 'ensemble' : 1}
{'a': 1, 'b': 4, 'ensemble' : 2}
...

and so on. This would allow taking a finite sampler and producing replicas for it using different seeds for example. And if you wanted more accuracy you could just generate more samples.

@orbitfold orbitfold marked this pull request as draft June 12, 2020 12:58
@orbitfold orbitfold marked this pull request as ready for review June 16, 2020 13:09
@orbitfold orbitfold merged commit 8a71e33 into dev Jun 18, 2020
@orbitfold orbitfold deleted the replica-sampler branch March 4, 2021 13:29
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

Successfully merging this pull request may close these issues.

2 participants