llnl / llnl/scisample

Ensemble Object

Open
#1 0 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Dominant language
Python
Stars
1
Forks
3
PR merge metrics
No merged PRs in 30d

Description

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:

```
sampler:
- type: list
parameters:
X1: [5, 10]
X2: [5, 10]
- type: cross_product
parameters:
X1: [15, 20, 30]
X2: [15, 20, 30]
```

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

No implementation files or tests are named. Start by locating the existing sampler classes and the YAML sampler-parsing entry point, then compare their validation and sample APIs. Done means multiple configured samplers can be combined through an Ensemble-like API and their samples are returned together.

Written by the indexing model from the issue text.

Assessment

Tech stack
python
Domain
backend
Issue type
Feature
Difficulty
5/5
Estimated time
Over a week
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
30/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.