openclimatefix / PVNet

PVnet main repo
MIT License
15 stars 3 forks source link

Model ensemble #148

Closed dfulu closed 4 months ago

dfulu commented 4 months ago

Pull Request

Description

Add support for using a ensemble of models in production

Changes:

Checklist:

codecov[bot] commented 4 months ago

Codecov Report

Attention: Patch coverage is 84.21053% with 6 lines in your changes are missing coverage. Please review.

Project coverage is 55.57%. Comparing base (7f884f8) to head (6471e87). Report is 1 commits behind head on main.

Files Patch % Lines
pvnet/models/base_model.py 14.28% 6 Missing :warning:
Additional details and impacted files ```diff @@ Coverage Diff @@ ## main #148 +/- ## ========================================== + Coverage 55.03% 55.57% +0.53% ========================================== Files 30 31 +1 Lines 2044 2082 +38 ========================================== + Hits 1125 1157 +32 - Misses 919 925 +6 ```

:umbrella: View full report in Codecov by Sentry.
:loudspeaker: Have feedback on the report? Share it here.

peterdudfield commented 4 months ago

HI James, looks great! I expected to see mulite models being loaded in from HuggingFace. Or perhaps that happens in pvnet_app.

peterdudfield commented 4 months ago

I really would like it if you add something to experiments to, showing the impact of aggregation? Can be 1 paragraph with a few graphs would be fanstastic.

dfulu commented 4 months ago

HI James, looks great! I expected to see mulite models being loaded in from HuggingFace. Or perhaps that happens in pvnet_app.

We compile multiple models into a single ensemble model. Thats what the new Ensemble class is for. It contains a list of submodels which are trained separately. Once we compile an Ensemble from a list of trained models, we push the whole thing to huggingface as if is was a single model (which in a pytorch sense it really is now). I think it simplifies the huggingface workflow, and means we don't have to make any changes to pvnet_app to accommodate it. The app is oblivious that it is running an ensemble