-
Notifications
You must be signed in to change notification settings - Fork 75
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
base: dev
Are you sure you want to change the base?
Conversation
You can check out the example notebook here: https://github.com/bayesflow-org/bayesflow/blob/ensembles/examples/ApproximatorEnsemble%20example.ipynb |
Codecov Report❌ Patch coverage is
|
Known problem: When the approximators share networks/weights, deserialization will fail. I'm not sure yet, maybe we can fix this by looking at the way the weights are stored during saving.
Nice work :) While trying it out a bit, the additional dimension for each ensemble member in the data caught me by surprise, and it took me a while to figure out why a dimension was missing from my data during training.
As I did not take part in the discussions, maybe you already talked this through. In any way, I would be happy to hear your thoughts on this... |
I have added serialization support, but deserialization fails when multiple approximators use the same weights, e.g. when they share a summary network. I'm not sure yet how this can be resolved, and if we want to enable serialization if we can not resolve it... |
@paul-buerkner You can find one as part of the PR: https://github.com/bayesflow-org/bayesflow/blob/ensembles/examples/ApproximatorEnsemble%20example.ipynb |
@han-ol and I had a discussion on the dataset question. One approach would be a general
In addition, in the approximator ensemble class, we can determine by the shape of This gives us the possibility to use our existing datasets, and only requires this one additional class to add the capability to pass different data to different approximators. |
I am strongly in favor of this idea. We also discussed in the past that this is a more elegant and catch-all solution. |
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.
We envision
ApproximatorEnsemble
as the abstraction at the heart of future workflows using ensembles.Approximator
objects.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.
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
ApproximatorEnsemble
(currentlysample
exists)ApproximatorEnsemble
ApproximatorEnsemble
OnlineEnsembleDataset
DiskEnsembleDataset