Add weighted aggregation, early stopping and persistent logging - #9
Open
TensorSpd wants to merge 1 commit into
Open
Add weighted aggregation, early stopping and persistent logging#9TensorSpd wants to merge 1 commit into
TensorSpd wants to merge 1 commit into
Conversation
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Description
Summary of Changes:
I have implemented several key enhancements to the Federated Learning (FL) Aggregator component to improve the training process's efficiency, fairness, and transparency. The main changes include:
Weighted Aggregation by Dataset Size:
Early Stopping Mechanism:
early_stopping_patience).Aggregator State Persistence (
agg_state.json):agg_state.json.Dashboard/Metric Setup:
public/fl/<project_name>), copy dashboard files, and track accuracy metrics inaccuracy_metrics.json.Bug Fixes and Miscellaneous Improvements:
NameErrorby ensuring thejsonmodule is imported where necessary.training_loss_round_{round_num}.jsonis correctly generated and moved to the public folder, making training loss logs accessible after project completion.Motivation:
These enhancements aim to make the federated learning pipeline more robust, fair, and efficient. Weighted aggregation ensures that models are influenced appropriately based on the data contributed, while early stopping conserves computational resources. Persisting the aggregator state enhances reliability, and the improved logging and dashboard setup aids in monitoring and analyzing the training process effectively.
Additional Context:
If this PR closes any open issues, please tag them accordingly (e.g.,
Closes #123).Affected Dependencies
jsonmodule for handling JSON operations.How has this been tested?
Unit Tests:
training_loss_round_{round_num}.jsonis correctly created and updated during each training round.dataset_size.jsonis accurately generated and used for weighted aggregation.Integration Tests:
Manual Testing:
agg_state.jsonproperly records and updates the best accuracy and no-improvement round count.public/fl/<project_name>folder to verify that training loss and accuracy metrics are displayed correctly.Instructions to Reproduce:
Set Up:
Run Training:
training_loss_round_{round_num}.jsonis being generated and copied to the public folder.Verify Aggregation:
dataset_size.jsonfrom each client and performs weighted aggregation.Review Logs and Metrics:
public/fl/<project_name>folder to review the training loss JSON files and the accuracy metrics dashboard.