SMILELab-FL / FedLab

A flexible Federated Learning Framework based on PyTorch, simplifying your Federated Learning research.
https://fedlab.readthedocs.io
Apache License 2.0
743 stars 127 forks source link

Update functional.py #328

Closed liyown closed 1 year ago

liyown commented 1 year ago

Optimized for slow segmentation of data when the Dilliclet coefficient is small,According to this issue #230, but it might be difficult to replicate the results reported in the original paper.

liyown commented 1 year ago

In the code, if the number of samples for a category is 0, it will result in a process of randomly re-selecting the category. The code adds an exception handling mechanism to ensure that sample selection continues even if the number of samples for a category is 0. For example, when the sample number of a class is 0, a class with a non-zero sample number is randomly selected for sample selection.

AgentDS commented 1 year ago

Hi, Sorry for the late reply. Could you please rename the new version of the function as client_inner_dirichlet_partition_faster, and keep the old version of the function with the old name? so we can keep both versions for this function.

liyown commented 1 year ago

Modified

AgentDS commented 1 year ago

Thank you very much!