NVFlare icon indicating copy to clipboard operation
NVFlare copied to clipboard

best_FL_global_model.pt is selected from n-1 rounds of learning

Open parkeraddison opened this issue 4 years ago • 1 comments

It looks like the best_FL_global_model.pt is only ever selected/saved in a round prior to aggregation (EventType.BEFORE_AGGREGATE), using the initial metrics (MetaKey.INITIAL_METRICS) computed before training took place at the client sites (ValidateType.BEFORE_TRAIN_VALIDATE).

This essentially means that the selection of a "best" FL global model can only take place on the n-1th round's global model, so if the global model improved in the nth round of learning then during cross-site eval we see that SRV_FL_global_model.pt actually outperforms SRV_best_FL_global_model.pt.

I'm wondering, could there be an additional event fired or method called after the rounds are complete to perform one final validation of the current FL global model across all sites and fire EventType.GLOBAL_BEST_MODEL_AVAILABLE accordingly?

parkeraddison avatar Aug 22 '22 22:08 parkeraddison

Yes, your observation is correct. You could add a task to workflow that does a final evaluation before completing the run.

holgerroth avatar Aug 23 '22 16:08 holgerroth