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

Ensemble model class implementation #23

Open
djgagne opened this issue May 5, 2024 · 0 comments
Open

Ensemble model class implementation #23

djgagne opened this issue May 5, 2024 · 0 comments

Comments

@djgagne
Copy link
Collaborator

djgagne commented May 5, 2024

I would like to add EnsembleClassifierDNN and EnsembleRegressorDNN model classes that wrap around their respective member model classes similar to the RandomForestRegressor and classifier in scikit-learn. Some constraints to consider for the model classes.

  1. Base classes and sub classes: Some methods, like saving and loading models, may be identical or very similar across different ensemble types, so I would suggest putting those methods in an ensemble base class. That can be inherited by specific subclasses and modified if necessary.
  2. Minimizing memory usage: One challenge with ensemble methods, especially for larger models, is their memory usage, especially on GPU. For keras 3, there doesn't appear to be a clear way to move model weights between cpu RAM and GPU VRAM, so the most straightforward way would be to iterate through each model and load/save the model and/or weights and run clear_session in between to prevent memory leaks.
  3. Parallel/distributed training: Keras 3 does support data parallel and model parallel training with single models, so the easiest thing to do would be to use the existing framework to split the training across different GPUs.
  4. Uncertainty calculations: The calc uncertainties should use the law of total variance to get the aleatoric and epistemic uncertainty estimates. We should also include helper methods for things like ensemble percentiles and covariances.

I am going to work on an initial class to see if I can get this all to work.

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

No branches or pull requests

1 participant