Skip to content

Ensembles of Approximators #532

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

Draft
wants to merge 7 commits into
base: dev
Choose a base branch
from
Draft

Ensembles of Approximators #532

wants to merge 7 commits into from

Conversation

han-ol
Copy link
Collaborator

@han-ol han-ol commented Jul 4, 2025

This draft-PR is the result of discussions with @elseml and @stefanradev93.

The goal is fast and convenient support of approximator ensembles and the first steps for this are taken already.

  1. We envision ApproximatorEnsemble as the abstraction at the heart of future workflows using ensembles.

    • fundamentally, it is a wrapper of a dictionary of arbitrary Approximator objects.
    • it overwrites the central methods compute_metrics, build, sample and passes inputs on to the respective ensemble member's methods.
  2. Since ensembles should cover the sensitivity wrt all randomness in approximators, which are not just initialization, but also the random order of training batches, we need slightly modified datasets.

    • For now only OfflineEnsembleDataset is implemented, which makes sure that training batches have an additional dimension at the second axis, containing multiple independent random slices of the available offline samples.

A few things are missing, among them are

  • predict/estimate methods for ApproximatorEnsemble (currently sample exists)
  • tests for ApproximatorEnsemble
  • doc strings for ApproximatorEnsemble
  • OnlineEnsembleDataset
  • DiskEnsembleDataset
  • tests for ensemble datasets
  • some Workflow

@han-ol
Copy link
Collaborator Author

han-ol commented Jul 4, 2025

Copy link

codecov bot commented Jul 4, 2025

Codecov Report

Attention: Patch coverage is 28.12500% with 46 lines in your changes missing coverage. Please review.

Files with missing lines Patch % Lines
bayesflow/approximators/approximator_ensemble.py 24.48% 37 Missing ⚠️
bayesflow/datasets/offline_ensemble_dataset.py 30.76% 9 Missing ⚠️
Files with missing lines Coverage Δ
bayesflow/approximators/__init__.py 100.00% <100.00%> (ø)
bayesflow/datasets/__init__.py 100.00% <100.00%> (ø)
bayesflow/datasets/offline_ensemble_dataset.py 30.76% <30.76%> (ø)
bayesflow/approximators/approximator_ensemble.py 24.48% <24.48%> (ø)

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.

1 participant