Use Baselines#

Warning

We are changing the way we structure the Flower baselines. While we complete the transition to the new format, you can still find the existing baselines and use them: baselines (old). Currently, you can make use of baselines for FedAvg, FedProx, FedOpt, FedBN, and LEAF-FEMNIST.

The documentation below has been updated to reflect the new way of using Flower baselines.

Structure#

All baselines are available in the directory baselines with each baseline directory being fully self-contained in terms of source code. In addition, each baseline uses its very own Python environment as designed by the contributors of such baseline in order to replicate the experiments in the paper. Each baseline directory contains the following structure:

flower/baselines/<baseline_name>/
                      ├── README.md
                      ├── pyproject.toml
                      └── <baseline_name>
                                  ├── *.py # several .py files including main.py and __init__.py
                                  └── conf
                                        └── *.yaml # one or more Hydra config files

Please note that some baselines might include additional files (e.g. a requirements.txt) or a hierarchy of .yaml files for Hydra.

Using a Baseline#

Common to all baselines is Poetry, a tool to manage Python dependencies. You’ll need to install it on your system before running a baseline. For Linux and macOS, installing Poetry can be done from a single command:

curl -sSL https://install.python-poetry.org | python3 -

To install Poetry on a different OS, to customise your installation, or to further integrate Poetry with your shell after installation, please check the Poetry documentation.

  1. Navigate inside the directory of the baseline you’d like to run

  2. Follow the [Environment Setup] instructions in the README.md. In most cases this will require you to just do:

poetry install
  1. Run the baseline as indicated in the [Running the Experiments] section in the README.md

Available Baselines#

Note

To be updated soon once the existing baselines are adjusted to the new format.