-
Notifications
You must be signed in to change notification settings - Fork 906
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Add pFedHN baseline #2377
Open
achiverram28
wants to merge
101
commits into
adap:main
Choose a base branch
from
achiverram28:main
base: main
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Open
Add pFedHN baseline #2377
Changes from 82 commits
Commits
Show all changes
101 commits
Select commit
Hold shift + click to select a range
1b54aa5
Adding the initial things
achiverram28 56c8e5f
Adding the conf
achiverram28 1fceaaa
Adding the models
achiverram28 2f3afd8
Adding the data
achiverram28 a21f94d
Adding the main
achiverram28 0d4f7b4
Making a user friendly approach
achiverram28 458a5af
Modifying main
achiverram28 bd95e07
Modyfing th dataset.py
achiverram28 10f8080
Modifying the models
achiverram28 57e7816
will update these later
achiverram28 d2d792d
Adding the trainer
achiverram28 2c52399
Adding the strategy
achiverram28 daaf571
Adding the client.py
achiverram28 09fbdaa
Modifying the conf
achiverram28 b0ade10
Updating the readme
achiverram28 1f4752c
Updating the README
achiverram28 7372b8d
Code formatting
achiverram28 19a3821
Revert "Code formatting"
achiverram28 71da489
Code formatting
achiverram28 e032d33
Docstring formatting
achiverram28 e6c71e0
Modifying the pyproject.toml
achiverram28 170b336
Formatting and modifying the imports
achiverram28 585cb2d
Modifying the conf
achiverram28 d2df7d2
Updating the README.md
achiverram28 15a681a
Updating the README.md
achiverram28 0ffccae
Updating the README.md
achiverram28 ab1ae3b
Updating the README.md
achiverram28 246edf2
updating the dataset.py
00cf814
Updating the README.md
achiverram28 ea0bb4b
Modifying the docstring formatter
achiverram28 64a7b16
Updating dataset.py
aaeded3
Optimising the client.py
d21179f
evert "Optimising the client.py"
baaf5b0
Revert "Updating dataset.py"
158a2db
Testing everything in test-baseline.sh except pylint
achiverram28 1d8b94e
Merge branch 'main' of https://github.com/achiverram28/flower into HEAD
18a0550
Pylint check done
6b7382a
Testing done
6ab3f4e
Pushing the .pylintrc
e1104fd
removing the .pylint
achiverram28 168ee86
Solving all checks
achiverram28 8f039a7
Modifying the strategy
achiverram28 45f4255
Merge branch 'main' into testing
achiverram28 d6c1642
Merge pull request #2 from achiverram28/testing
achiverram28 8ccf4a2
Delete baselines/pFedHN/outputs/2023-09-15 directory
achiverram28 d792299
Delete baselines/pFedHN/pFedHN/outputs/2023-09-15 directory
achiverram28 9a9312a
Removed outputs
achiverram28 3c8af8b
Merge pull request #3 from achiverram28/testing
achiverram28 945aa97
Updating the toml file
5bc8d8d
Merge branch 'main' into main
kishan-droid aa50b1e
Update README.md
kishan-droid 7e7cbb8
Adding the modified changes for a new approach
achiverram28 fc0b5a0
Conducting all the tests
achiverram28 dc6ebc7
Modifying the docstring of client
achiverram28 f515962
modifying some aspects in model
achiverram28 48be2c3
Modifying the given files
achiverram28 edab990
modify the base conf
achiverram28 f600012
Merge pull request #4 from achiverram28/new-changes
achiverram28 679cb22
Modify the import manner
achiverram28 99ae12a
Merge pull request #5 from achiverram28/new-changes
achiverram28 c349718
Modifying the toml for matplotlib
achiverram28 c25671d
Modifying the README.md
achiverram28 fdb22f9
Adding the comparison algorithms
achiverram28 4600005
Merge pull request #6 from achiverram28/addexp
achiverram28 cf9cda8
Updating the README.md
achiverram28 23c8e33
Adding the results
achiverram28 ff05cf5
Adding more results
achiverram28 64d8fed
Adding more results
achiverram28 c50f205
modifying conf
achiverram28 ee16be3
Adding more results
achiverram28 daaca2e
Adding the resources
achiverram28 6379113
Modifying the client
achiverram28 029166b
Modifying the comaprison experiment's flexibility and README.md updation
achiverram28 3508378
Adding more results
achiverram28 a871cea
Adding the resource allocations
achiverram28 445c781
Adding the formatting
achiverram28 e4d54cb
Adding more results
achiverram28 5de13b7
Adding more results
achiverram28 c900476
Adding more results
achiverram28 27835e7
Modifying the hyp-param values
achiverram28 76beea6
Adding more results
achiverram28 a548dbd
updates here and there
jafermarq 03b8ee4
Modifying changes
achiverram28 7b8044a
Modifying the toml
achiverram28 58cad5c
Modifying in comparison_algorithms
achiverram28 919164e
Making device related changes
achiverram28 57ca494
Device related changes
achiverram28 7f19d7c
Modifying few more things
achiverram28 ba54c7f
Adding results
achiverram28 96df338
Adding more results
achiverram28 1e4fbc1
Adding more results
achiverram28 36a8800
Modified commmit to run proper results
achiverram28 1e199b2
Small change
achiverram28 0b565a3
formatting;evaluate_every; other minor changes
jafermarq 6c55df4
Merge branch 'adap:main' into main
kishan-droid e79c6eb
Modified changes
achiverram28 377702a
Modifying the config
achiverram28 fb57216
Modifying the README.md
achiverram28 60262a7
Merge branch 'main' of https://github.com/achiverram28/flower
achiverram28 bca8124
Modifying changes
achiverram28 8b657c0
Modified changes
achiverram28 File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,202 @@ | ||
|
||
Apache License | ||
Version 2.0, January 2004 | ||
http://www.apache.org/licenses/ | ||
|
||
TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION | ||
|
||
1. Definitions. | ||
|
||
"License" shall mean the terms and conditions for use, reproduction, | ||
and distribution as defined by Sections 1 through 9 of this document. | ||
|
||
"Licensor" shall mean the copyright owner or entity authorized by | ||
the copyright owner that is granting the License. | ||
|
||
"Legal Entity" shall mean the union of the acting entity and all | ||
other entities that control, are controlled by, or are under common | ||
control with that entity. For the purposes of this definition, | ||
"control" means (i) the power, direct or indirect, to cause the | ||
direction or management of such entity, whether by contract or | ||
otherwise, or (ii) ownership of fifty percent (50%) or more of the | ||
outstanding shares, or (iii) beneficial ownership of such entity. | ||
|
||
"You" (or "Your") shall mean an individual or Legal Entity | ||
exercising permissions granted by this License. | ||
|
||
"Source" form shall mean the preferred form for making modifications, | ||
including but not limited to software source code, documentation | ||
source, and configuration files. | ||
|
||
"Object" form shall mean any form resulting from mechanical | ||
transformation or translation of a Source form, including but | ||
not limited to compiled object code, generated documentation, | ||
and conversions to other media types. | ||
|
||
"Work" shall mean the work of authorship, whether in Source or | ||
Object form, made available under the License, as indicated by a | ||
copyright notice that is included in or attached to the work | ||
(an example is provided in the Appendix below). | ||
|
||
"Derivative Works" shall mean any work, whether in Source or Object | ||
form, that is based on (or derived from) the Work and for which the | ||
editorial revisions, annotations, elaborations, or other modifications | ||
represent, as a whole, an original work of authorship. For the purposes | ||
of this License, Derivative Works shall not include works that remain | ||
separable from, or merely link (or bind by name) to the interfaces of, | ||
the Work and Derivative Works thereof. | ||
|
||
"Contribution" shall mean any work of authorship, including | ||
the original version of the Work and any modifications or additions | ||
to that Work or Derivative Works thereof, that is intentionally | ||
submitted to Licensor for inclusion in the Work by the copyright owner | ||
or by an individual or Legal Entity authorized to submit on behalf of | ||
the copyright owner. For the purposes of this definition, "submitted" | ||
means any form of electronic, verbal, or written communication sent | ||
to the Licensor or its representatives, including but not limited to | ||
communication on electronic mailing lists, source code control systems, | ||
and issue tracking systems that are managed by, or on behalf of, the | ||
Licensor for the purpose of discussing and improving the Work, but | ||
excluding communication that is conspicuously marked or otherwise | ||
designated in writing by the copyright owner as "Not a Contribution." | ||
|
||
"Contributor" shall mean Licensor and any individual or Legal Entity | ||
on behalf of whom a Contribution has been received by Licensor and | ||
subsequently incorporated within the Work. | ||
|
||
2. Grant of Copyright License. Subject to the terms and conditions of | ||
this License, each Contributor hereby grants to You a perpetual, | ||
worldwide, non-exclusive, no-charge, royalty-free, irrevocable | ||
copyright license to reproduce, prepare Derivative Works of, | ||
publicly display, publicly perform, sublicense, and distribute the | ||
Work and such Derivative Works in Source or Object form. | ||
|
||
3. Grant of Patent License. Subject to the terms and conditions of | ||
this License, each Contributor hereby grants to You a perpetual, | ||
worldwide, non-exclusive, no-charge, royalty-free, irrevocable | ||
(except as stated in this section) patent license to make, have made, | ||
use, offer to sell, sell, import, and otherwise transfer the Work, | ||
where such license applies only to those patent claims licensable | ||
by such Contributor that are necessarily infringed by their | ||
Contribution(s) alone or by combination of their Contribution(s) | ||
with the Work to which such Contribution(s) was submitted. If You | ||
institute patent litigation against any entity (including a | ||
cross-claim or counterclaim in a lawsuit) alleging that the Work | ||
or a Contribution incorporated within the Work constitutes direct | ||
or contributory patent infringement, then any patent licenses | ||
granted to You under this License for that Work shall terminate | ||
as of the date such litigation is filed. | ||
|
||
4. Redistribution. You may reproduce and distribute copies of the | ||
Work or Derivative Works thereof in any medium, with or without | ||
modifications, and in Source or Object form, provided that You | ||
meet the following conditions: | ||
|
||
(a) You must give any other recipients of the Work or | ||
Derivative Works a copy of this License; and | ||
|
||
(b) You must cause any modified files to carry prominent notices | ||
stating that You changed the files; and | ||
|
||
(c) You must retain, in the Source form of any Derivative Works | ||
that You distribute, all copyright, patent, trademark, and | ||
attribution notices from the Source form of the Work, | ||
excluding those notices that do not pertain to any part of | ||
the Derivative Works; and | ||
|
||
(d) If the Work includes a "NOTICE" text file as part of its | ||
distribution, then any Derivative Works that You distribute must | ||
include a readable copy of the attribution notices contained | ||
within such NOTICE file, excluding those notices that do not | ||
pertain to any part of the Derivative Works, in at least one | ||
of the following places: within a NOTICE text file distributed | ||
as part of the Derivative Works; within the Source form or | ||
documentation, if provided along with the Derivative Works; or, | ||
within a display generated by the Derivative Works, if and | ||
wherever such third-party notices normally appear. The contents | ||
of the NOTICE file are for informational purposes only and | ||
do not modify the License. You may add Your own attribution | ||
notices within Derivative Works that You distribute, alongside | ||
or as an addendum to the NOTICE text from the Work, provided | ||
that such additional attribution notices cannot be construed | ||
as modifying the License. | ||
|
||
You may add Your own copyright statement to Your modifications and | ||
may provide additional or different license terms and conditions | ||
for use, reproduction, or distribution of Your modifications, or | ||
for any such Derivative Works as a whole, provided Your use, | ||
reproduction, and distribution of the Work otherwise complies with | ||
the conditions stated in this License. | ||
|
||
5. Submission of Contributions. Unless You explicitly state otherwise, | ||
any Contribution intentionally submitted for inclusion in the Work | ||
by You to the Licensor shall be under the terms and conditions of | ||
this License, without any additional terms or conditions. | ||
Notwithstanding the above, nothing herein shall supersede or modify | ||
the terms of any separate license agreement you may have executed | ||
with Licensor regarding such Contributions. | ||
|
||
6. Trademarks. This License does not grant permission to use the trade | ||
names, trademarks, service marks, or product names of the Licensor, | ||
except as required for reasonable and customary use in describing the | ||
origin of the Work and reproducing the content of the NOTICE file. | ||
|
||
7. Disclaimer of Warranty. Unless required by applicable law or | ||
agreed to in writing, Licensor provides the Work (and each | ||
Contributor provides its Contributions) on an "AS IS" BASIS, | ||
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or | ||
implied, including, without limitation, any warranties or conditions | ||
of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A | ||
PARTICULAR PURPOSE. You are solely responsible for determining the | ||
appropriateness of using or redistributing the Work and assume any | ||
risks associated with Your exercise of permissions under this License. | ||
|
||
8. Limitation of Liability. In no event and under no legal theory, | ||
whether in tort (including negligence), contract, or otherwise, | ||
unless required by applicable law (such as deliberate and grossly | ||
negligent acts) or agreed to in writing, shall any Contributor be | ||
liable to You for damages, including any direct, indirect, special, | ||
incidental, or consequential damages of any character arising as a | ||
result of this License or out of the use or inability to use the | ||
Work (including but not limited to damages for loss of goodwill, | ||
work stoppage, computer failure or malfunction, or any and all | ||
other commercial damages or losses), even if such Contributor | ||
has been advised of the possibility of such damages. | ||
|
||
9. Accepting Warranty or Additional Liability. While redistributing | ||
the Work or Derivative Works thereof, You may choose to offer, | ||
and charge a fee for, acceptance of support, warranty, indemnity, | ||
or other liability obligations and/or rights consistent with this | ||
License. However, in accepting such obligations, You may act only | ||
on Your own behalf and on Your sole responsibility, not on behalf | ||
of any other Contributor, and only if You agree to indemnify, | ||
defend, and hold each Contributor harmless for any liability | ||
incurred by, or claims asserted against, such Contributor by reason | ||
of your accepting any such warranty or additional liability. | ||
|
||
END OF TERMS AND CONDITIONS | ||
|
||
APPENDIX: How to apply the Apache License to your work. | ||
|
||
To apply the Apache License to your work, attach the following | ||
boilerplate notice, with the fields enclosed by brackets "[]" | ||
replaced with your own identifying information. (Don't include | ||
the brackets!) The text should be enclosed in the appropriate | ||
comment syntax for the file format. We also recommend that a | ||
file or class name and description of purpose be included on the | ||
same "printed page" as the copyright notice for easier | ||
identification within third-party archives. | ||
|
||
Copyright [yyyy] [name of copyright owner] | ||
|
||
Licensed under the Apache License, Version 2.0 (the "License"); | ||
you may not use this file except in compliance with the License. | ||
You may obtain a copy of the License at | ||
|
||
http://www.apache.org/licenses/LICENSE-2.0 | ||
|
||
Unless required by applicable law or agreed to in writing, software | ||
distributed under the License is distributed on an "AS IS" BASIS, | ||
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. | ||
See the License for the specific language governing permissions and | ||
limitations under the License. |
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,158 @@ | ||
--- | ||
Title: Personalized Federated Learning using Hypernetworks | ||
Url: https://arxiv.org/abs/2103.04628 | ||
Labels: [data heterogenity, hypernetworks, personalised FL,] | ||
Dataset: [MNIST, CIFAR-10, CIFAR-100] | ||
--- | ||
|
||
# Personalized Federated Learning using Hypernetworks | ||
|
||
> Note: If you use this baseline in your work, please remember to cite the original authors of the paper as well as the Flower paper. | ||
|
||
**Paper:** [arxiv.org/abs/2103.04628](https://arxiv.org/abs/2103.04628) | ||
|
||
**Authors:** Aviv Shamsian, Aviv Navon, Ethan Fetaya, Gal Chechik | ||
|
||
**Abstract:** Personalized federated learning is tasked with training machine learning models for multiple clients, each with its own data distribution. The goal is to train personalized models in a collaborative way while accounting for data disparities across clients and reducing communication costs. We propose a novel approach to this problem using hypernetworks, termed pFedHN for personalized Federated HyperNetworks. In this approach, a central hypernetwork model is trained to generate a set of models, one model for each client. This architecture provides effective parameter sharing across clients, while maintaining the capacity to generate unique and diverse personal models. Furthermore, since hypernetwork parameters are never transmitted, this approach decouples the communication cost from the trainable model size. We test pFedHN empirically in several personalized federated learning challenges and find that it outperforms previous methods. Finally, since hypernetworks share information across clients we show that pFedHN can generalize better to new clients whose distributions differ from any client observed during training. | ||
|
||
## About this baseline | ||
|
||
**What’s implemented:** The code in the repository reproduces the paper by implementing the concept of hypernetworks which create weights for that target network thus resolving the problems of dataheterogenity. The hypernetworks lies in the server and the clients have the target model. Initially hypernetwork sends the weights from the server which is loaded into the target net. After the targetnet is trained we pass the delta_theta to the client, which inturn updated the phi_gradients for the hypernetwork and the flow goes on. | ||
|
||
**Datasets:** MNIST, CIFAR-10, CIFAR-100 from torchvision | ||
|
||
**Hardware Setup:** All of the experiments were run on the 12-core CPU of a MacBook Pro M2 Pro with 32GB of RAM. | ||
|
||
**Contributors:** | ||
--- | ||
| Names | Profiles | | ||
| ----------- | ----------- | | ||
| Ram Samarth B B | [achiverram28](https://github.com/achiverram28) | | ||
| Kishan Gurumurthy | [kishan-droid](https://github.com/kishan-droid) | | ||
| Sachin DN | [sachugowda](https://github.com/sachugowda) | | ||
--- | ||
|
||
## Experimental Setup | ||
|
||
**Task:** Image Classification | ||
|
||
**Model:** CNNHyper for the HyperNetwork , CNNTarget For the TargetNetwork | ||
|
||
**Dataset:** This baseline includes the MNIST, CIFAR-10 , CIFAR-100 datasets. By default it will be partitioned into 50 clients following Non-IID distribution. The settings are as follow: | ||
|
||
| Dataset | #classes | partitioning method | classes per client | | ||
| :------ | :---: | :---: | :---: | | ||
| MNIST | 10 | Non-IID | 2 | | ||
| CIFAR10 | 10<br>100 | Non-IID | 2<br>10 | | ||
|
||
|
||
**Training Hyperparameters:** The following table shows the main hyperparameters for this baseline with their default value (i.e. the value used if you run `python3 -m pFedHN.main` directly) | ||
|
||
| Description | Default Value | | ||
| ----------- | ----- | | ||
| Data Partition | Non - IID | | ||
| Dataset | CIFAR-10 | | ||
| Batch size | 64 | | ||
| Classes per client | 2| | ||
| Total clients | 50 | | ||
| Tocal epoch(client-side) | 50 | | ||
| Number of rounds | 5000 | | ||
| HyperNetwork hidden units for CIFAR-10/CIFAR-100 | 3 | | ||
| HyperNetwork hidden units for MNIST | 1 | | ||
| HyperNetwork learning rate | 1e-2 | | ||
| HyperNetwork momentum | 0.9 | | ||
| HyperNetwork weight decay | 1e-3 | | ||
| HyperNetwork Optimizer | SGD with momentum and weight decay | | ||
| TargetNetwork learning rate | 5e-3 | | ||
| TargetNetwork momentum | 0.9 | | ||
| TargetNetwork weight decay | 5e-5 | | ||
| TargetNetwork Optimizer | SGD with momentum and weight decay | | ||
**Target Model Variations** | ||
| **Dataset** | CIFAR-10 | | ||
| Number of input channels | 3 | | ||
| Input Image Dimension | 32x32 | | ||
| Number of classes | 10 | | ||
| Kernels | 16 | | ||
| **Dataset** | CIFAR-100 | | ||
| Number of input channels | 3 | | ||
| Input Image Dimension | 32x32 | | ||
| Number of classes | 100 | | ||
| Kernels | 16 | | ||
| **Dataset** | MNIST | | ||
| Number of input channels | 1 | | ||
| Input Image Dimension | 28x28 | | ||
| Number of classes | 10 | | ||
| Kernels | 7 | | ||
| Local Layer for pFedHN | False | | ||
| Local Layer for pFedHNPC | True | | ||
| Learning rate for pFedHNPC | 5e-2 | | ||
|
||
|
||
|
||
|
||
## Environment Setup | ||
|
||
|
||
To construct the Python environment follow these steps: | ||
|
||
```bash | ||
# Set Python 3.10 | ||
pyenv local 3.10.11 | ||
|
||
# Tell poetry to use python 3.10 | ||
poetry env use 3.10.11 | ||
|
||
# Install the base Poetry environment | ||
poetry install | ||
|
||
# Activate the environment | ||
poetry shell | ||
``` | ||
|
||
## Running the Experiments | ||
|
||
To run this pFedHN, first ensure you have activated your Poetry environment (execute `poetry shell` from this directory), then: | ||
|
||
```bash | ||
## These instructions are for the pFedHN Experiments | ||
python -m pFedHN.main # this will run using the default settings in the `conf/config.yaml` that is for the CIFAR-10 dataset | ||
|
||
python -m pFedHN.main dataset.data="cifar100" model.out_dim=100 client.num_classes_per_node=10 # this will run for the CIFAR-100 dataset where we give each client 10 classes and number of classes is 100 | ||
|
||
python -m pFedHN.main dataset.data="mnist" model.n_kernels=7 model.in_channels=1 model.n_hidden=1 # this will run for the MNIST dataset where the number of input channels is 1 , the number of hidden layers in hypernetwork is 1 and the number of kernels used in the CNNTarget is 7 | ||
|
||
## For conducting pFedHNPC Experiments follow the commands given below | ||
|
||
# For MNIST we are not conducting experiments as the paper has not done it. | ||
|
||
python -m pFedHN.main model.local=True model.variant=1 model.lr=5e-2 # this will run the pFedHNPC for CIFAR-10 dataset where local=True is for using LocalLayer and variant=1 for setting pFedHNPC . Learning rate is modified to 5e-2 | ||
|
||
python -m pFedHN.main dataset.data="cifar100" model.out_dim=100 client.num_classes_per_node=10 model.local=True model.variant=1 model.lr=5e-2 # this will run the pFedHNPC for CIFAR-100 dataset where local=True is for using LocalLayer and variant=1 for setting pFedHNPC . Learning rate is modified to 5e-2 | ||
|
||
## If you want to check out the other comparison algorithms follow below | ||
|
||
## By default for FedAvg and PerFedAvg we are taking 50 clients and 5 clients in each round for fit with a fraction fit of 0.1 for the standard results. The users can modify by this by using client.fraction_fit,client.min_fit_clients and client.min_available_clients . | ||
|
||
## FedAvg | ||
|
||
python -m pFedHN.comparison_experiments.main dataset.data="mnist" model.n_kernels=7 model.in_channels=1 # for running FedAvg for MNIST using the given Non-IID Distribution | ||
|
||
python -m pFedHN.comparison_experiments.main # for running FedAvg for CIFAR-10 dataset using the given Non-IID Distribution | ||
|
||
python -m pFedHN.comparison_experiments.main dataset.data="cifar100" model.out_dim=100 client.num_classes_per_node=10 # for running FedAvg for CIFAR-100 dataset using the given Non-IID Distribution | ||
|
||
## PerFedAvg | ||
|
||
# The number of epochs here for each client is 10. | ||
|
||
python -m pFedHN.comparison_experiments.main dataset.data="mnist" model.n_kernels=7 model.in_channels=1 model.variant=1 model.gamma=0.99 client.num_epochs=10 # for running PerFedAvg for MNIST dataset using the given Non-IID Distribution | ||
|
||
python -m pFedHN.comparison_experiments.main model.variant=1 model.lr=1e-3 client.num_epochs=10 # for running PerFedAvg for CIFAR-10 dataset using the given Non-IID Distribution | ||
|
||
python -m pFedHN.comparison_experiments.main dataset.data="cifar100" model.out_dim=100 client.num_classes_per_node=10 model.variant=1 model.beta=1e-2 model.delta=1e-2 model.lr=1e-2 model.gamma=0.95 client.num_epochs=10 # for running PerFedAvg for CIFAR-100 dataset using the given Non-IID Distribution | ||
|
||
``` | ||
|
||
## Expected Results | ||
|
||
Will be updated |
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,2 @@ | ||
# pylint: disable=invalid-name | ||
"""Template baseline package.""" |
Oops, something went wrong.
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.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think it's worth clarifying that this actually means "number of batches". If I see your
train()
function intrainer.py
, each "epoch" uses a single batch of thetrainloader
. This seems to be exactly what Algorithm 1 in the paper indicates. Maybe it would be better if you rename it to "local step"? (and make that change in the code+config as well)