{"id":24515575,"url":"https://github.com/stat-ml/federated_switching","last_synced_at":"2025-08-11T19:09:59.526Z","repository":{"id":250692540,"uuid":"835187008","full_name":"stat-ml/Federated_switching","owner":"stat-ml","description":null,"archived":false,"fork":false,"pushed_at":"2024-07-29T10:37:46.000Z","size":4880,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":2,"default_branch":"main","last_synced_at":"2025-03-15T10:41:42.123Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":"Python","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/stat-ml.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2024-07-29T10:35:41.000Z","updated_at":"2024-07-29T10:37:50.000Z","dependencies_parsed_at":null,"dependency_job_id":"3ca15a4d-212a-4db4-9874-1a0f62f20349","html_url":"https://github.com/stat-ml/Federated_switching","commit_stats":null,"previous_names":["stat-ml/federated_switching"],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/stat-ml/Federated_switching","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/stat-ml%2FFederated_switching","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/stat-ml%2FFederated_switching/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/stat-ml%2FFederated_switching/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/stat-ml%2FFederated_switching/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/stat-ml","download_url":"https://codeload.github.com/stat-ml/Federated_switching/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/stat-ml%2FFederated_switching/sbom","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":269939955,"owners_count":24500374,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","status":"online","status_checked_at":"2025-08-11T02:00:10.019Z","response_time":75,"last_error":null,"robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":true,"can_crawl_api":true,"host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":[],"created_at":"2025-01-22T01:18:27.583Z","updated_at":"2025-08-11T19:09:59.518Z","avatar_url":"https://github.com/stat-ml.png","language":"Python","funding_links":[],"categories":[],"sub_categories":[],"readme":"---\n\n# Complementary Code for IJCAI 2024 Submission\n\nThis repository provides supplemental material for our IJCAI 2024 paper submission titled **\"Dirichlet-based Uncertainty Quantification for Personalized Federated Learning with Improved Posterior Networks\"**. The codebase has been substantially derived from the publicly available [Federated Learning benchmark](https://github.com/KarhouTam/FL-bench) and the [Posterior Networks/Natural Posterior Networks code](https://github.com/borchero/natural-posterior-network).\n\n## Code Structure\n\nThere are two folders in the root. Both are heavily based on the repository mentioned above.\n\n### FedPN\n\nIn the ``FedPN'' folder, there is a code for training FedPN model and for conduction corresponding experiments.\n\nThe root directory contains several bash scripts that initiate experiments and save the resulting models. After setting up a virtual environment with the necessary packages specified in `requirements.txt` and generating the requisite data, these scripts can be executed to train the models.\n\nA distinct notebook is provided for each experiment under the 'experiments' section. These notebooks are instrumental in generating all the figures and tables presented in the paper.\n\n## Data Generation\n\nTo generate the necessary data, follow the steps outlined below:\n\n1. Navigate to the directory `FL-bench/data/utils`. Depending on the experiment you wish to conduct, execute the appropriate command:\n   - For heterogeneous training (referenced in Tables), run the following command for each dataset:\n     ```\n     python run.py -d cifar10 -c 3 -cn 20\n     ```\n     Substitute `cifar10` with the name of your chosen dataset.\n     \n   - For centralized training with a noisy (aleatoric) dataset, execute:\n     ```\n     python run.py -d noisy_mnist --iid 1 -cn 1\n     ```\n\n2. The data for the toy experiment will be automatically generated when running the `toy_script.sh` script.\n\nOnce the data is generated, you may commence model training using the `runall_script.sh` script. This will save the models into `out/FedAvg/`.\n\nYou can then use this path to run the notebooks and reproduce the results.\n\n### Benchmarks\n\n\nThis folder is pretty much the same as another one, as both are based on the same codebase. \n\nWithin ``FL-bench'' repository there is a training script ``launch_all.sh'' for each of the models (you can choose whichever dataset you want).\n\nThen, in the root, there are two files: ``load_models.py'' and ``postproc.py''. They will produce data for the tables.\n\n---","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fstat-ml%2Ffederated_switching","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fstat-ml%2Ffederated_switching","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fstat-ml%2Ffederated_switching/lists"}