adap / flower

Flower: A Friendly Federated AI Framework
https://flower.ai
Apache License 2.0
5.09k stars 875 forks source link

Support proper export/serialization of `History` #1941

Open lbhm opened 1 year ago

lbhm commented 1 year ago

Describe the type of feature and its functionality.

I noticed that flwr.server.History currently has no method for a structured export of its contents that enables straight-forward serialization.

Are there any reasons against implementing a to_dict() or to_json() method so that you can easily put you training results into a JSON file? If no, I would be happy to contribute a PR.

Describe step by step what files and adjustments are you planning to include.

Implement a method in flwr.server.History that returns all its information in a JSON serializable form.

Is there something else you want to add?

No response

letv3 commented 6 months ago

This is an indeed helpfull feature. Is there any plan to implement it in future? History in the simulation notebooks could be exported easily with some additional step. But the main issue on my opinion is the History during the multi-process (e.g. running flower-server and flower-client as separate processes). It is saved nowhere. The function that returns history is not assigned to anything.