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
When working on an application, I wanted a method to easily combine multiple sampling strategies, one idea was to have an Ensemble object which matches the API of the sampler objects, but has multiple samplers. Partial pseudo-code below:
class Ensemble:
"""
Class for multiple samplers.
"""
def __init__(self, sampler_data):
if not isinstance(sampler_data, list):
sampler_data = [sampler_data]
self._samplers = [new_sampler(data) for data in sampler_data]
def check_validity(self):
for sampler in self._samplers:
sampler.check_validity()
# check that all samplers have the same parameter names, etc.
def get_samples(self):
samples = []
for sampler in self._samplers:
samples.extend(sampler.get_samples())
return samples
Then you could specify multiple samplers via the yaml interface:
When working on an application, I wanted a method to easily combine multiple sampling strategies, one idea was to have an
Ensemble
object which matches the API of the sampler objects, but has multiple samplers. Partial pseudo-code below:Then you could specify multiple samplers via the yaml interface:
The text was updated successfully, but these errors were encountered: