Skip to content

Comments

Feature federated learning#13614

Closed
kdt523 wants to merge 2 commits intoTheAlgorithms:masterfrom
kdt523:feature-federated-learning
Closed

Feature federated learning#13614
kdt523 wants to merge 2 commits intoTheAlgorithms:masterfrom
kdt523:feature-federated-learning

Conversation

@kdt523
Copy link

@kdt523 kdt523 commented Oct 20, 2025

This PR adds comprehensive doctests to [federated_averaging.py] and adjusts expected float literals to match Python’s default float representation. The goal is to ensure the module is verified by CI via doctests and to avoid false negatives due to minor float formatting differences.
What’s included:
Doctests covering:
Equal-weight aggregation across multiple tensors (vector and 2x2 matrix)
Weighted aggregation with custom non-negative weights
Error cases: no clients, mismatched number of tensors, mismatched shapes, invalid weights (negative, zero-sum, wrong shape)
A concise docstring for [federated_average] (parameters and returns)
No functional changes to the algorithm—behavior remains the same
Scope:
File changed: [federated_averaging.py]
No new files, no external dependencies added
Reference:
Federated learning overview: [https://en.wikipedia.org/wiki/Federated_learning]
Tests:
Doctests run locally: 16 tests, 16 passed, 0 failed (module-only doctest run)
Fixes #13612

@algorithms-keeper
Copy link

Closing this pull request as invalid

@kdt523, this pull request is being closed as none of the checkboxes have been marked. It is important that you go through the checklist and mark the ones relevant to this pull request. Please read the Contributing guidelines.

If you're facing any problem on how to mark a checkbox, please read the following instructions:

  • Read a point one at a time and think if it is relevant to the pull request or not.
  • If it is, then mark it by putting a x between the square bracket like so: [x]

NOTE: Only [x] is supported so if you have put any other letter or symbol between the brackets, that will be marked as invalid. If that is the case then please open a new pull request with the appropriate changes.

@algorithms-keeper algorithms-keeper bot added the awaiting reviews This PR is ready to be reviewed label Oct 20, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

awaiting reviews This PR is ready to be reviewed invalid

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Add federated learning to machine learning submodules

1 participant