From 75b8669899694528f06bbb00b818a901116d0f19 Mon Sep 17 00:00:00 2001 From: Charles Beauville Date: Tue, 25 Jun 2024 17:53:32 +0200 Subject: [PATCH 01/66] docs(examples:skip) Improve example docs generation script --- ...date-examples.sh => build-example-docs.sh} | 62 +++++++++++++++++++ 1 file changed, 62 insertions(+) rename dev/{update-examples.sh => build-example-docs.sh} (59%) diff --git a/dev/update-examples.sh b/dev/build-example-docs.sh similarity index 59% rename from dev/update-examples.sh rename to dev/build-example-docs.sh index 1076b4621984..12db9a0a5ebd 100755 --- a/dev/update-examples.sh +++ b/dev/build-example-docs.sh @@ -6,6 +6,50 @@ ROOT=`pwd` INDEX=$ROOT/examples/doc/source/index.md INSERT_LINE=6 +initial_text=$(cat <<-END +.. toctree:: + :maxdepth: 1 + :caption: References +END +) + +table_body="\\ +.. list-table:: \\ + :widths: 15 15 50\\ + :header-rows: 1\\ + \\ + * - Method\\ + - Dataset\\ + - Tags\\ + .. BASELINES_TABLE_ENTRY\\ + " + +function add_table_entry () +{ + # extract lines from markdown file between --- and ---, preserving newlines and store in variable called metadata + metadata=$(awk '/^---$/{flag=1; next} flag; /^---$/{exit}' $1/README.md) + + # get text after "title:" in metadata using sed + title=$(echo "$metadata" | sed -n 's/title: //p') + + # get text after "url:" in metadata using sed + url=$(echo "$metadata" | sed -n 's/url: //p') + + # get text after "labels:" in metadata using sed + labels=$(echo "$metadata" | sed -n 's/labels: //p' | sed 's/\[//g; s/\]//g') + + # get text after "dataset:" in metadata using sed + dataset=$(echo "$metadata" | sed -n 's/dataset: //p' | sed 's/\[//g; s/\]//g') + + table_entry="\\ + * - \`$1 <$1.html>\`_\\ + - $dataset\\ + - $labels\\ + \\ +.. BASELINES_TABLE_ENTRY\ + " +} + copy_markdown_files () { for file in $1/*.md; do # Copy the README into the source of the Example docs as the name of the example @@ -81,6 +125,24 @@ touch $INDEX echo "# Flower Examples Documentation" >> $INDEX echo "" >> $INDEX + + +! sed -i '' -e "s/.. BASELINES_TABLE_ANCHOR/$table_body/" $INDEX + +! grep -q ":caption: References" $INDEX && echo "$initial_text" >> $INDEX && echo "" >> $INDEX + +cd $ROOT/examples +# Iterate through each folder in examples/ +for d in $(printf '%s\n' */ | sort -V); do + # Add entry based on the name of the folder + example=${d%/} + + if [[ $example != doc ]]; then + add_table_entry $example + ! sed -i '' -e "s/.. BASELINES_TABLE_ENTRY/$table_entry/" $INDEX + fi +done + echo "\`\`\`{toctree}" >> $INDEX echo "---" >> $INDEX echo "maxdepth: 1" >> $INDEX From 509e2e34a305df844c9e8db5d6545e2e5b625e51 Mon Sep 17 00:00:00 2001 From: Charles Beauville Date: Tue, 25 Jun 2024 17:58:39 +0200 Subject: [PATCH 02/66] Test script --- dev/build-example-docs.sh | 42 ++++++++++++++++++++++++--------------- 1 file changed, 26 insertions(+), 16 deletions(-) diff --git a/dev/build-example-docs.sh b/dev/build-example-docs.sh index 12db9a0a5ebd..966672dc1179 100755 --- a/dev/build-example-docs.sh +++ b/dev/build-example-docs.sh @@ -3,7 +3,7 @@ set -e cd "$( cd "$( dirname "${BASH_SOURCE[0]}" )" >/dev/null 2>&1 && pwd )"/../ ROOT=`pwd` -INDEX=$ROOT/examples/doc/source/index.md +INDEX=$ROOT/examples/doc/source/index.rst INSERT_LINE=6 initial_text=$(cat <<-END @@ -30,16 +30,20 @@ function add_table_entry () metadata=$(awk '/^---$/{flag=1; next} flag; /^---$/{exit}' $1/README.md) # get text after "title:" in metadata using sed - title=$(echo "$metadata" | sed -n 's/title: //p') + # title=$(echo "$metadata" | sed -n 's/title: //p') + title=$1 # get text after "url:" in metadata using sed - url=$(echo "$metadata" | sed -n 's/url: //p') + # url=$(echo "$metadata" | sed -n 's/url: //p') + url=$1 # get text after "labels:" in metadata using sed - labels=$(echo "$metadata" | sed -n 's/labels: //p' | sed 's/\[//g; s/\]//g') + # labels=$(echo "$metadata" | sed -n 's/labels: //p' | sed 's/\[//g; s/\]//g') + labels=$1 # get text after "dataset:" in metadata using sed - dataset=$(echo "$metadata" | sed -n 's/dataset: //p' | sed 's/\[//g; s/\]//g') + # dataset=$(echo "$metadata" | sed -n 's/dataset: //p' | sed 's/\[//g; s/\]//g') + dataset=$1 table_entry="\\ * - \`$1 <$1.html>\`_\\ @@ -126,10 +130,7 @@ touch $INDEX echo "# Flower Examples Documentation" >> $INDEX echo "" >> $INDEX - -! sed -i '' -e "s/.. BASELINES_TABLE_ANCHOR/$table_body/" $INDEX - -! grep -q ":caption: References" $INDEX && echo "$initial_text" >> $INDEX && echo "" >> $INDEX +echo "$initial_text" >> $INDEX && echo "" >> $INDEX cd $ROOT/examples # Iterate through each folder in examples/ @@ -138,16 +139,25 @@ for d in $(printf '%s\n' */ | sort -V); do example=${d%/} if [[ $example != doc ]]; then + + # Copy markdown files to correct folder + copy_markdown_files $1 + + # Add button linked to GitHub + add_gh_button $1 + + # Copy all images of the _static folder into the examples + # docs static folder + copy_images $1 add_table_entry $example - ! sed -i '' -e "s/.. BASELINES_TABLE_ENTRY/$table_entry/" $INDEX fi done -echo "\`\`\`{toctree}" >> $INDEX -echo "---" >> $INDEX -echo "maxdepth: 1" >> $INDEX -echo "---" >> $INDEX +# echo "\`\`\`{toctree}" >> $INDEX +# echo "---" >> $INDEX +# echo "maxdepth: 1" >> $INDEX +# echo "---" >> $INDEX -add_all_entries +# add_all_entries -echo "\`\`\`" >> $INDEX +# echo "\`\`\`" >> $INDEX From 2b9fc1d3e1e1929a3f0414f701631c3a99840447 Mon Sep 17 00:00:00 2001 From: Charles Beauville Date: Tue, 25 Jun 2024 18:04:25 +0200 Subject: [PATCH 03/66] fix script --- dev/build-example-docs.sh | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/dev/build-example-docs.sh b/dev/build-example-docs.sh index 966672dc1179..e11469114758 100755 --- a/dev/build-example-docs.sh +++ b/dev/build-example-docs.sh @@ -141,14 +141,14 @@ for d in $(printf '%s\n' */ | sort -V); do if [[ $example != doc ]]; then # Copy markdown files to correct folder - copy_markdown_files $1 + copy_markdown_files $example # Add button linked to GitHub - add_gh_button $1 + add_gh_button $example # Copy all images of the _static folder into the examples # docs static folder - copy_images $1 + copy_images $example add_table_entry $example fi done From 07a403988c64176f7f7e21996fa56c5b00db4369 Mon Sep 17 00:00:00 2001 From: Charles Beauville Date: Tue, 25 Jun 2024 18:28:05 +0200 Subject: [PATCH 04/66] Add initial metadata --- dev/build-example-docs.sh | 10 ++++++++-- examples/advanced-pytorch/README.md | 7 +++++++ examples/advanced-tensorflow/README.md | 7 +++++++ examples/android-kotlin/README.md | 7 +++++++ examples/android/README.md | 7 +++++++ examples/app-pytorch/README.md | 7 +++++++ examples/app-secure-aggregation/README.md | 7 +++++++ examples/custom-metrics/README.md | 7 +++++++ examples/custom-mods/README.md | 7 +++++++ examples/embedded-devices/README.md | 7 +++++++ examples/federated-kaplan-meier-fitter/README.md | 7 +++++++ examples/fl-dp-sa/README.md | 7 +++++++ examples/fl-tabular/README.md | 7 +++++++ examples/flower-authentication/README.md | 7 +++++++ examples/flower-in-30-minutes/README.md | 7 +++++++ .../flower-simulation-step-by-step-pytorch/README.md | 7 +++++++ examples/flower-via-docker-compose/README.md | 7 +++++++ examples/ios/README.md | 7 +++++++ examples/llm-flowertune/README.md | 7 +++++++ examples/opacus/README.md | 7 +++++++ .../README.md | 7 +++++++ .../pytorch-from-centralized-to-federated/README.md | 7 +++++++ examples/quickstart-cpp/README.md | 7 +++++++ examples/quickstart-fastai/README.md | 7 +++++++ examples/quickstart-huggingface/README.md | 7 +++++++ examples/quickstart-jax/README.md | 7 +++++++ examples/quickstart-mlcube/README.md | 7 +++++++ examples/quickstart-mlx/README.md | 7 +++++++ examples/quickstart-monai/README.md | 7 +++++++ examples/quickstart-pandas/README.md | 7 +++++++ examples/quickstart-pytorch-lightning/README.md | 7 +++++++ examples/quickstart-pytorch/README.md | 7 +++++++ examples/quickstart-sklearn-tabular/README.md | 7 +++++++ examples/quickstart-tabnet/README.md | 7 +++++++ examples/quickstart-tensorflow/README.md | 7 +++++++ examples/simulation-pytorch/README.md | 7 +++++++ examples/simulation-tensorflow/README.md | 7 +++++++ examples/sklearn-logreg-mnist/README.md | 7 +++++++ examples/tensorflow-privacy/README.md | 7 +++++++ examples/vertical-fl/README.md | 7 +++++++ examples/vit-finetune/README.md | 7 +++++++ examples/whisper-federated-finetuning/README.md | 7 +++++++ examples/xgboost-comprehensive/README.md | 7 +++++++ examples/xgboost-quickstart/README.md | 7 +++++++ 44 files changed, 309 insertions(+), 2 deletions(-) diff --git a/dev/build-example-docs.sh b/dev/build-example-docs.sh index e11469114758..d50cd1f865e1 100755 --- a/dev/build-example-docs.sh +++ b/dev/build-example-docs.sh @@ -27,7 +27,7 @@ table_body="\\ function add_table_entry () { # extract lines from markdown file between --- and ---, preserving newlines and store in variable called metadata - metadata=$(awk '/^---$/{flag=1; next} flag; /^---$/{exit}' $1/README.md) + # metadata=$(awk '/^---$/{flag=1; next} flag; /^---$/{exit}' $1/README.md) # get text after "title:" in metadata using sed # title=$(echo "$metadata" | sed -n 's/title: //p') @@ -129,8 +129,13 @@ touch $INDEX echo "# Flower Examples Documentation" >> $INDEX echo "" >> $INDEX +echo ".. BASELINES_TABLE_ANCHOR" >> $INDEX -echo "$initial_text" >> $INDEX && echo "" >> $INDEX +# echo "$initial_text" >> $INDEX && echo "" >> $INDEX + +! sed -i '' -e "s/.. BASELINES_TABLE_ANCHOR/$table_body/" $INDEX + +! grep -q ":caption: References" $INDEX && echo "$initial_text" >> $INDEX && echo "" >> $INDEX cd $ROOT/examples # Iterate through each folder in examples/ @@ -150,6 +155,7 @@ for d in $(printf '%s\n' */ | sort -V); do # docs static folder copy_images $example add_table_entry $example + ! sed -i '' -e "s/.. BASELINES_TABLE_ENTRY/$table_entry/" $INDEX fi done diff --git a/examples/advanced-pytorch/README.md b/examples/advanced-pytorch/README.md index c1ba85b95879..f42c822a9e4c 100644 --- a/examples/advanced-pytorch/README.md +++ b/examples/advanced-pytorch/README.md @@ -1,3 +1,10 @@ +--- +title: "Simple Flower Example using PyTorch" +url: https://pytorch.org/ +labels: [basic, vision, fds] +dataset: [CIFAR-10] +--- + # Advanced Flower Example (PyTorch) This example demonstrates an advanced federated learning setup using Flower with PyTorch. This example uses [Flower Datasets](https://flower.ai/docs/datasets/) and it differs from the quickstart example in the following ways: diff --git a/examples/advanced-tensorflow/README.md b/examples/advanced-tensorflow/README.md index 94707b5cbc98..c6d131392e72 100644 --- a/examples/advanced-tensorflow/README.md +++ b/examples/advanced-tensorflow/README.md @@ -1,3 +1,10 @@ +--- +title: "Simple Flower Example using PyTorch" +url: https://pytorch.org/ +labels: [basic, vision, fds] +dataset: [CIFAR-10] +--- + # Advanced Flower Example (TensorFlow/Keras) This example demonstrates an advanced federated learning setup using Flower with TensorFlow/Keras. This example uses [Flower Datasets](https://flower.ai/docs/datasets/) and it differs from the quickstart example in the following ways: diff --git a/examples/android-kotlin/README.md b/examples/android-kotlin/README.md index 2d0f704fdc0e..ad7e2ed4589c 100644 --- a/examples/android-kotlin/README.md +++ b/examples/android-kotlin/README.md @@ -1,3 +1,10 @@ +--- +title: "Simple Flower Example using PyTorch" +url: https://pytorch.org/ +labels: [basic, vision, fds] +dataset: [CIFAR-10] +--- + # Flower Android Client Example with Kotlin and TensorFlow Lite 2022 This example is similar to the Flower Android Example in Java: diff --git a/examples/android/README.md b/examples/android/README.md index f9f2bb93b8dc..aa94bdbf5b33 100644 --- a/examples/android/README.md +++ b/examples/android/README.md @@ -1,3 +1,10 @@ +--- +title: "Simple Flower Example using PyTorch" +url: https://pytorch.org/ +labels: [basic, vision, fds] +dataset: [CIFAR-10] +--- + # Flower Android Example (TensorFlowLite) This example demonstrates a federated learning setup with Android clients in a background thread. The training on Android is done on a CIFAR10 dataset using TensorFlow Lite. The setup is as follows: diff --git a/examples/app-pytorch/README.md b/examples/app-pytorch/README.md index 14de3c7d632e..e9a6e0ee4a86 100644 --- a/examples/app-pytorch/README.md +++ b/examples/app-pytorch/README.md @@ -1,3 +1,10 @@ +--- +title: "Simple Flower Example using PyTorch" +url: https://pytorch.org/ +labels: [basic, vision, fds] +dataset: [CIFAR-10] +--- + # Flower App (PyTorch) 🧪 > 🧪 = This example covers experimental features that might change in future versions of Flower diff --git a/examples/app-secure-aggregation/README.md b/examples/app-secure-aggregation/README.md index d1ea7bdc893f..51e5e61e1cd7 100644 --- a/examples/app-secure-aggregation/README.md +++ b/examples/app-secure-aggregation/README.md @@ -1,3 +1,10 @@ +--- +title: "Simple Flower Example using PyTorch" +url: https://pytorch.org/ +labels: [basic, vision, fds] +dataset: [CIFAR-10] +--- + # Secure aggregation with Flower (the SecAgg+ protocol) 🧪 > 🧪 = This example covers experimental features that might change in future versions of Flower diff --git a/examples/custom-metrics/README.md b/examples/custom-metrics/README.md index 317fb6336106..3e867698563e 100644 --- a/examples/custom-metrics/README.md +++ b/examples/custom-metrics/README.md @@ -1,3 +1,10 @@ +--- +title: "Simple Flower Example using PyTorch" +url: https://pytorch.org/ +labels: [basic, vision, fds] +dataset: [CIFAR-10] +--- + # Flower Example using Custom Metrics This simple example demonstrates how to calculate custom metrics over multiple clients beyond the traditional ones available in the ML frameworks. In this case, it demonstrates the use of ready-available `scikit-learn` metrics: accuracy, recall, precision, and f1-score. diff --git a/examples/custom-mods/README.md b/examples/custom-mods/README.md index 6b03abcfbfe0..9224fc689473 100644 --- a/examples/custom-mods/README.md +++ b/examples/custom-mods/README.md @@ -1,3 +1,10 @@ +--- +title: "Simple Flower Example using PyTorch" +url: https://pytorch.org/ +labels: [basic, vision, fds] +dataset: [CIFAR-10] +--- + # Using custom mods 🧪 > 🧪 = This example covers experimental features that might change in future versions of Flower diff --git a/examples/embedded-devices/README.md b/examples/embedded-devices/README.md index f1c5931b823a..4d048d137a28 100644 --- a/examples/embedded-devices/README.md +++ b/examples/embedded-devices/README.md @@ -1,3 +1,10 @@ +--- +title: "Simple Flower Example using PyTorch" +url: https://pytorch.org/ +labels: [basic, vision, fds] +dataset: [CIFAR-10] +--- + # Federated Learning on Embedded Devices with Flower This example will show you how Flower makes it very easy to run Federated Learning workloads on edge devices. Here we'll be showing how to use NVIDIA Jetson devices and Raspberry Pi as Flower clients. You can run this example using either PyTorch or Tensorflow. The FL workload (i.e. model, dataset and training loop) is mostly borrowed from the [quickstart-pytorch](https://github.com/adap/flower/tree/main/examples/simulation-pytorch) and [quickstart-tensorflow](https://github.com/adap/flower/tree/main/examples/quickstart-tensorflow) examples. diff --git a/examples/federated-kaplan-meier-fitter/README.md b/examples/federated-kaplan-meier-fitter/README.md index 1569467d6f82..7e7bc79b293d 100644 --- a/examples/federated-kaplan-meier-fitter/README.md +++ b/examples/federated-kaplan-meier-fitter/README.md @@ -1,3 +1,10 @@ +--- +title: "Simple Flower Example using PyTorch" +url: https://pytorch.org/ +labels: [basic, vision, fds] +dataset: [CIFAR-10] +--- + # Flower Example using KaplanMeierFitter This is an introductory example on **federated survival analysis** using [Flower](https://flower.ai/) diff --git a/examples/fl-dp-sa/README.md b/examples/fl-dp-sa/README.md index 47eedb70a2b8..925896f0271c 100644 --- a/examples/fl-dp-sa/README.md +++ b/examples/fl-dp-sa/README.md @@ -1,3 +1,10 @@ +--- +title: "Simple Flower Example using PyTorch" +url: https://pytorch.org/ +labels: [basic, vision, fds] +dataset: [CIFAR-10] +--- + # fl_dp_sa This is a simple example that utilizes central differential privacy with client-side fixed clipping and secure aggregation. diff --git a/examples/fl-tabular/README.md b/examples/fl-tabular/README.md index 58afd1080b70..0b0d367c1913 100644 --- a/examples/fl-tabular/README.md +++ b/examples/fl-tabular/README.md @@ -1,3 +1,10 @@ +--- +title: "Simple Flower Example using PyTorch" +url: https://pytorch.org/ +labels: [basic, vision, fds] +dataset: [CIFAR-10] +--- + # Flower Example on Adult Census Income Tabular Dataset This code exemplifies a federated learning setup using the Flower framework on the ["Adult Census Income"](https://huggingface.co/datasets/scikit-learn/adult-census-income) tabular dataset. The "Adult Census Income" dataset contains demographic information such as age, education, occupation, etc., with the target attribute being income level (\<=50K or >50K). The dataset is partitioned into subsets, simulating a federated environment with 5 clients, each holding a distinct portion of the data. Categorical variables are one-hot encoded, and the data is split into training and testing sets. Federated learning is conducted using the FedAvg strategy for 5 rounds. diff --git a/examples/flower-authentication/README.md b/examples/flower-authentication/README.md index 589270e621c9..1b86f6cbdf85 100644 --- a/examples/flower-authentication/README.md +++ b/examples/flower-authentication/README.md @@ -1,3 +1,10 @@ +--- +title: "Simple Flower Example using PyTorch" +url: https://pytorch.org/ +labels: [basic, vision, fds] +dataset: [CIFAR-10] +--- + # Flower Authentication with PyTorch 🧪 > 🧪 = This example covers experimental features that might change in future versions of Flower diff --git a/examples/flower-in-30-minutes/README.md b/examples/flower-in-30-minutes/README.md index 5fd9b882413b..e1d14a762f00 100644 --- a/examples/flower-in-30-minutes/README.md +++ b/examples/flower-in-30-minutes/README.md @@ -1,3 +1,10 @@ +--- +title: "Simple Flower Example using PyTorch" +url: https://pytorch.org/ +labels: [basic, vision, fds] +dataset: [CIFAR-10] +--- + # 30-minute tutorial running Flower simulation with PyTorch This README links to a Jupyter notebook that you can either download and run locally or [![open it in Colab](https://colab.research.google.com/assets/colab-badge.svg)](https://colab.research.google.com/github/adap/flower/blob/main/examples/flower-in-30-minutes/tutorial.ipynb). This is a short 30-minute (or less!) tutorial showcasing the basics of Flower federated learning simulations using PyTorch. diff --git a/examples/flower-simulation-step-by-step-pytorch/README.md b/examples/flower-simulation-step-by-step-pytorch/README.md index beb8dd7f6f95..13d907e76e8e 100644 --- a/examples/flower-simulation-step-by-step-pytorch/README.md +++ b/examples/flower-simulation-step-by-step-pytorch/README.md @@ -1,3 +1,10 @@ +--- +title: "Simple Flower Example using PyTorch" +url: https://pytorch.org/ +labels: [basic, vision, fds] +dataset: [CIFAR-10] +--- + # Flower Simulation Step-by-Step > Since this tutorial (and its video series) was put together, Flower has been updated a few times. As a result, some of the steps to construct the environment (see below) have been updated. Some parts of the code have also been updated. Overall, the content of this tutorial and how things work remains the same as in the video tutorials. diff --git a/examples/flower-via-docker-compose/README.md b/examples/flower-via-docker-compose/README.md index 3ef1ac37bcda..424dcd124853 100644 --- a/examples/flower-via-docker-compose/README.md +++ b/examples/flower-via-docker-compose/README.md @@ -1,3 +1,10 @@ +--- +title: "Simple Flower Example using PyTorch" +url: https://pytorch.org/ +labels: [basic, vision, fds] +dataset: [CIFAR-10] +--- + # Leveraging Flower and Docker for Device Heterogeneity Management in Federated Learning

diff --git a/examples/ios/README.md b/examples/ios/README.md index 4e17e7a674f3..3cec3a777b2d 100644 --- a/examples/ios/README.md +++ b/examples/ios/README.md @@ -1,3 +1,10 @@ +--- +title: "Simple Flower Example using PyTorch" +url: https://pytorch.org/ +labels: [basic, vision, fds] +dataset: [CIFAR-10] +--- + # FLiOS - A Flower SDK for iOS Devices with Example FLiOS is a sample application for testing and benchmarking the Swift implementation of Flower. The default scenario uses the MNIST dataset and the associated digit recognition model. The app includes the Swift package in `./src/swift` and allows extension for other benchmarking scenarios. The app guides the user through the steps of the machine learning process that would be executed in a normal production environment as a background task of the application. The app is therefore aimed at researchers and research institutions to test their hypotheses and perform performance analyses. diff --git a/examples/llm-flowertune/README.md b/examples/llm-flowertune/README.md index 4f98072f8c7f..703f34aa0587 100644 --- a/examples/llm-flowertune/README.md +++ b/examples/llm-flowertune/README.md @@ -1,3 +1,10 @@ +--- +title: "Simple Flower Example using PyTorch" +url: https://pytorch.org/ +labels: [basic, vision, fds] +dataset: [CIFAR-10] +--- + # LLM FlowerTune: Federated LLM Fine-tuning with Flower Large language models (LLMs), which have been trained on vast amounts of publicly accessible data, have shown remarkable effectiveness in a wide range of areas. diff --git a/examples/opacus/README.md b/examples/opacus/README.md index 6fc0d2ff49a0..31cf4405e8bb 100644 --- a/examples/opacus/README.md +++ b/examples/opacus/README.md @@ -1,3 +1,10 @@ +--- +title: "Simple Flower Example using PyTorch" +url: https://pytorch.org/ +labels: [basic, vision, fds] +dataset: [CIFAR-10] +--- + # Training with Sample-Level Differential Privacy using Opacus Privacy Engine In this example, we demonstrate how to train a model with differential privacy (DP) using Flower. We employ PyTorch and integrate the Opacus Privacy Engine to achieve sample-level differential privacy. This setup ensures robust privacy guarantees during the client training phase. The code is adapted from the [PyTorch Quickstart example](https://github.com/adap/flower/tree/main/examples/quickstart-pytorch). diff --git a/examples/pytorch-federated-variational-autoencoder/README.md b/examples/pytorch-federated-variational-autoencoder/README.md index 00af7a6328b2..01fdd2540602 100644 --- a/examples/pytorch-federated-variational-autoencoder/README.md +++ b/examples/pytorch-federated-variational-autoencoder/README.md @@ -1,3 +1,10 @@ +--- +title: "Simple Flower Example using PyTorch" +url: https://pytorch.org/ +labels: [basic, vision, fds] +dataset: [CIFAR-10] +--- + # Flower Example for Federated Variational Autoencoder using Pytorch This example demonstrates how a variational autoencoder (VAE) can be trained in a federated way using the Flower framework. diff --git a/examples/pytorch-from-centralized-to-federated/README.md b/examples/pytorch-from-centralized-to-federated/README.md index 06ee89dddcac..534daf05669a 100644 --- a/examples/pytorch-from-centralized-to-federated/README.md +++ b/examples/pytorch-from-centralized-to-federated/README.md @@ -1,3 +1,10 @@ +--- +title: "Simple Flower Example using PyTorch" +url: https://pytorch.org/ +labels: [basic, vision, fds] +dataset: [CIFAR-10] +--- + # PyTorch: From Centralized To Federated This example demonstrates how an already existing centralized PyTorch-based machine learning project can be federated with Flower. diff --git a/examples/quickstart-cpp/README.md b/examples/quickstart-cpp/README.md index d6cbeebe1bc6..a3238b153e4d 100644 --- a/examples/quickstart-cpp/README.md +++ b/examples/quickstart-cpp/README.md @@ -1,3 +1,10 @@ +--- +title: "Simple Flower Example using PyTorch" +url: https://pytorch.org/ +labels: [basic, vision, fds] +dataset: [CIFAR-10] +--- + # Flower Clients in C++ (under development) In this example you will train a linear model on synthetic data using C++ clients. diff --git a/examples/quickstart-fastai/README.md b/examples/quickstart-fastai/README.md index 38ef23c95a1e..ea54d5bf1972 100644 --- a/examples/quickstart-fastai/README.md +++ b/examples/quickstart-fastai/README.md @@ -1,3 +1,10 @@ +--- +title: "Simple Flower Example using PyTorch" +url: https://pytorch.org/ +labels: [basic, vision, fds] +dataset: [CIFAR-10] +--- + # Flower Example using fastai This introductory example to Flower uses [fastai](https://www.fast.ai/), but deep knowledge of fastai is not necessarily required to run the example. However, it will help you understand how to adapt Flower to your use case. diff --git a/examples/quickstart-huggingface/README.md b/examples/quickstart-huggingface/README.md index ce7790cd4af5..afa22d0dd612 100644 --- a/examples/quickstart-huggingface/README.md +++ b/examples/quickstart-huggingface/README.md @@ -1,3 +1,10 @@ +--- +title: "Simple Flower Example using PyTorch" +url: https://pytorch.org/ +labels: [basic, vision, fds] +dataset: [CIFAR-10] +--- + # Federated HuggingFace Transformers using Flower and PyTorch This introductory example to using [HuggingFace](https://huggingface.co) Transformers with Flower with PyTorch. This example has been extended from the [quickstart-pytorch](https://flower.ai/docs/examples/quickstart-pytorch.html) example. The training script closely follows the [HuggingFace course](https://huggingface.co/course/chapter3?fw=pt), so you are encouraged to check that out for a detailed explanation of the transformer pipeline. diff --git a/examples/quickstart-jax/README.md b/examples/quickstart-jax/README.md index 836adf558d88..03ab1d838634 100644 --- a/examples/quickstart-jax/README.md +++ b/examples/quickstart-jax/README.md @@ -1,3 +1,10 @@ +--- +title: "Simple Flower Example using PyTorch" +url: https://pytorch.org/ +labels: [basic, vision, fds] +dataset: [CIFAR-10] +--- + # JAX: From Centralized To Federated This example demonstrates how an already existing centralized JAX-based machine learning project can be federated with Flower. diff --git a/examples/quickstart-mlcube/README.md b/examples/quickstart-mlcube/README.md index 8e6fc29b3ad8..53c83bb6c451 100644 --- a/examples/quickstart-mlcube/README.md +++ b/examples/quickstart-mlcube/README.md @@ -1,3 +1,10 @@ +--- +title: "Simple Flower Example using PyTorch" +url: https://pytorch.org/ +labels: [basic, vision, fds] +dataset: [CIFAR-10] +--- + # Flower Example using TensorFlow/Keras + MLCube This introductory example to Flower uses MLCube together with Keras, but deep knowledge of Keras is not necessarily required to run the example. However, it will help you understand how to adapt Flower to your use-cases with MLCube. Running this example in itself is quite easy. diff --git a/examples/quickstart-mlx/README.md b/examples/quickstart-mlx/README.md index cca55bcb946a..847e6fed8637 100644 --- a/examples/quickstart-mlx/README.md +++ b/examples/quickstart-mlx/README.md @@ -1,3 +1,10 @@ +--- +title: "Simple Flower Example using PyTorch" +url: https://pytorch.org/ +labels: [basic, vision, fds] +dataset: [CIFAR-10] +--- + # Flower Example using MLX This introductory example to Flower uses [MLX](https://ml-explore.github.io/mlx/build/html/index.html), but deep knowledge of MLX is not necessarily required to run the example. However, it will help you understand how to adapt Flower to your use case. Running this example in itself is quite easy. diff --git a/examples/quickstart-monai/README.md b/examples/quickstart-monai/README.md index 4a9afef4f86a..443f6b2041a4 100644 --- a/examples/quickstart-monai/README.md +++ b/examples/quickstart-monai/README.md @@ -1,3 +1,10 @@ +--- +title: "Simple Flower Example using PyTorch" +url: https://pytorch.org/ +labels: [basic, vision, fds] +dataset: [CIFAR-10] +--- + # Flower Example using MONAI This introductory example to Flower uses MONAI, but deep knowledge of MONAI is not necessarily required to run the example. However, it will help you understand how to adapt Flower to your use case. diff --git a/examples/quickstart-pandas/README.md b/examples/quickstart-pandas/README.md index dd69f3ead3cb..1ba25dec2fa0 100644 --- a/examples/quickstart-pandas/README.md +++ b/examples/quickstart-pandas/README.md @@ -1,3 +1,10 @@ +--- +title: "Simple Flower Example using PyTorch" +url: https://pytorch.org/ +labels: [basic, vision, fds] +dataset: [CIFAR-10] +--- + # Flower Example using Pandas This introductory example to Flower uses Pandas, but deep knowledge of Pandas is not necessarily required to run the example. However, it will help you understand how to adapt Flower to your use case. This example uses [Flower Datasets](https://flower.ai/docs/datasets/) to diff --git a/examples/quickstart-pytorch-lightning/README.md b/examples/quickstart-pytorch-lightning/README.md index fb29c7e9e9ea..bd3923cbede0 100644 --- a/examples/quickstart-pytorch-lightning/README.md +++ b/examples/quickstart-pytorch-lightning/README.md @@ -1,3 +1,10 @@ +--- +title: "Simple Flower Example using PyTorch" +url: https://pytorch.org/ +labels: [basic, vision, fds] +dataset: [CIFAR-10] +--- + # Flower Example using PyTorch Lightning This introductory example to Flower uses PyTorch, but deep knowledge of PyTorch Lightning is not necessarily required to run the example. However, it will help you understand how to adapt Flower to your use case. Running this example in itself is quite easy. This example uses [Flower Datasets](https://flower.ai/docs/datasets/) to download, partition and preprocess the MNIST dataset. diff --git a/examples/quickstart-pytorch/README.md b/examples/quickstart-pytorch/README.md index 93d6a593f362..a6c8f2f49a7c 100644 --- a/examples/quickstart-pytorch/README.md +++ b/examples/quickstart-pytorch/README.md @@ -1,3 +1,10 @@ +--- +title: "Simple Flower Example using PyTorch" +url: https://pytorch.org/ +labels: [basic, vision, fds] +dataset: [CIFAR-10] +--- + # Flower Example using PyTorch This introductory example to Flower uses PyTorch, but deep knowledge of PyTorch is not necessarily required to run the example. However, it will help you understand how to adapt Flower to your use case. Running this example in itself is quite easy. This example uses [Flower Datasets](https://flower.ai/docs/datasets/) to download, partition and preprocess the CIFAR-10 dataset. diff --git a/examples/quickstart-sklearn-tabular/README.md b/examples/quickstart-sklearn-tabular/README.md index a975a9392800..0d4836367b64 100644 --- a/examples/quickstart-sklearn-tabular/README.md +++ b/examples/quickstart-sklearn-tabular/README.md @@ -1,3 +1,10 @@ +--- +title: "Simple Flower Example using PyTorch" +url: https://pytorch.org/ +labels: [basic, vision, fds] +dataset: [CIFAR-10] +--- + # Flower Example using scikit-learn This example of Flower uses `scikit-learn`'s `LogisticRegression` model to train a federated learning system on diff --git a/examples/quickstart-tabnet/README.md b/examples/quickstart-tabnet/README.md index 19a139f83064..a0913e860468 100644 --- a/examples/quickstart-tabnet/README.md +++ b/examples/quickstart-tabnet/README.md @@ -1,3 +1,10 @@ +--- +title: "Simple Flower Example using PyTorch" +url: https://pytorch.org/ +labels: [basic, vision, fds] +dataset: [CIFAR-10] +--- + # Flower TabNet Example using TensorFlow This introductory example to Flower uses Keras but deep knowledge of Keras is not necessarily required to run the example. However, it will help you understanding how to adapt Flower to your use-cases. You can learn more about TabNet from [paper](https://arxiv.org/abs/1908.07442) and its implementation using TensorFlow at [this repository](https://github.com/titu1994/tf-TabNet). Note also that the basis of this example using federated learning is the example from the repository above. diff --git a/examples/quickstart-tensorflow/README.md b/examples/quickstart-tensorflow/README.md index ae1fe19834a3..e47df1c8c42a 100644 --- a/examples/quickstart-tensorflow/README.md +++ b/examples/quickstart-tensorflow/README.md @@ -1,3 +1,10 @@ +--- +title: "Simple Flower Example using PyTorch" +url: https://pytorch.org/ +labels: [basic, vision, fds] +dataset: [CIFAR-10] +--- + # Flower Example using TensorFlow/Keras This introductory example to Flower uses Keras but deep knowledge of Keras is not necessarily required to run the example. However, it will help you understand how to adapt Flower to your use case. diff --git a/examples/simulation-pytorch/README.md b/examples/simulation-pytorch/README.md index 93f9e1acbac7..5bc277917279 100644 --- a/examples/simulation-pytorch/README.md +++ b/examples/simulation-pytorch/README.md @@ -1,3 +1,10 @@ +--- +title: "Simple Flower Example using PyTorch" +url: https://pytorch.org/ +labels: [basic, vision, fds] +dataset: [CIFAR-10] +--- + # Flower Simulation example using PyTorch This introductory example uses the simulation capabilities of Flower to simulate a large number of clients on a single machine. Take a look at the [Documentation](https://flower.ai/docs/framework/how-to-run-simulations.html) for a deep dive into how Flower simulation works. This example uses [Flower Datasets](https://flower.ai/docs/datasets/) to download, partition and preprocess the MNIST dataset. This examples uses 100 clients by default. diff --git a/examples/simulation-tensorflow/README.md b/examples/simulation-tensorflow/README.md index 917d7b34c7af..089c1a9b7e7d 100644 --- a/examples/simulation-tensorflow/README.md +++ b/examples/simulation-tensorflow/README.md @@ -1,3 +1,10 @@ +--- +title: "Simple Flower Example using PyTorch" +url: https://pytorch.org/ +labels: [basic, vision, fds] +dataset: [CIFAR-10] +--- + # Flower Simulation example using TensorFlow/Keras This introductory example uses the simulation capabilities of Flower to simulate a large number of clients on a single machine. Take a look at the [Documentation](https://flower.ai/docs/framework/how-to-run-simulations.html) for a deep dive into how Flower simulation works. This example uses [Flower Datasets](https://flower.ai/docs/datasets/) to download, partition and preprocess the MNIST dataset. This examples uses 100 clients by default. diff --git a/examples/sklearn-logreg-mnist/README.md b/examples/sklearn-logreg-mnist/README.md index 12b1a5e3bc1a..7cdb535742b0 100644 --- a/examples/sklearn-logreg-mnist/README.md +++ b/examples/sklearn-logreg-mnist/README.md @@ -1,3 +1,10 @@ +--- +title: "Simple Flower Example using PyTorch" +url: https://pytorch.org/ +labels: [basic, vision, fds] +dataset: [CIFAR-10] +--- + # Flower Example using scikit-learn This example of Flower uses `scikit-learn`'s `LogisticRegression` model to train a federated learning system. It will help you understand how to adapt Flower for use with `scikit-learn`. diff --git a/examples/tensorflow-privacy/README.md b/examples/tensorflow-privacy/README.md index a1f1be00f6b0..65cdb59d7a32 100644 --- a/examples/tensorflow-privacy/README.md +++ b/examples/tensorflow-privacy/README.md @@ -1,3 +1,10 @@ +--- +title: "Simple Flower Example using PyTorch" +url: https://pytorch.org/ +labels: [basic, vision, fds] +dataset: [CIFAR-10] +--- + # Training with Sample-Level Differential Privacy using TensorFlow-Privacy Engine In this example, we demonstrate how to train a model with sample-level differential privacy (DP) using Flower. We employ TensorFlow and integrate the tensorflow-privacy Engine to achieve sample-level differential privacy. This setup ensures robust privacy guarantees during the client training phase. diff --git a/examples/vertical-fl/README.md b/examples/vertical-fl/README.md index ba8228a059f9..04e6a4a0e0a1 100644 --- a/examples/vertical-fl/README.md +++ b/examples/vertical-fl/README.md @@ -1,3 +1,10 @@ +--- +title: "Simple Flower Example using PyTorch" +url: https://pytorch.org/ +labels: [basic, vision, fds] +dataset: [CIFAR-10] +--- + # Vertical Federated Learning example This example will showcase how you can perform Vertical Federated Learning using diff --git a/examples/vit-finetune/README.md b/examples/vit-finetune/README.md index ac1652acf02d..3ff36d0fa2c4 100644 --- a/examples/vit-finetune/README.md +++ b/examples/vit-finetune/README.md @@ -1,3 +1,10 @@ +--- +title: "Simple Flower Example using PyTorch" +url: https://pytorch.org/ +labels: [basic, vision, fds] +dataset: [CIFAR-10] +--- + # Federated finetuning of a ViT This example shows how to use Flower's Simulation Engine to federate the finetuning of a Vision Transformer ([ViT-Base-16](https://pytorch.org/vision/main/models/generated/torchvision.models.vit_b_16.html#torchvision.models.vit_b_16)) that has been pretrained on ImageNet. To keep things simple we'll be finetuning it to [Oxford Flower-102](https://www.robots.ox.ac.uk/~vgg/data/flowers/102/index.html) datasset, creating 20 partitions using [Flower Datasets](https://flower.ai/docs/datasets/). We'll be finetuning just the exit `head` of the ViT, this means that the training is not that costly and each client requires just ~1GB of VRAM (for a batch size of 32 images). diff --git a/examples/whisper-federated-finetuning/README.md b/examples/whisper-federated-finetuning/README.md index ddebe51247b2..0e586f774d77 100644 --- a/examples/whisper-federated-finetuning/README.md +++ b/examples/whisper-federated-finetuning/README.md @@ -1,3 +1,10 @@ +--- +title: "Simple Flower Example using PyTorch" +url: https://pytorch.org/ +labels: [basic, vision, fds] +dataset: [CIFAR-10] +--- + # On-device Federated Finetuning for Speech Classification This example demonstrates how to, from a pre-trained [Whisper](https://openai.com/research/whisper) model, finetune it for the downstream task of keyword spotting. We'll be implementing a federated downstream finetuning pipeline using Flower involving a total of 100 clients. As for the downstream dataset, we'll be using the [Google Speech Commands](https://huggingface.co/datasets/speech_commands) dataset for keyword spotting. We'll take the encoder part of the [Whisper-tiny](https://huggingface.co/openai/whisper-tiny) model, freeze its parameters, and learn a lightweight classification (\<800K parameters !!) head to correctly classify a spoken word. diff --git a/examples/xgboost-comprehensive/README.md b/examples/xgboost-comprehensive/README.md index dc6d7e3872d6..ecf71d0bb222 100644 --- a/examples/xgboost-comprehensive/README.md +++ b/examples/xgboost-comprehensive/README.md @@ -1,3 +1,10 @@ +--- +title: "Simple Flower Example using PyTorch" +url: https://pytorch.org/ +labels: [basic, vision, fds] +dataset: [CIFAR-10] +--- + # Flower Example using XGBoost (Comprehensive) This example demonstrates a comprehensive federated learning setup using Flower with XGBoost. diff --git a/examples/xgboost-quickstart/README.md b/examples/xgboost-quickstart/README.md index 713b6eab8bac..3e7e246b6458 100644 --- a/examples/xgboost-quickstart/README.md +++ b/examples/xgboost-quickstart/README.md @@ -1,3 +1,10 @@ +--- +title: "Simple Flower Example using PyTorch" +url: https://pytorch.org/ +labels: [basic, vision, fds] +dataset: [CIFAR-10] +--- + # Flower Example using XGBoost This example demonstrates how to perform EXtreme Gradient Boosting (XGBoost) within Flower using `xgboost` package. From 94300119f180d218be0f5db19bd5cd9fb05c3e30 Mon Sep 17 00:00:00 2001 From: Charles Beauville Date: Tue, 25 Jun 2024 18:34:59 +0200 Subject: [PATCH 05/66] Use metadata --- dev/build-example-docs.sh | 33 +++++++++++++-------------------- 1 file changed, 13 insertions(+), 20 deletions(-) diff --git a/dev/build-example-docs.sh b/dev/build-example-docs.sh index d50cd1f865e1..685eed4cda8f 100755 --- a/dev/build-example-docs.sh +++ b/dev/build-example-docs.sh @@ -27,23 +27,19 @@ table_body="\\ function add_table_entry () { # extract lines from markdown file between --- and ---, preserving newlines and store in variable called metadata - # metadata=$(awk '/^---$/{flag=1; next} flag; /^---$/{exit}' $1/README.md) + metadata=$(awk '/^---$/{flag=1; next} flag; /^---$/{exit}' $1/README.md) # get text after "title:" in metadata using sed - # title=$(echo "$metadata" | sed -n 's/title: //p') - title=$1 + title=$(echo "$metadata" | sed -n 's/title: //p') # get text after "url:" in metadata using sed - # url=$(echo "$metadata" | sed -n 's/url: //p') - url=$1 + url=$(echo "$metadata" | sed -n 's/url: //p') # get text after "labels:" in metadata using sed - # labels=$(echo "$metadata" | sed -n 's/labels: //p' | sed 's/\[//g; s/\]//g') - labels=$1 + labels=$(echo "$metadata" | sed -n 's/labels: //p' | sed 's/\[//g; s/\]//g') # get text after "dataset:" in metadata using sed - # dataset=$(echo "$metadata" | sed -n 's/dataset: //p' | sed 's/\[//g; s/\]//g') - dataset=$1 + dataset=$(echo "$metadata" | sed -n 's/dataset: //p' | sed 's/\[//g; s/\]//g') table_entry="\\ * - \`$1 <$1.html>\`_\\ @@ -127,16 +123,13 @@ rm -f $INDEX # Create empty index file touch $INDEX -echo "# Flower Examples Documentation" >> $INDEX +echo "Flower Examples Documentation" >> $INDEX +echo "-----------------------------" >> $INDEX echo "" >> $INDEX echo ".. BASELINES_TABLE_ANCHOR" >> $INDEX -# echo "$initial_text" >> $INDEX && echo "" >> $INDEX - ! sed -i '' -e "s/.. BASELINES_TABLE_ANCHOR/$table_body/" $INDEX -! grep -q ":caption: References" $INDEX && echo "$initial_text" >> $INDEX && echo "" >> $INDEX - cd $ROOT/examples # Iterate through each folder in examples/ for d in $(printf '%s\n' */ | sort -V); do @@ -154,16 +147,16 @@ for d in $(printf '%s\n' */ | sort -V); do # Copy all images of the _static folder into the examples # docs static folder copy_images $example + add_table_entry $example ! sed -i '' -e "s/.. BASELINES_TABLE_ENTRY/$table_entry/" $INDEX fi done -# echo "\`\`\`{toctree}" >> $INDEX -# echo "---" >> $INDEX -# echo "maxdepth: 1" >> $INDEX -# echo "---" >> $INDEX +echo "" >> $INDEX +echo "$initial_text" >> $INDEX + +add_all_entries -# add_all_entries +echo "" >> $INDEX -# echo "\`\`\`" >> $INDEX From ee0394bbc97300f9591d17f71170b39be5d71e63 Mon Sep 17 00:00:00 2001 From: Charles Beauville Date: Tue, 25 Jun 2024 18:39:42 +0200 Subject: [PATCH 06/66] Fix script --- dev/build-example-docs.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/dev/build-example-docs.sh b/dev/build-example-docs.sh index 685eed4cda8f..4e567ccca47a 100755 --- a/dev/build-example-docs.sh +++ b/dev/build-example-docs.sh @@ -85,7 +85,7 @@ copy_images () { } add_to_index () { - (echo $INSERT_LINE; echo a; echo $1; echo .; echo wq) | ed $INDEX 2>&1 >/dev/null + echo " $1" >> $INDEX } add_single_entry () { From ee01e6ba388077d4e1480fffe8d4c8acf047a850 Mon Sep 17 00:00:00 2001 From: Charles Beauville Date: Tue, 25 Jun 2024 19:08:49 +0200 Subject: [PATCH 07/66] Update metadata --- dev/build-example-docs.sh | 11 +- examples/advanced-pytorch/README.md | 3 +- examples/advanced-tensorflow/README.md | 5 +- examples/android-kotlin/README.md | 5 +- examples/android/README.md | 5 +- examples/app-pytorch/README.md | 3 +- examples/app-secure-aggregation/README.md | 3 +- examples/custom-metrics/README.md | 3 +- examples/custom-mods/README.md | 3 +- examples/doc/source/index.rst | 277 ++++++++++++++++++++++ examples/embedded-devices/README.md | 3 +- 11 files changed, 306 insertions(+), 15 deletions(-) create mode 100644 examples/doc/source/index.rst diff --git a/dev/build-example-docs.sh b/dev/build-example-docs.sh index 4e567ccca47a..e84078d21fd0 100755 --- a/dev/build-example-docs.sh +++ b/dev/build-example-docs.sh @@ -15,10 +15,11 @@ END table_body="\\ .. list-table:: \\ - :widths: 15 15 50\\ + :widths: 50 15 15 15\\ :header-rows: 1\\ \\ - * - Method\\ + * - Title \\ + - Framework\\ - Dataset\\ - Tags\\ .. BASELINES_TABLE_ENTRY\\ @@ -41,8 +42,11 @@ function add_table_entry () # get text after "dataset:" in metadata using sed dataset=$(echo "$metadata" | sed -n 's/dataset: //p' | sed 's/\[//g; s/\]//g') + framework=$(echo "$metadata" | sed -n 's/framework: //p' | sed 's/\[//g; s/\]//g') + table_entry="\\ - * - \`$1 <$1.html>\`_\\ + * - \`$title <$1.html>\`_\\ + - $framework\\ - $dataset\\ - $labels\\ \\ @@ -155,6 +159,7 @@ done echo "" >> $INDEX echo "$initial_text" >> $INDEX +echo "" >> $INDEX add_all_entries diff --git a/examples/advanced-pytorch/README.md b/examples/advanced-pytorch/README.md index f42c822a9e4c..e6ad7a76b85b 100644 --- a/examples/advanced-pytorch/README.md +++ b/examples/advanced-pytorch/README.md @@ -1,8 +1,9 @@ --- -title: "Simple Flower Example using PyTorch" +title: "Advanced Flower Example using PyTorch" url: https://pytorch.org/ labels: [basic, vision, fds] dataset: [CIFAR-10] +framework: [PyTorch] --- # Advanced Flower Example (PyTorch) diff --git a/examples/advanced-tensorflow/README.md b/examples/advanced-tensorflow/README.md index c6d131392e72..774b24b03ae0 100644 --- a/examples/advanced-tensorflow/README.md +++ b/examples/advanced-tensorflow/README.md @@ -1,8 +1,9 @@ --- -title: "Simple Flower Example using PyTorch" -url: https://pytorch.org/ +title: "Advanced Flower Example using TensorFlow/Keras" +url: https://tensorflow.org/ labels: [basic, vision, fds] dataset: [CIFAR-10] +framework: [TensorFlow, Keras] --- # Advanced Flower Example (TensorFlow/Keras) diff --git a/examples/android-kotlin/README.md b/examples/android-kotlin/README.md index ad7e2ed4589c..bc309ed30247 100644 --- a/examples/android-kotlin/README.md +++ b/examples/android-kotlin/README.md @@ -1,8 +1,9 @@ --- -title: "Simple Flower Example using PyTorch" -url: https://pytorch.org/ +title: "Flower Android Example using Kotlin and TF Lite" +url: https://tensorflow.org/lite labels: [basic, vision, fds] dataset: [CIFAR-10] +framework: [Android, Kotlin, TensorFlowLite] --- # Flower Android Client Example with Kotlin and TensorFlow Lite 2022 diff --git a/examples/android/README.md b/examples/android/README.md index aa94bdbf5b33..7ae06d39999c 100644 --- a/examples/android/README.md +++ b/examples/android/README.md @@ -1,8 +1,9 @@ --- -title: "Simple Flower Example using PyTorch" -url: https://pytorch.org/ +title: "Flower Android Example using Java and TF Lite" +url: https://tensorflow.org/lite labels: [basic, vision, fds] dataset: [CIFAR-10] +framework: [Android, Java, TensorFlowLite] --- # Flower Android Example (TensorFlowLite) diff --git a/examples/app-pytorch/README.md b/examples/app-pytorch/README.md index e9a6e0ee4a86..b139fbbfc007 100644 --- a/examples/app-pytorch/README.md +++ b/examples/app-pytorch/README.md @@ -1,8 +1,9 @@ --- -title: "Simple Flower Example using PyTorch" +title: "Example Flower App using PyTorch" url: https://pytorch.org/ labels: [basic, vision, fds] dataset: [CIFAR-10] +framework: [PyTorch] --- # Flower App (PyTorch) 🧪 diff --git a/examples/app-secure-aggregation/README.md b/examples/app-secure-aggregation/README.md index 51e5e61e1cd7..a44b046e8c6b 100644 --- a/examples/app-secure-aggregation/README.md +++ b/examples/app-secure-aggregation/README.md @@ -1,8 +1,9 @@ --- -title: "Simple Flower Example using PyTorch" +title: "Example Flower App with Secure Aggregation" url: https://pytorch.org/ labels: [basic, vision, fds] dataset: [CIFAR-10] +framework: [PyTorch] --- # Secure aggregation with Flower (the SecAgg+ protocol) 🧪 diff --git a/examples/custom-metrics/README.md b/examples/custom-metrics/README.md index 3e867698563e..569738fa248d 100644 --- a/examples/custom-metrics/README.md +++ b/examples/custom-metrics/README.md @@ -1,8 +1,9 @@ --- -title: "Simple Flower Example using PyTorch" +title: "Example Flower App with Custom Metrics" url: https://pytorch.org/ labels: [basic, vision, fds] dataset: [CIFAR-10] +framework: [PyTorch] --- # Flower Example using Custom Metrics diff --git a/examples/custom-mods/README.md b/examples/custom-mods/README.md index 9224fc689473..ca99293dd3c8 100644 --- a/examples/custom-mods/README.md +++ b/examples/custom-mods/README.md @@ -1,8 +1,9 @@ --- -title: "Simple Flower Example using PyTorch" +title: "Example Flower App with Custom Metrics" url: https://pytorch.org/ labels: [basic, vision, fds] dataset: [CIFAR-10] +framework: [PyTorch] --- # Using custom mods 🧪 diff --git a/examples/doc/source/index.rst b/examples/doc/source/index.rst new file mode 100644 index 000000000000..20b3965a910e --- /dev/null +++ b/examples/doc/source/index.rst @@ -0,0 +1,277 @@ +Flower Examples Documentation +----------------------------- + + +.. list-table:: + :widths: 15 15 50 + :header-rows: 1 + + * - Method + - Dataset + - Tags + + * - `advanced-pytorch `_ + - CIFAR-10 + - basic, vision, fds + + + * - `advanced-tensorflow `_ + - CIFAR-10 + - basic, vision, fds + + + * - `android-kotlin `_ + - CIFAR-10 + - basic, vision, fds + + + * - `android `_ + - CIFAR-10 + - basic, vision, fds + + + * - `app-pytorch `_ + - CIFAR-10 + - basic, vision, fds + + + * - `app-secure-aggregation `_ + - CIFAR-10 + - basic, vision, fds + + + * - `custom-metrics `_ + - CIFAR-10 + - basic, vision, fds + + + * - `custom-mods `_ + - CIFAR-10 + - basic, vision, fds + + + * - `embedded-devices `_ + - CIFAR-10 + - basic, vision, fds + + + * - `federated-kaplan-meier-fitter `_ + - CIFAR-10 + - basic, vision, fds + + + * - `flower-authentication `_ + - CIFAR-10 + - basic, vision, fds + + + * - `flower-in-30-minutes `_ + - CIFAR-10 + - basic, vision, fds + + + * - `flower-simulation-step-by-step-pytorch `_ + - CIFAR-10 + - basic, vision, fds + + + * - `flower-via-docker-compose `_ + - CIFAR-10 + - basic, vision, fds + + + * - `fl-dp-sa `_ + - CIFAR-10 + - basic, vision, fds + + + * - `fl-tabular `_ + - CIFAR-10 + - basic, vision, fds + + + * - `ios `_ + - CIFAR-10 + - basic, vision, fds + + + * - `llm-flowertune `_ + - CIFAR-10 + - basic, vision, fds + + + * - `opacus `_ + - CIFAR-10 + - basic, vision, fds + + + * - `pytorch-federated-variational-autoencoder `_ + - CIFAR-10 + - basic, vision, fds + + + * - `pytorch-from-centralized-to-federated `_ + - CIFAR-10 + - basic, vision, fds + + + * - `quickstart-cpp `_ + - CIFAR-10 + - basic, vision, fds + + + * - `quickstart-fastai `_ + - CIFAR-10 + - basic, vision, fds + + + * - `quickstart-huggingface `_ + - CIFAR-10 + - basic, vision, fds + + + * - `quickstart-jax `_ + - CIFAR-10 + - basic, vision, fds + + + * - `quickstart-mlcube `_ + - CIFAR-10 + - basic, vision, fds + + + * - `quickstart-mlx `_ + - CIFAR-10 + - basic, vision, fds + + + * - `quickstart-monai `_ + - CIFAR-10 + - basic, vision, fds + + + * - `quickstart-pandas `_ + - CIFAR-10 + - basic, vision, fds + + + * - `quickstart-pytorch-lightning `_ + - CIFAR-10 + - basic, vision, fds + + + * - `quickstart-pytorch `_ + - CIFAR-10 + - basic, vision, fds + + + * - `quickstart-sklearn-tabular `_ + - CIFAR-10 + - basic, vision, fds + + + * - `quickstart-tabnet `_ + - CIFAR-10 + - basic, vision, fds + + + * - `quickstart-tensorflow `_ + - CIFAR-10 + - basic, vision, fds + + + * - `simulation-pytorch `_ + - CIFAR-10 + - basic, vision, fds + + + * - `simulation-tensorflow `_ + - CIFAR-10 + - basic, vision, fds + + + * - `sklearn-logreg-mnist `_ + - CIFAR-10 + - basic, vision, fds + + + * - `tensorflow-privacy `_ + - CIFAR-10 + - basic, vision, fds + + + * - `vertical-fl `_ + - CIFAR-10 + - basic, vision, fds + + + * - `vit-finetune `_ + - CIFAR-10 + - basic, vision, fds + + + * - `whisper-federated-finetuning `_ + - CIFAR-10 + - basic, vision, fds + + + * - `xgboost-comprehensive `_ + - CIFAR-10 + - basic, vision, fds + + + * - `xgboost-quickstart `_ + - CIFAR-10 + - basic, vision, fds + +.. BASELINES_TABLE_ENTRY + + +.. toctree:: + :maxdepth: 1 + :caption: References + + advanced-pytorch + advanced-tensorflow + android-kotlin + android + app-pytorch + app-secure-aggregation + custom-metrics + custom-mods + embedded-devices + federated-kaplan-meier-fitter + flower-authentication + flower-in-30-minutes + flower-simulation-step-by-step-pytorch + flower-via-docker-compose + fl-dp-sa + fl-tabular + ios + llm-flowertune + opacus + pytorch-federated-variational-autoencoder + pytorch-from-centralized-to-federated + quickstart-cpp + quickstart-fastai + quickstart-huggingface + quickstart-jax + quickstart-mlcube + quickstart-mlx + quickstart-monai + quickstart-pandas + quickstart-pytorch-lightning + quickstart-pytorch + quickstart-sklearn-tabular + quickstart-tabnet + quickstart-tensorflow + simulation-pytorch + simulation-tensorflow + sklearn-logreg-mnist + tensorflow-privacy + vertical-fl + vit-finetune + whisper-federated-finetuning + xgboost-comprehensive + xgboost-quickstart + diff --git a/examples/embedded-devices/README.md b/examples/embedded-devices/README.md index 4d048d137a28..9faef650e3ad 100644 --- a/examples/embedded-devices/README.md +++ b/examples/embedded-devices/README.md @@ -1,8 +1,9 @@ --- -title: "Simple Flower Example using PyTorch" +title: "Flower Embedded Devices Example" url: https://pytorch.org/ labels: [basic, vision, fds] dataset: [CIFAR-10] +framework: [PyTorch, TensorFlow] --- # Federated Learning on Embedded Devices with Flower From 7dea64028918e02a90719bd34c3690ed0810552d Mon Sep 17 00:00:00 2001 From: Charles Beauville Date: Tue, 25 Jun 2024 19:29:47 +0200 Subject: [PATCH 08/66] Update metadata --- examples/advanced-pytorch/README.md | 2 +- examples/advanced-tensorflow/README.md | 2 +- examples/android-kotlin/README.md | 2 +- examples/android/README.md | 2 +- examples/app-pytorch/README.md | 2 +- examples/app-secure-aggregation/README.md | 2 +- examples/custom-metrics/README.md | 2 +- examples/custom-mods/README.md | 2 +- examples/doc/source/index.rst | 140 +++++++++++------- examples/embedded-devices/README.md | 2 +- .../federated-kaplan-meier-fitter/README.md | 7 +- examples/fl-dp-sa/README.md | 2 +- examples/fl-tabular/README.md | 7 +- examples/flower-authentication/README.md | 6 +- examples/flower-in-30-minutes/README.md | 5 +- 15 files changed, 110 insertions(+), 75 deletions(-) diff --git a/examples/advanced-pytorch/README.md b/examples/advanced-pytorch/README.md index e6ad7a76b85b..39af1155213f 100644 --- a/examples/advanced-pytorch/README.md +++ b/examples/advanced-pytorch/README.md @@ -1,5 +1,5 @@ --- -title: "Advanced Flower Example using PyTorch" +title: Advanced Flower Example using PyTorch url: https://pytorch.org/ labels: [basic, vision, fds] dataset: [CIFAR-10] diff --git a/examples/advanced-tensorflow/README.md b/examples/advanced-tensorflow/README.md index 774b24b03ae0..1f60286b8c3f 100644 --- a/examples/advanced-tensorflow/README.md +++ b/examples/advanced-tensorflow/README.md @@ -1,5 +1,5 @@ --- -title: "Advanced Flower Example using TensorFlow/Keras" +title: Advanced Flower Example using TensorFlow/Keras url: https://tensorflow.org/ labels: [basic, vision, fds] dataset: [CIFAR-10] diff --git a/examples/android-kotlin/README.md b/examples/android-kotlin/README.md index bc309ed30247..68a78c5f64dd 100644 --- a/examples/android-kotlin/README.md +++ b/examples/android-kotlin/README.md @@ -1,5 +1,5 @@ --- -title: "Flower Android Example using Kotlin and TF Lite" +title: Flower Android Example using Kotlin and TF Lite url: https://tensorflow.org/lite labels: [basic, vision, fds] dataset: [CIFAR-10] diff --git a/examples/android/README.md b/examples/android/README.md index 7ae06d39999c..ff1d9758b9fd 100644 --- a/examples/android/README.md +++ b/examples/android/README.md @@ -1,5 +1,5 @@ --- -title: "Flower Android Example using Java and TF Lite" +title: Flower Android Example using Java and TF Lite url: https://tensorflow.org/lite labels: [basic, vision, fds] dataset: [CIFAR-10] diff --git a/examples/app-pytorch/README.md b/examples/app-pytorch/README.md index b139fbbfc007..38136284b0ce 100644 --- a/examples/app-pytorch/README.md +++ b/examples/app-pytorch/README.md @@ -1,5 +1,5 @@ --- -title: "Example Flower App using PyTorch" +title: Example Flower App using PyTorch url: https://pytorch.org/ labels: [basic, vision, fds] dataset: [CIFAR-10] diff --git a/examples/app-secure-aggregation/README.md b/examples/app-secure-aggregation/README.md index a44b046e8c6b..1212b8d289ae 100644 --- a/examples/app-secure-aggregation/README.md +++ b/examples/app-secure-aggregation/README.md @@ -1,5 +1,5 @@ --- -title: "Example Flower App with Secure Aggregation" +title: Example Flower App with Secure Aggregation url: https://pytorch.org/ labels: [basic, vision, fds] dataset: [CIFAR-10] diff --git a/examples/custom-metrics/README.md b/examples/custom-metrics/README.md index 569738fa248d..c4dd489e97a1 100644 --- a/examples/custom-metrics/README.md +++ b/examples/custom-metrics/README.md @@ -1,5 +1,5 @@ --- -title: "Example Flower App with Custom Metrics" +title: Example Flower App with Custom Metrics url: https://pytorch.org/ labels: [basic, vision, fds] dataset: [CIFAR-10] diff --git a/examples/custom-mods/README.md b/examples/custom-mods/README.md index ca99293dd3c8..16d6869b666b 100644 --- a/examples/custom-mods/README.md +++ b/examples/custom-mods/README.md @@ -1,5 +1,5 @@ --- -title: "Example Flower App with Custom Metrics" +title: Example Flower App with Custom Metrics url: https://pytorch.org/ labels: [basic, vision, fds] dataset: [CIFAR-10] diff --git a/examples/doc/source/index.rst b/examples/doc/source/index.rst index 20b3965a910e..b4aab6b86632 100644 --- a/examples/doc/source/index.rst +++ b/examples/doc/source/index.rst @@ -3,228 +3,260 @@ Flower Examples Documentation .. list-table:: - :widths: 15 15 50 + :widths: 50 15 15 15 :header-rows: 1 - * - Method + * - Title + - Framework - Dataset - Tags - * - `advanced-pytorch `_ + * - `"Advanced Flower Example using PyTorch" `_ + - PyTorch - CIFAR-10 - basic, vision, fds - * - `advanced-tensorflow `_ + * - `"Flower Android Example using Kotlin and TF Lite" `_ + - Android, Kotlin, TensorFlowLite - CIFAR-10 - basic, vision, fds - * - `android-kotlin `_ + * - `"Flower Android Example using Java and TF Lite" `_ + - Android, Java, TensorFlowLite - CIFAR-10 - basic, vision, fds - * - `android `_ + * - `"Example Flower App using PyTorch" `_ + - PyTorch - CIFAR-10 - basic, vision, fds - * - `app-pytorch `_ + * - `"Example Flower App with Secure Aggregation" `_ + - PyTorch - CIFAR-10 - basic, vision, fds - * - `app-secure-aggregation `_ + * - `"Example Flower App with Custom Metrics" `_ + - PyTorch - CIFAR-10 - basic, vision, fds - * - `custom-metrics `_ + * - `"Example Flower App with Custom Metrics" `_ + - PyTorch - CIFAR-10 - basic, vision, fds - * - `custom-mods `_ + * - `"Simple Flower Example using PyTorch" `_ + - - CIFAR-10 - basic, vision, fds - * - `embedded-devices `_ + * - `"Simple Flower Example using PyTorch" `_ + - - CIFAR-10 - basic, vision, fds - * - `federated-kaplan-meier-fitter `_ + * - `"Simple Flower Example using PyTorch" `_ + - - CIFAR-10 - basic, vision, fds - * - `flower-authentication `_ + * - `"Simple Flower Example using PyTorch" `_ + - - CIFAR-10 - basic, vision, fds - * - `flower-in-30-minutes `_ + * - `"Simple Flower Example using PyTorch" `_ + - - CIFAR-10 - basic, vision, fds - * - `flower-simulation-step-by-step-pytorch `_ + * - `"Simple Flower Example using PyTorch" `_ + - - CIFAR-10 - basic, vision, fds - * - `flower-via-docker-compose `_ + * - `"Simple Flower Example using PyTorch" `_ + - - CIFAR-10 - basic, vision, fds - * - `fl-dp-sa `_ + * - `"Simple Flower Example using PyTorch" `_ + - - CIFAR-10 - basic, vision, fds - * - `fl-tabular `_ + * - `"Simple Flower Example using PyTorch" `_ + - - CIFAR-10 - basic, vision, fds - * - `ios `_ + * - `"Simple Flower Example using PyTorch" `_ + - - CIFAR-10 - basic, vision, fds - * - `llm-flowertune `_ + * - `"Simple Flower Example using PyTorch" `_ + - - CIFAR-10 - basic, vision, fds - * - `opacus `_ + * - `"Simple Flower Example using PyTorch" `_ + - - CIFAR-10 - basic, vision, fds - * - `pytorch-federated-variational-autoencoder `_ + * - `"Simple Flower Example using PyTorch" `_ + - - CIFAR-10 - basic, vision, fds - * - `pytorch-from-centralized-to-federated `_ + * - `"Simple Flower Example using PyTorch" `_ + - - CIFAR-10 - basic, vision, fds - * - `quickstart-cpp `_ + * - `"Simple Flower Example using PyTorch" `_ + - - CIFAR-10 - basic, vision, fds - * - `quickstart-fastai `_ + * - `"Simple Flower Example using PyTorch" `_ + - - CIFAR-10 - basic, vision, fds - * - `quickstart-huggingface `_ + * - `"Simple Flower Example using PyTorch" `_ + - - CIFAR-10 - basic, vision, fds - * - `quickstart-jax `_ + * - `"Simple Flower Example using PyTorch" `_ + - - CIFAR-10 - basic, vision, fds - * - `quickstart-mlcube `_ + * - `"Simple Flower Example using PyTorch" `_ + - - CIFAR-10 - basic, vision, fds - * - `quickstart-mlx `_ + * - `"Simple Flower Example using PyTorch" `_ + - - CIFAR-10 - basic, vision, fds - * - `quickstart-monai `_ + * - `"Simple Flower Example using PyTorch" `_ + - - CIFAR-10 - basic, vision, fds - * - `quickstart-pandas `_ + * - `"Simple Flower Example using PyTorch" `_ + - - CIFAR-10 - basic, vision, fds - * - `quickstart-pytorch-lightning `_ + * - `"Simple Flower Example using PyTorch" `_ + - - CIFAR-10 - basic, vision, fds - * - `quickstart-pytorch `_ + * - `"Simple Flower Example using PyTorch" `_ + - - CIFAR-10 - basic, vision, fds - * - `quickstart-sklearn-tabular `_ + * - `"Simple Flower Example using PyTorch" `_ + - - CIFAR-10 - basic, vision, fds - * - `quickstart-tabnet `_ + * - `"Simple Flower Example using PyTorch" `_ + - - CIFAR-10 - basic, vision, fds - * - `quickstart-tensorflow `_ + * - `"Simple Flower Example using PyTorch" `_ + - - CIFAR-10 - basic, vision, fds - * - `simulation-pytorch `_ + * - `"Simple Flower Example using PyTorch" `_ + - - CIFAR-10 - basic, vision, fds - * - `simulation-tensorflow `_ + * - `"Simple Flower Example using PyTorch" `_ + - - CIFAR-10 - basic, vision, fds - * - `sklearn-logreg-mnist `_ + * - `"Simple Flower Example using PyTorch" `_ + - - CIFAR-10 - basic, vision, fds - * - `tensorflow-privacy `_ + * - `"Simple Flower Example using PyTorch" `_ + - - CIFAR-10 - basic, vision, fds - * - `vertical-fl `_ + * - `"Simple Flower Example using PyTorch" `_ + - - CIFAR-10 - basic, vision, fds - * - `vit-finetune `_ + * - `"Simple Flower Example using PyTorch" `_ + - - CIFAR-10 - basic, vision, fds - * - `whisper-federated-finetuning `_ + * - `"Simple Flower Example using PyTorch" `_ + - - CIFAR-10 - basic, vision, fds - - * - `xgboost-comprehensive `_ - - CIFAR-10 - - basic, vision, fds - - - * - `xgboost-quickstart `_ - - CIFAR-10 - - basic, vision, fds - -.. BASELINES_TABLE_ENTRY +.. BASELINES_TABLE_ENTRY .. toctree:: diff --git a/examples/embedded-devices/README.md b/examples/embedded-devices/README.md index 9faef650e3ad..5bd08d7ca563 100644 --- a/examples/embedded-devices/README.md +++ b/examples/embedded-devices/README.md @@ -1,5 +1,5 @@ --- -title: "Flower Embedded Devices Example" +title: Flower Embedded Devices Example url: https://pytorch.org/ labels: [basic, vision, fds] dataset: [CIFAR-10] diff --git a/examples/federated-kaplan-meier-fitter/README.md b/examples/federated-kaplan-meier-fitter/README.md index 7e7bc79b293d..fb5f6cbda453 100644 --- a/examples/federated-kaplan-meier-fitter/README.md +++ b/examples/federated-kaplan-meier-fitter/README.md @@ -1,8 +1,9 @@ --- -title: "Simple Flower Example using PyTorch" +title: Flower Example using KaplanMeierFitter url: https://pytorch.org/ -labels: [basic, vision, fds] -dataset: [CIFAR-10] +labels: [estimator, medical] +dataset: [Walton] +framework: [lifelines] --- # Flower Example using KaplanMeierFitter diff --git a/examples/fl-dp-sa/README.md b/examples/fl-dp-sa/README.md index 925896f0271c..cf5a357c383a 100644 --- a/examples/fl-dp-sa/README.md +++ b/examples/fl-dp-sa/README.md @@ -1,5 +1,5 @@ --- -title: "Simple Flower Example using PyTorch" +title: Example of Flower App with DP and SA url: https://pytorch.org/ labels: [basic, vision, fds] dataset: [CIFAR-10] diff --git a/examples/fl-tabular/README.md b/examples/fl-tabular/README.md index 0b0d367c1913..313bc87c3fe6 100644 --- a/examples/fl-tabular/README.md +++ b/examples/fl-tabular/README.md @@ -1,8 +1,9 @@ --- -title: "Simple Flower Example using PyTorch" +title: Simple Flower Example using Scikit-Learn url: https://pytorch.org/ -labels: [basic, vision, fds] -dataset: [CIFAR-10] +labels: [basic, tabular, fds] +dataset: [adult-census-income] +framework: [scikit-learn] --- # Flower Example on Adult Census Income Tabular Dataset diff --git a/examples/flower-authentication/README.md b/examples/flower-authentication/README.md index 1b86f6cbdf85..318f6203be0b 100644 --- a/examples/flower-authentication/README.md +++ b/examples/flower-authentication/README.md @@ -1,8 +1,8 @@ --- -title: "Simple Flower Example using PyTorch" -url: https://pytorch.org/ -labels: [basic, vision, fds] +title: Flower Example with Authentication +labels: [advanced, vision, fds] dataset: [CIFAR-10] +framework: [PyTorch] --- # Flower Authentication with PyTorch 🧪 diff --git a/examples/flower-in-30-minutes/README.md b/examples/flower-in-30-minutes/README.md index e1d14a762f00..0422ccee6246 100644 --- a/examples/flower-in-30-minutes/README.md +++ b/examples/flower-in-30-minutes/README.md @@ -1,8 +1,9 @@ --- -title: "Simple Flower Example using PyTorch" +title: 30-minute tutorial running Flower simulation with PyTorch url: https://pytorch.org/ -labels: [basic, vision, fds] +labels: [colab, vision, simulation] dataset: [CIFAR-10] +framework: [PyTorch] --- # 30-minute tutorial running Flower simulation with PyTorch From 35c98b702e45abdde53d5c5f95445e188dc0ce71 Mon Sep 17 00:00:00 2001 From: Charles Beauville Date: Tue, 25 Jun 2024 21:32:40 +0200 Subject: [PATCH 09/66] Update metadata --- .../flower-simulation-step-by-step-pytorch/README.md | 7 ++++--- examples/flower-via-docker-compose/README.md | 5 +++-- examples/ios/README.md | 7 ++++--- examples/llm-flowertune/README.md | 7 ++++--- examples/opacus/README.md | 5 +++-- examples/quickstart-cpp/README.md | 7 ++++--- examples/quickstart-fastai/README.md | 9 +++++---- examples/quickstart-huggingface/README.md | 9 +++++---- examples/quickstart-jax/README.md | 9 +++++---- examples/quickstart-mlcube/README.md | 9 +++++---- examples/quickstart-mlx/README.md | 9 +++++---- examples/quickstart-monai/README.md | 9 +++++---- 12 files changed, 52 insertions(+), 40 deletions(-) diff --git a/examples/flower-simulation-step-by-step-pytorch/README.md b/examples/flower-simulation-step-by-step-pytorch/README.md index 13d907e76e8e..fe29d55fa218 100644 --- a/examples/flower-simulation-step-by-step-pytorch/README.md +++ b/examples/flower-simulation-step-by-step-pytorch/README.md @@ -1,8 +1,9 @@ --- -title: "Simple Flower Example using PyTorch" +title: Flower Simulation Step-by-Step url: https://pytorch.org/ -labels: [basic, vision, fds] -dataset: [CIFAR-10] +labels: [basic, vision, simulation] +dataset: [MNIST] +framework: [PyTorch] --- # Flower Simulation Step-by-Step diff --git a/examples/flower-via-docker-compose/README.md b/examples/flower-via-docker-compose/README.md index 424dcd124853..8acd0f609512 100644 --- a/examples/flower-via-docker-compose/README.md +++ b/examples/flower-via-docker-compose/README.md @@ -1,8 +1,9 @@ --- -title: "Simple Flower Example using PyTorch" +title: Leveraging Flower and Docker for Device Heterogeneity Management in FL url: https://pytorch.org/ -labels: [basic, vision, fds] +labels: [deployment, vision, tutorial] dataset: [CIFAR-10] +framework: [Docker] --- # Leveraging Flower and Docker for Device Heterogeneity Management in Federated Learning diff --git a/examples/ios/README.md b/examples/ios/README.md index 3cec3a777b2d..6c10e5298d55 100644 --- a/examples/ios/README.md +++ b/examples/ios/README.md @@ -1,8 +1,9 @@ --- -title: "Simple Flower Example using PyTorch" +title: Simple Flower Example on iOS url: https://pytorch.org/ -labels: [basic, vision, fds] -dataset: [CIFAR-10] +labels: [mobile, vision, fds] +dataset: [MNIST] +framework: [swift] --- # FLiOS - A Flower SDK for iOS Devices with Example diff --git a/examples/llm-flowertune/README.md b/examples/llm-flowertune/README.md index 703f34aa0587..797bc81cda50 100644 --- a/examples/llm-flowertune/README.md +++ b/examples/llm-flowertune/README.md @@ -1,8 +1,9 @@ --- -title: "Simple Flower Example using PyTorch" +title: Federated LLM Fine-tuning with Flower url: https://pytorch.org/ -labels: [basic, vision, fds] -dataset: [CIFAR-10] +labels: [llm, nlp, LLama2] +dataset: [Alpaca-GPT4] +framework: [PEFT] --- # LLM FlowerTune: Federated LLM Fine-tuning with Flower diff --git a/examples/opacus/README.md b/examples/opacus/README.md index 31cf4405e8bb..c3a6f0e43415 100644 --- a/examples/opacus/README.md +++ b/examples/opacus/README.md @@ -1,8 +1,9 @@ --- -title: "Simple Flower Example using PyTorch" +title: Sample-Level Differential Privacy using Opacus url: https://pytorch.org/ -labels: [basic, vision, fds] +labels: [dp, security, fds] dataset: [CIFAR-10] +framework: [opacus, PyTorch] --- # Training with Sample-Level Differential Privacy using Opacus Privacy Engine diff --git a/examples/quickstart-cpp/README.md b/examples/quickstart-cpp/README.md index a3238b153e4d..3ddc09324493 100644 --- a/examples/quickstart-cpp/README.md +++ b/examples/quickstart-cpp/README.md @@ -1,8 +1,9 @@ --- -title: "Simple Flower Example using PyTorch" +title: Simple Flower Example using C++ url: https://pytorch.org/ -labels: [basic, vision, fds] -dataset: [CIFAR-10] +labels: [quickstart, linear regression, tabular] +dataset: [synthetic] +framework: [c++] --- # Flower Clients in C++ (under development) diff --git a/examples/quickstart-fastai/README.md b/examples/quickstart-fastai/README.md index ea54d5bf1972..da024a8d3ebb 100644 --- a/examples/quickstart-fastai/README.md +++ b/examples/quickstart-fastai/README.md @@ -1,8 +1,9 @@ --- -title: "Simple Flower Example using PyTorch" -url: https://pytorch.org/ -labels: [basic, vision, fds] -dataset: [CIFAR-10] +title: Simple Flower Example using fastai +url: https://fast.ai/ +labels: [quickstart, vision] +dataset: [MNIST] +framework: [fastai] --- # Flower Example using fastai diff --git a/examples/quickstart-huggingface/README.md b/examples/quickstart-huggingface/README.md index afa22d0dd612..62b611f9e45d 100644 --- a/examples/quickstart-huggingface/README.md +++ b/examples/quickstart-huggingface/README.md @@ -1,8 +1,9 @@ --- -title: "Simple Flower Example using PyTorch" -url: https://pytorch.org/ -labels: [basic, vision, fds] -dataset: [CIFAR-10] +title: Flower Transformers Example using HuggingFace +url: https://huggingface.co/ +labels: [quickstart, llm, nlp, sentiment] +dataset: [IMDB] +framework: [transformers] --- # Federated HuggingFace Transformers using Flower and PyTorch diff --git a/examples/quickstart-jax/README.md b/examples/quickstart-jax/README.md index 03ab1d838634..2218372a67f2 100644 --- a/examples/quickstart-jax/README.md +++ b/examples/quickstart-jax/README.md @@ -1,8 +1,9 @@ --- -title: "Simple Flower Example using PyTorch" -url: https://pytorch.org/ -labels: [basic, vision, fds] -dataset: [CIFAR-10] +title: Simple Flower Example using Jax +url: https://github.com/google/jax +labels: [quickstart, linear regression] +dataset: [synthetic] +framework: [JAX] --- # JAX: From Centralized To Federated diff --git a/examples/quickstart-mlcube/README.md b/examples/quickstart-mlcube/README.md index 53c83bb6c451..b30da9bf540c 100644 --- a/examples/quickstart-mlcube/README.md +++ b/examples/quickstart-mlcube/README.md @@ -1,8 +1,9 @@ --- -title: "Simple Flower Example using PyTorch" -url: https://pytorch.org/ -labels: [basic, vision, fds] -dataset: [CIFAR-10] +title: Flower Example using TensorFlow/Keras + MLCube +url: https://mlcube.org/ +labels: [quickstart, vision, deployment] +dataset: [MNIST] +framework: [TensorFlow, Keras] --- # Flower Example using TensorFlow/Keras + MLCube diff --git a/examples/quickstart-mlx/README.md b/examples/quickstart-mlx/README.md index 847e6fed8637..2454d4743387 100644 --- a/examples/quickstart-mlx/README.md +++ b/examples/quickstart-mlx/README.md @@ -1,8 +1,9 @@ --- -title: "Simple Flower Example using PyTorch" -url: https://pytorch.org/ -labels: [basic, vision, fds] -dataset: [CIFAR-10] +title: Simple Flower Example using MLX +url: https://ml-explore.github.io/mlx/build/html/index.html +labels: [quickstart, vision] +dataset: [MNIST] +framework: [MLX] --- # Flower Example using MLX diff --git a/examples/quickstart-monai/README.md b/examples/quickstart-monai/README.md index 443f6b2041a4..6723fb883805 100644 --- a/examples/quickstart-monai/README.md +++ b/examples/quickstart-monai/README.md @@ -1,8 +1,9 @@ --- -title: "Simple Flower Example using PyTorch" -url: https://pytorch.org/ -labels: [basic, vision, fds] -dataset: [CIFAR-10] +title: Flower Example using MONAI +url: https://docs.monai.io/en/latest/index.html +labels: [quickstart, medical, vision] +dataset: [MedNIST] +framework: [MONAI] --- # Flower Example using MONAI From b885819a46fd40d95d8be7c259cf27319c162371 Mon Sep 17 00:00:00 2001 From: Charles Beauville Date: Wed, 26 Jun 2024 11:03:30 +0200 Subject: [PATCH 10/66] Remove index from history --- examples/doc/source/.gitignore | 1 + examples/doc/source/index.rst | 309 --------------------------------- 2 files changed, 1 insertion(+), 309 deletions(-) delete mode 100644 examples/doc/source/index.rst diff --git a/examples/doc/source/.gitignore b/examples/doc/source/.gitignore index dd449725e188..73ee14e96f68 100644 --- a/examples/doc/source/.gitignore +++ b/examples/doc/source/.gitignore @@ -1 +1,2 @@ *.md +index.rst diff --git a/examples/doc/source/index.rst b/examples/doc/source/index.rst deleted file mode 100644 index b4aab6b86632..000000000000 --- a/examples/doc/source/index.rst +++ /dev/null @@ -1,309 +0,0 @@ -Flower Examples Documentation ------------------------------ - - -.. list-table:: - :widths: 50 15 15 15 - :header-rows: 1 - - * - Title - - Framework - - Dataset - - Tags - - * - `"Advanced Flower Example using PyTorch" `_ - - PyTorch - - CIFAR-10 - - basic, vision, fds - - - * - `"Flower Android Example using Kotlin and TF Lite" `_ - - Android, Kotlin, TensorFlowLite - - CIFAR-10 - - basic, vision, fds - - - * - `"Flower Android Example using Java and TF Lite" `_ - - Android, Java, TensorFlowLite - - CIFAR-10 - - basic, vision, fds - - - * - `"Example Flower App using PyTorch" `_ - - PyTorch - - CIFAR-10 - - basic, vision, fds - - - * - `"Example Flower App with Secure Aggregation" `_ - - PyTorch - - CIFAR-10 - - basic, vision, fds - - - * - `"Example Flower App with Custom Metrics" `_ - - PyTorch - - CIFAR-10 - - basic, vision, fds - - - * - `"Example Flower App with Custom Metrics" `_ - - PyTorch - - CIFAR-10 - - basic, vision, fds - - - * - `"Simple Flower Example using PyTorch" `_ - - - - CIFAR-10 - - basic, vision, fds - - - * - `"Simple Flower Example using PyTorch" `_ - - - - CIFAR-10 - - basic, vision, fds - - - * - `"Simple Flower Example using PyTorch" `_ - - - - CIFAR-10 - - basic, vision, fds - - - * - `"Simple Flower Example using PyTorch" `_ - - - - CIFAR-10 - - basic, vision, fds - - - * - `"Simple Flower Example using PyTorch" `_ - - - - CIFAR-10 - - basic, vision, fds - - - * - `"Simple Flower Example using PyTorch" `_ - - - - CIFAR-10 - - basic, vision, fds - - - * - `"Simple Flower Example using PyTorch" `_ - - - - CIFAR-10 - - basic, vision, fds - - - * - `"Simple Flower Example using PyTorch" `_ - - - - CIFAR-10 - - basic, vision, fds - - - * - `"Simple Flower Example using PyTorch" `_ - - - - CIFAR-10 - - basic, vision, fds - - - * - `"Simple Flower Example using PyTorch" `_ - - - - CIFAR-10 - - basic, vision, fds - - - * - `"Simple Flower Example using PyTorch" `_ - - - - CIFAR-10 - - basic, vision, fds - - - * - `"Simple Flower Example using PyTorch" `_ - - - - CIFAR-10 - - basic, vision, fds - - - * - `"Simple Flower Example using PyTorch" `_ - - - - CIFAR-10 - - basic, vision, fds - - - * - `"Simple Flower Example using PyTorch" `_ - - - - CIFAR-10 - - basic, vision, fds - - - * - `"Simple Flower Example using PyTorch" `_ - - - - CIFAR-10 - - basic, vision, fds - - - * - `"Simple Flower Example using PyTorch" `_ - - - - CIFAR-10 - - basic, vision, fds - - - * - `"Simple Flower Example using PyTorch" `_ - - - - CIFAR-10 - - basic, vision, fds - - - * - `"Simple Flower Example using PyTorch" `_ - - - - CIFAR-10 - - basic, vision, fds - - - * - `"Simple Flower Example using PyTorch" `_ - - - - CIFAR-10 - - basic, vision, fds - - - * - `"Simple Flower Example using PyTorch" `_ - - - - CIFAR-10 - - basic, vision, fds - - - * - `"Simple Flower Example using PyTorch" `_ - - - - CIFAR-10 - - basic, vision, fds - - - * - `"Simple Flower Example using PyTorch" `_ - - - - CIFAR-10 - - basic, vision, fds - - - * - `"Simple Flower Example using PyTorch" `_ - - - - CIFAR-10 - - basic, vision, fds - - - * - `"Simple Flower Example using PyTorch" `_ - - - - CIFAR-10 - - basic, vision, fds - - - * - `"Simple Flower Example using PyTorch" `_ - - - - CIFAR-10 - - basic, vision, fds - - - * - `"Simple Flower Example using PyTorch" `_ - - - - CIFAR-10 - - basic, vision, fds - - - * - `"Simple Flower Example using PyTorch" `_ - - - - CIFAR-10 - - basic, vision, fds - - - * - `"Simple Flower Example using PyTorch" `_ - - - - CIFAR-10 - - basic, vision, fds - - - * - `"Simple Flower Example using PyTorch" `_ - - - - CIFAR-10 - - basic, vision, fds - - - * - `"Simple Flower Example using PyTorch" `_ - - - - CIFAR-10 - - basic, vision, fds - - - * - `"Simple Flower Example using PyTorch" `_ - - - - CIFAR-10 - - basic, vision, fds - - - * - `"Simple Flower Example using PyTorch" `_ - - - - CIFAR-10 - - basic, vision, fds - - - * - `"Simple Flower Example using PyTorch" `_ - - - - CIFAR-10 - - basic, vision, fds - - - * - `"Simple Flower Example using PyTorch" `_ - - - - CIFAR-10 - - basic, vision, fds - -.. BASELINES_TABLE_ENTRY - - -.. toctree:: - :maxdepth: 1 - :caption: References - - advanced-pytorch - advanced-tensorflow - android-kotlin - android - app-pytorch - app-secure-aggregation - custom-metrics - custom-mods - embedded-devices - federated-kaplan-meier-fitter - flower-authentication - flower-in-30-minutes - flower-simulation-step-by-step-pytorch - flower-via-docker-compose - fl-dp-sa - fl-tabular - ios - llm-flowertune - opacus - pytorch-federated-variational-autoencoder - pytorch-from-centralized-to-federated - quickstart-cpp - quickstart-fastai - quickstart-huggingface - quickstart-jax - quickstart-mlcube - quickstart-mlx - quickstart-monai - quickstart-pandas - quickstart-pytorch-lightning - quickstart-pytorch - quickstart-sklearn-tabular - quickstart-tabnet - quickstart-tensorflow - simulation-pytorch - simulation-tensorflow - sklearn-logreg-mnist - tensorflow-privacy - vertical-fl - vit-finetune - whisper-federated-finetuning - xgboost-comprehensive - xgboost-quickstart - From 983d086439fa736c8b64a9d2cee8f916775ba424 Mon Sep 17 00:00:00 2001 From: Charles Beauville Date: Wed, 26 Jun 2024 12:58:41 +0200 Subject: [PATCH 11/66] Update some metadata --- examples/quickstart-pandas/README.md | 9 +++++---- examples/quickstart-pytorch-lightning/README.md | 7 ++++--- examples/quickstart-pytorch/README.md | 5 +++-- examples/quickstart-sklearn-tabular/README.md | 9 +++++---- examples/quickstart-tabnet/README.md | 9 +++++---- examples/quickstart-tensorflow/README.md | 7 ++++--- examples/simulation-pytorch/README.md | 7 ++++--- examples/simulation-tensorflow/README.md | 9 +++++---- examples/sklearn-logreg-mnist/README.md | 7 ++++--- examples/tensorflow-privacy/README.md | 9 +++++---- examples/vertical-fl/README.md | 9 +++++---- examples/vit-finetune/README.md | 3 ++- 12 files changed, 51 insertions(+), 39 deletions(-) diff --git a/examples/quickstart-pandas/README.md b/examples/quickstart-pandas/README.md index 1ba25dec2fa0..0fec9d588aa0 100644 --- a/examples/quickstart-pandas/README.md +++ b/examples/quickstart-pandas/README.md @@ -1,8 +1,9 @@ --- -title: "Simple Flower Example using PyTorch" -url: https://pytorch.org/ -labels: [basic, vision, fds] -dataset: [CIFAR-10] +title: Simple Flower Example using Pandas +url: https://pandas.pydata.org/ +labels: [quickstart, tabular, federated analytics] +dataset: [iris] +framework: [Pandas] --- # Flower Example using Pandas diff --git a/examples/quickstart-pytorch-lightning/README.md b/examples/quickstart-pytorch-lightning/README.md index bd3923cbede0..5c1c995ec9a5 100644 --- a/examples/quickstart-pytorch-lightning/README.md +++ b/examples/quickstart-pytorch-lightning/README.md @@ -1,8 +1,9 @@ --- -title: "Simple Flower Example using PyTorch" +title: Simple Flower Example using PyTorch-Lightning url: https://pytorch.org/ -labels: [basic, vision, fds] -dataset: [CIFAR-10] +labels: [quickstart, vision, fds] +dataset: [MNIST] +framework: [PyTorch-Lightning] --- # Flower Example using PyTorch Lightning diff --git a/examples/quickstart-pytorch/README.md b/examples/quickstart-pytorch/README.md index a6c8f2f49a7c..e9ba1a6056ff 100644 --- a/examples/quickstart-pytorch/README.md +++ b/examples/quickstart-pytorch/README.md @@ -1,8 +1,9 @@ --- -title: "Simple Flower Example using PyTorch" +title: Simple Flower Example using PyTorch url: https://pytorch.org/ -labels: [basic, vision, fds] +labels: [quickstart, vision, fds] dataset: [CIFAR-10] +framework: [PyTorch] --- # Flower Example using PyTorch diff --git a/examples/quickstart-sklearn-tabular/README.md b/examples/quickstart-sklearn-tabular/README.md index 0d4836367b64..c4239a8c3e0e 100644 --- a/examples/quickstart-sklearn-tabular/README.md +++ b/examples/quickstart-sklearn-tabular/README.md @@ -1,8 +1,9 @@ --- -title: "Simple Flower Example using PyTorch" -url: https://pytorch.org/ -labels: [basic, vision, fds] -dataset: [CIFAR-10] +title: Simple Flower Example using Scikit-Learn +url: https://scikit-learn.org/ +labels: [basic, tabular, fds] +dataset: [iris] +framework: [scikit-learn] --- # Flower Example using scikit-learn diff --git a/examples/quickstart-tabnet/README.md b/examples/quickstart-tabnet/README.md index a0913e860468..290c3c18da88 100644 --- a/examples/quickstart-tabnet/README.md +++ b/examples/quickstart-tabnet/README.md @@ -1,8 +1,9 @@ --- -title: "Simple Flower Example using PyTorch" -url: https://pytorch.org/ -labels: [basic, vision, fds] -dataset: [CIFAR-10] +title: Simple Flower Example using Tabnet +url: https://github.com/titu1994/tf-TabNet +labels: [quickstart, tabular] +dataset: [iris] +framework: [tabnet] --- # Flower TabNet Example using TensorFlow diff --git a/examples/quickstart-tensorflow/README.md b/examples/quickstart-tensorflow/README.md index e47df1c8c42a..84459fdbb644 100644 --- a/examples/quickstart-tensorflow/README.md +++ b/examples/quickstart-tensorflow/README.md @@ -1,8 +1,9 @@ --- -title: "Simple Flower Example using PyTorch" -url: https://pytorch.org/ -labels: [basic, vision, fds] +title: Simple Flower Example using TensorFlow +url: https://tensorflow.org/ +labels: [quickstart, vision, fds] dataset: [CIFAR-10] +framework: [TensorFlow] --- # Flower Example using TensorFlow/Keras diff --git a/examples/simulation-pytorch/README.md b/examples/simulation-pytorch/README.md index 5bc277917279..1ee3c64d2a1f 100644 --- a/examples/simulation-pytorch/README.md +++ b/examples/simulation-pytorch/README.md @@ -1,8 +1,9 @@ --- -title: "Simple Flower Example using PyTorch" +title: Flower Simulation Example using PyTorch url: https://pytorch.org/ -labels: [basic, vision, fds] -dataset: [CIFAR-10] +labels: [basic, vision, fds, simulation] +dataset: [MNIST] +framework: [PyTorch] --- # Flower Simulation example using PyTorch diff --git a/examples/simulation-tensorflow/README.md b/examples/simulation-tensorflow/README.md index 089c1a9b7e7d..a4446969b677 100644 --- a/examples/simulation-tensorflow/README.md +++ b/examples/simulation-tensorflow/README.md @@ -1,8 +1,9 @@ --- -title: "Simple Flower Example using PyTorch" -url: https://pytorch.org/ -labels: [basic, vision, fds] -dataset: [CIFAR-10] +title: Flower Simulation Example using TensorFlow/Keras +url: https://tensorflow.org/ +labels: [basic, vision, fds, simulation] +dataset: [MNIST] +framework: [TensorFlow, Keras] --- # Flower Simulation example using TensorFlow/Keras diff --git a/examples/sklearn-logreg-mnist/README.md b/examples/sklearn-logreg-mnist/README.md index 7cdb535742b0..72d54b0d04c4 100644 --- a/examples/sklearn-logreg-mnist/README.md +++ b/examples/sklearn-logreg-mnist/README.md @@ -1,8 +1,9 @@ --- -title: "Simple Flower Example using PyTorch" +title: Simple Flower Example using Scikit-Learn url: https://pytorch.org/ -labels: [basic, vision, fds] -dataset: [CIFAR-10] +labels: [basic, vision, logistic regression, fds] +dataset: [MNIST] +framework: [scikit-learn] --- # Flower Example using scikit-learn diff --git a/examples/tensorflow-privacy/README.md b/examples/tensorflow-privacy/README.md index 65cdb59d7a32..7f69c8290aba 100644 --- a/examples/tensorflow-privacy/README.md +++ b/examples/tensorflow-privacy/README.md @@ -1,8 +1,9 @@ --- -title: "Simple Flower Example using PyTorch" -url: https://pytorch.org/ -labels: [basic, vision, fds] -dataset: [CIFAR-10] +title: Sample-Level DP using TensorFlow-Privacy Engine +url: https://tensorflow.org/ +labels: [basic, vision, fds, privacy, dp] +dataset: [MNIST] +framework: [TensorFlow] --- # Training with Sample-Level Differential Privacy using TensorFlow-Privacy Engine diff --git a/examples/vertical-fl/README.md b/examples/vertical-fl/README.md index 04e6a4a0e0a1..706bb1d7b42f 100644 --- a/examples/vertical-fl/README.md +++ b/examples/vertical-fl/README.md @@ -1,8 +1,9 @@ --- -title: "Simple Flower Example using PyTorch" -url: https://pytorch.org/ -labels: [basic, vision, fds] -dataset: [CIFAR-10] +title: Vertical FL Flower Example +url: https://www.kaggle.com/competitions/titanic/data +labels: [vertical, tabular, advanced] +dataset: [Titanic] +framework: [torch, pandas, scikit-learn] --- # Vertical Federated Learning example diff --git a/examples/vit-finetune/README.md b/examples/vit-finetune/README.md index 3ff36d0fa2c4..8f7cdd9650d4 100644 --- a/examples/vit-finetune/README.md +++ b/examples/vit-finetune/README.md @@ -1,8 +1,9 @@ --- -title: "Simple Flower Example using PyTorch" +title: Federated finetuning of a ViT url: https://pytorch.org/ labels: [basic, vision, fds] dataset: [CIFAR-10] +framework: [torchvision] --- # Federated finetuning of a ViT From 15bd6d6afd8673c62cc3cf2b0c34334961f07407 Mon Sep 17 00:00:00 2001 From: Charles Beauville Date: Wed, 26 Jun 2024 15:54:22 +0200 Subject: [PATCH 12/66] Update metadata --- examples/vit-finetune/README.md | 6 +++--- examples/whisper-federated-finetuning/README.md | 7 ++++--- examples/xgboost-comprehensive/README.md | 7 ++++--- examples/xgboost-quickstart/README.md | 7 ++++--- 4 files changed, 15 insertions(+), 12 deletions(-) diff --git a/examples/vit-finetune/README.md b/examples/vit-finetune/README.md index 8f7cdd9650d4..241fadec48c9 100644 --- a/examples/vit-finetune/README.md +++ b/examples/vit-finetune/README.md @@ -1,9 +1,9 @@ --- title: Federated finetuning of a ViT url: https://pytorch.org/ -labels: [basic, vision, fds] -dataset: [CIFAR-10] -framework: [torchvision] +labels: [finetuneing, vision, fds] +dataset: [Oxford Flower-102] +framework: [torch, torchvision] --- # Federated finetuning of a ViT diff --git a/examples/whisper-federated-finetuning/README.md b/examples/whisper-federated-finetuning/README.md index 0e586f774d77..da22ebb545ab 100644 --- a/examples/whisper-federated-finetuning/README.md +++ b/examples/whisper-federated-finetuning/README.md @@ -1,8 +1,9 @@ --- -title: "Simple Flower Example using PyTorch" +title: On-device Federated Finetuning for Speech Classification url: https://pytorch.org/ -labels: [basic, vision, fds] -dataset: [CIFAR-10] +labels: [finetuning, speech, transformers] +dataset: [speech_commands] +framework: [huggingface, whisper] --- # On-device Federated Finetuning for Speech Classification diff --git a/examples/xgboost-comprehensive/README.md b/examples/xgboost-comprehensive/README.md index ecf71d0bb222..e9e71da1b19d 100644 --- a/examples/xgboost-comprehensive/README.md +++ b/examples/xgboost-comprehensive/README.md @@ -1,8 +1,9 @@ --- -title: "Simple Flower Example using PyTorch" +title: Flower Example using XGBoost url: https://pytorch.org/ -labels: [basic, vision, fds] -dataset: [CIFAR-10] +labels: [comprehensive, classification, tabular] +dataset: [HIGGS] +framework: [xgboost] --- # Flower Example using XGBoost (Comprehensive) diff --git a/examples/xgboost-quickstart/README.md b/examples/xgboost-quickstart/README.md index 3e7e246b6458..0fba8e5a84bd 100644 --- a/examples/xgboost-quickstart/README.md +++ b/examples/xgboost-quickstart/README.md @@ -1,8 +1,9 @@ --- -title: "Simple Flower Example using PyTorch" +title: Flower Example using PyTorch url: https://pytorch.org/ -labels: [basic, vision, fds] -dataset: [CIFAR-10] +labels: [comprehensive, classification, tabular] +dataset: [HIGGS] +framework: [xgboost] --- # Flower Example using XGBoost From b85d117c5beec6aa4c99c1945c03a0ee1ddbd75d Mon Sep 17 00:00:00 2001 From: Charles Beauville Date: Wed, 26 Jun 2024 16:08:41 +0200 Subject: [PATCH 13/66] Update metadata --- examples/fl-dp-sa/README.md | 1 + examples/pytorch-federated-variational-autoencoder/README.md | 3 ++- examples/pytorch-from-centralized-to-federated/README.md | 3 ++- 3 files changed, 5 insertions(+), 2 deletions(-) diff --git a/examples/fl-dp-sa/README.md b/examples/fl-dp-sa/README.md index cf5a357c383a..b191001c06b7 100644 --- a/examples/fl-dp-sa/README.md +++ b/examples/fl-dp-sa/README.md @@ -3,6 +3,7 @@ title: Example of Flower App with DP and SA url: https://pytorch.org/ labels: [basic, vision, fds] dataset: [CIFAR-10] +framework: [torch, torchvision] --- # fl_dp_sa diff --git a/examples/pytorch-federated-variational-autoencoder/README.md b/examples/pytorch-federated-variational-autoencoder/README.md index 01fdd2540602..be552c673c8d 100644 --- a/examples/pytorch-federated-variational-autoencoder/README.md +++ b/examples/pytorch-federated-variational-autoencoder/README.md @@ -1,8 +1,9 @@ --- -title: "Simple Flower Example using PyTorch" +title: Federated Variational Autoencoder using Pytorch url: https://pytorch.org/ labels: [basic, vision, fds] dataset: [CIFAR-10] +framework: [torch, torchvision] --- # Flower Example for Federated Variational Autoencoder using Pytorch diff --git a/examples/pytorch-from-centralized-to-federated/README.md b/examples/pytorch-from-centralized-to-federated/README.md index 534daf05669a..365e68bd5547 100644 --- a/examples/pytorch-from-centralized-to-federated/README.md +++ b/examples/pytorch-from-centralized-to-federated/README.md @@ -1,8 +1,9 @@ --- -title: "Simple Flower Example using PyTorch" +title: PyTorch, From Centralized To Federated url: https://pytorch.org/ labels: [basic, vision, fds] dataset: [CIFAR-10] +framework: [torch] --- # PyTorch: From Centralized To Federated From 2769eec501634db2ae494dcd11fb63fa281bbb29 Mon Sep 17 00:00:00 2001 From: Charles Beauville Date: Wed, 26 Jun 2024 17:40:47 +0200 Subject: [PATCH 14/66] Update metadata --- examples/advanced-pytorch/README.md | 2 +- examples/app-pytorch/README.md | 2 +- examples/app-secure-aggregation/README.md | 4 ++-- examples/custom-metrics/README.md | 4 ++-- examples/custom-mods/README.md | 2 +- examples/fl-dp-sa/README.md | 2 +- examples/flower-authentication/README.md | 2 +- examples/flower-in-30-minutes/README.md | 2 +- examples/flower-simulation-step-by-step-pytorch/README.md | 2 +- examples/quickstart-pytorch/README.md | 2 +- examples/simulation-pytorch/README.md | 2 +- 11 files changed, 13 insertions(+), 13 deletions(-) diff --git a/examples/advanced-pytorch/README.md b/examples/advanced-pytorch/README.md index 39af1155213f..21b1f210ad45 100644 --- a/examples/advanced-pytorch/README.md +++ b/examples/advanced-pytorch/README.md @@ -3,7 +3,7 @@ title: Advanced Flower Example using PyTorch url: https://pytorch.org/ labels: [basic, vision, fds] dataset: [CIFAR-10] -framework: [PyTorch] +framework: [torch, torchvision] --- # Advanced Flower Example (PyTorch) diff --git a/examples/app-pytorch/README.md b/examples/app-pytorch/README.md index 38136284b0ce..f5240178f26b 100644 --- a/examples/app-pytorch/README.md +++ b/examples/app-pytorch/README.md @@ -3,7 +3,7 @@ title: Example Flower App using PyTorch url: https://pytorch.org/ labels: [basic, vision, fds] dataset: [CIFAR-10] -framework: [PyTorch] +framework: [torch, torchvision] --- # Flower App (PyTorch) 🧪 diff --git a/examples/app-secure-aggregation/README.md b/examples/app-secure-aggregation/README.md index 1212b8d289ae..779862307001 100644 --- a/examples/app-secure-aggregation/README.md +++ b/examples/app-secure-aggregation/README.md @@ -1,9 +1,9 @@ --- title: Example Flower App with Secure Aggregation -url: https://pytorch.org/ +url: https://numpy.org/ labels: [basic, vision, fds] dataset: [CIFAR-10] -framework: [PyTorch] +framework: [numpy] --- # Secure aggregation with Flower (the SecAgg+ protocol) 🧪 diff --git a/examples/custom-metrics/README.md b/examples/custom-metrics/README.md index c4dd489e97a1..5a28b6f64332 100644 --- a/examples/custom-metrics/README.md +++ b/examples/custom-metrics/README.md @@ -1,9 +1,9 @@ --- title: Example Flower App with Custom Metrics -url: https://pytorch.org/ +url: https://tensorflow.org/ labels: [basic, vision, fds] dataset: [CIFAR-10] -framework: [PyTorch] +framework: [tensorflow] --- # Flower Example using Custom Metrics diff --git a/examples/custom-mods/README.md b/examples/custom-mods/README.md index 16d6869b666b..2de8d1758e98 100644 --- a/examples/custom-mods/README.md +++ b/examples/custom-mods/README.md @@ -3,7 +3,7 @@ title: Example Flower App with Custom Metrics url: https://pytorch.org/ labels: [basic, vision, fds] dataset: [CIFAR-10] -framework: [PyTorch] +framework: [torch, wandb, tensorboard, torchvision] --- # Using custom mods 🧪 diff --git a/examples/fl-dp-sa/README.md b/examples/fl-dp-sa/README.md index b191001c06b7..c131d03abf6b 100644 --- a/examples/fl-dp-sa/README.md +++ b/examples/fl-dp-sa/README.md @@ -6,7 +6,7 @@ dataset: [CIFAR-10] framework: [torch, torchvision] --- -# fl_dp_sa +# Example of Flower App with DP and SA This is a simple example that utilizes central differential privacy with client-side fixed clipping and secure aggregation. Note: This example is designed for a small number of rounds and is intended for demonstration purposes. diff --git a/examples/flower-authentication/README.md b/examples/flower-authentication/README.md index 318f6203be0b..5bb9e04e75da 100644 --- a/examples/flower-authentication/README.md +++ b/examples/flower-authentication/README.md @@ -2,7 +2,7 @@ title: Flower Example with Authentication labels: [advanced, vision, fds] dataset: [CIFAR-10] -framework: [PyTorch] +framework: [torch, torchvision] --- # Flower Authentication with PyTorch 🧪 diff --git a/examples/flower-in-30-minutes/README.md b/examples/flower-in-30-minutes/README.md index 0422ccee6246..860af57fb7d5 100644 --- a/examples/flower-in-30-minutes/README.md +++ b/examples/flower-in-30-minutes/README.md @@ -3,7 +3,7 @@ title: 30-minute tutorial running Flower simulation with PyTorch url: https://pytorch.org/ labels: [colab, vision, simulation] dataset: [CIFAR-10] -framework: [PyTorch] +framework: [torch] --- # 30-minute tutorial running Flower simulation with PyTorch diff --git a/examples/flower-simulation-step-by-step-pytorch/README.md b/examples/flower-simulation-step-by-step-pytorch/README.md index fe29d55fa218..c21609e71b62 100644 --- a/examples/flower-simulation-step-by-step-pytorch/README.md +++ b/examples/flower-simulation-step-by-step-pytorch/README.md @@ -3,7 +3,7 @@ title: Flower Simulation Step-by-Step url: https://pytorch.org/ labels: [basic, vision, simulation] dataset: [MNIST] -framework: [PyTorch] +framework: [torch] --- # Flower Simulation Step-by-Step diff --git a/examples/quickstart-pytorch/README.md b/examples/quickstart-pytorch/README.md index e9ba1a6056ff..c6000a0cffc4 100644 --- a/examples/quickstart-pytorch/README.md +++ b/examples/quickstart-pytorch/README.md @@ -3,7 +3,7 @@ title: Simple Flower Example using PyTorch url: https://pytorch.org/ labels: [quickstart, vision, fds] dataset: [CIFAR-10] -framework: [PyTorch] +framework: [torch, torchvision] --- # Flower Example using PyTorch diff --git a/examples/simulation-pytorch/README.md b/examples/simulation-pytorch/README.md index 1ee3c64d2a1f..c2155d5b0b83 100644 --- a/examples/simulation-pytorch/README.md +++ b/examples/simulation-pytorch/README.md @@ -3,7 +3,7 @@ title: Flower Simulation Example using PyTorch url: https://pytorch.org/ labels: [basic, vision, fds, simulation] dataset: [MNIST] -framework: [PyTorch] +framework: [torch, torchvision] --- # Flower Simulation example using PyTorch From 1606179f0985303bdb0a67f778aa6f10461545b2 Mon Sep 17 00:00:00 2001 From: Charles Beauville Date: Wed, 26 Jun 2024 17:50:46 +0200 Subject: [PATCH 15/66] Update metatdata --- examples/custom-mods/README.md | 4 ++-- examples/fl-tabular/README.md | 2 +- examples/quickstart-sklearn-tabular/README.md | 4 ++-- examples/sklearn-logreg-mnist/README.md | 4 ++-- 4 files changed, 7 insertions(+), 7 deletions(-) diff --git a/examples/custom-mods/README.md b/examples/custom-mods/README.md index 2de8d1758e98..eaca92e9d56e 100644 --- a/examples/custom-mods/README.md +++ b/examples/custom-mods/README.md @@ -1,7 +1,7 @@ --- -title: Example Flower App with Custom Metrics +title: Example Flower App with Custom Mods url: https://pytorch.org/ -labels: [basic, vision, fds] +labels: [mods, monitoring, app] dataset: [CIFAR-10] framework: [torch, wandb, tensorboard, torchvision] --- diff --git a/examples/fl-tabular/README.md b/examples/fl-tabular/README.md index 313bc87c3fe6..6e37b0d0c9c4 100644 --- a/examples/fl-tabular/README.md +++ b/examples/fl-tabular/README.md @@ -1,5 +1,5 @@ --- -title: Simple Flower Example using Scikit-Learn +title: Flower Example on Adult Census Income Tabular Dataset url: https://pytorch.org/ labels: [basic, tabular, fds] dataset: [adult-census-income] diff --git a/examples/quickstart-sklearn-tabular/README.md b/examples/quickstart-sklearn-tabular/README.md index c4239a8c3e0e..043defae2487 100644 --- a/examples/quickstart-sklearn-tabular/README.md +++ b/examples/quickstart-sklearn-tabular/README.md @@ -1,7 +1,7 @@ --- -title: Simple Flower Example using Scikit-Learn +title: Flower Example using Scikit-Learn url: https://scikit-learn.org/ -labels: [basic, tabular, fds] +labels: [quickstart, tabular, fds] dataset: [iris] framework: [scikit-learn] --- diff --git a/examples/sklearn-logreg-mnist/README.md b/examples/sklearn-logreg-mnist/README.md index 72d54b0d04c4..d3be9fac9ea6 100644 --- a/examples/sklearn-logreg-mnist/README.md +++ b/examples/sklearn-logreg-mnist/README.md @@ -1,6 +1,6 @@ --- -title: Simple Flower Example using Scikit-Learn -url: https://pytorch.org/ +title: Flower LogReg Example using Scikit-Learn +url: https://scikit-learn.org/ labels: [basic, vision, logistic regression, fds] dataset: [MNIST] framework: [scikit-learn] From c5c7d29ff5525f3cc46b71ddb632332875afc7a8 Mon Sep 17 00:00:00 2001 From: Charles Beauville Date: Wed, 26 Jun 2024 18:13:16 +0200 Subject: [PATCH 16/66] Remove URL --- dev/build-example-docs.sh | 24 +++++++++---------- examples/advanced-pytorch/README.md | 1 - examples/advanced-tensorflow/README.md | 1 - examples/android-kotlin/README.md | 1 - examples/android/README.md | 1 - examples/app-pytorch/README.md | 1 - examples/app-secure-aggregation/README.md | 1 - examples/custom-metrics/README.md | 1 - examples/custom-mods/README.md | 1 - examples/embedded-devices/README.md | 1 - .../federated-kaplan-meier-fitter/README.md | 1 - examples/fl-dp-sa/README.md | 1 - examples/fl-tabular/README.md | 1 - examples/flower-in-30-minutes/README.md | 1 - .../README.md | 1 - examples/flower-via-docker-compose/README.md | 1 - examples/ios/README.md | 1 - examples/llm-flowertune/README.md | 1 - examples/opacus/README.md | 1 - .../README.md | 1 - .../README.md | 1 - examples/quickstart-cpp/README.md | 1 - examples/quickstart-fastai/README.md | 1 - examples/quickstart-huggingface/README.md | 1 - examples/quickstart-jax/README.md | 1 - examples/quickstart-mlcube/README.md | 1 - examples/quickstart-mlx/README.md | 1 - examples/quickstart-monai/README.md | 1 - examples/quickstart-pandas/README.md | 1 - .../quickstart-pytorch-lightning/README.md | 1 - examples/quickstart-pytorch/README.md | 1 - examples/quickstart-sklearn-tabular/README.md | 1 - examples/quickstart-tabnet/README.md | 1 - examples/quickstart-tensorflow/README.md | 1 - examples/simulation-pytorch/README.md | 1 - examples/simulation-tensorflow/README.md | 1 - examples/sklearn-logreg-mnist/README.md | 1 - examples/tensorflow-privacy/README.md | 1 - examples/vertical-fl/README.md | 1 - examples/vit-finetune/README.md | 1 - .../whisper-federated-finetuning/README.md | 1 - examples/xgboost-comprehensive/README.md | 1 - examples/xgboost-quickstart/README.md | 1 - 43 files changed, 12 insertions(+), 54 deletions(-) diff --git a/dev/build-example-docs.sh b/dev/build-example-docs.sh index e84078d21fd0..5fb641569af4 100755 --- a/dev/build-example-docs.sh +++ b/dev/build-example-docs.sh @@ -15,14 +15,14 @@ END table_body="\\ .. list-table:: \\ - :widths: 50 15 15 15\\ - :header-rows: 1\\ + :widths: 50 15 15 15 \\ + :header-rows: 1 \\ \\ * - Title \\ - - Framework\\ - - Dataset\\ - - Tags\\ - .. BASELINES_TABLE_ENTRY\\ + - Framework \\ + - Dataset \\ + - Tags \\ + .. BASELINES_TABLE_ENTRY \\ " function add_table_entry () @@ -34,7 +34,7 @@ function add_table_entry () title=$(echo "$metadata" | sed -n 's/title: //p') # get text after "url:" in metadata using sed - url=$(echo "$metadata" | sed -n 's/url: //p') + url=$(echo "$metadata" | sed -n 's|url: ||p') # get text after "labels:" in metadata using sed labels=$(echo "$metadata" | sed -n 's/labels: //p' | sed 's/\[//g; s/\]//g') @@ -45,12 +45,12 @@ function add_table_entry () framework=$(echo "$metadata" | sed -n 's/framework: //p' | sed 's/\[//g; s/\]//g') table_entry="\\ - * - \`$title <$1.html>\`_\\ - - $framework\\ - - $dataset\\ - - $labels\\ + * - \`$title <$1.html>\`_ \\ + - $framework \\ + - $dataset \\ + - $labels \\ \\ -.. BASELINES_TABLE_ENTRY\ +.. BASELINES_TABLE_ENTRY \ " } diff --git a/examples/advanced-pytorch/README.md b/examples/advanced-pytorch/README.md index 21b1f210ad45..183c1532bc70 100644 --- a/examples/advanced-pytorch/README.md +++ b/examples/advanced-pytorch/README.md @@ -1,6 +1,5 @@ --- title: Advanced Flower Example using PyTorch -url: https://pytorch.org/ labels: [basic, vision, fds] dataset: [CIFAR-10] framework: [torch, torchvision] diff --git a/examples/advanced-tensorflow/README.md b/examples/advanced-tensorflow/README.md index 1f60286b8c3f..8bad31755aa4 100644 --- a/examples/advanced-tensorflow/README.md +++ b/examples/advanced-tensorflow/README.md @@ -1,6 +1,5 @@ --- title: Advanced Flower Example using TensorFlow/Keras -url: https://tensorflow.org/ labels: [basic, vision, fds] dataset: [CIFAR-10] framework: [TensorFlow, Keras] diff --git a/examples/android-kotlin/README.md b/examples/android-kotlin/README.md index 68a78c5f64dd..efa84770ae2b 100644 --- a/examples/android-kotlin/README.md +++ b/examples/android-kotlin/README.md @@ -1,6 +1,5 @@ --- title: Flower Android Example using Kotlin and TF Lite -url: https://tensorflow.org/lite labels: [basic, vision, fds] dataset: [CIFAR-10] framework: [Android, Kotlin, TensorFlowLite] diff --git a/examples/android/README.md b/examples/android/README.md index ff1d9758b9fd..e9408568fc3b 100644 --- a/examples/android/README.md +++ b/examples/android/README.md @@ -1,6 +1,5 @@ --- title: Flower Android Example using Java and TF Lite -url: https://tensorflow.org/lite labels: [basic, vision, fds] dataset: [CIFAR-10] framework: [Android, Java, TensorFlowLite] diff --git a/examples/app-pytorch/README.md b/examples/app-pytorch/README.md index f5240178f26b..7ded976b1582 100644 --- a/examples/app-pytorch/README.md +++ b/examples/app-pytorch/README.md @@ -1,6 +1,5 @@ --- title: Example Flower App using PyTorch -url: https://pytorch.org/ labels: [basic, vision, fds] dataset: [CIFAR-10] framework: [torch, torchvision] diff --git a/examples/app-secure-aggregation/README.md b/examples/app-secure-aggregation/README.md index 779862307001..29526beb6ef9 100644 --- a/examples/app-secure-aggregation/README.md +++ b/examples/app-secure-aggregation/README.md @@ -1,6 +1,5 @@ --- title: Example Flower App with Secure Aggregation -url: https://numpy.org/ labels: [basic, vision, fds] dataset: [CIFAR-10] framework: [numpy] diff --git a/examples/custom-metrics/README.md b/examples/custom-metrics/README.md index 5a28b6f64332..0d3827482211 100644 --- a/examples/custom-metrics/README.md +++ b/examples/custom-metrics/README.md @@ -1,6 +1,5 @@ --- title: Example Flower App with Custom Metrics -url: https://tensorflow.org/ labels: [basic, vision, fds] dataset: [CIFAR-10] framework: [tensorflow] diff --git a/examples/custom-mods/README.md b/examples/custom-mods/README.md index eaca92e9d56e..ed62faf7e57b 100644 --- a/examples/custom-mods/README.md +++ b/examples/custom-mods/README.md @@ -1,6 +1,5 @@ --- title: Example Flower App with Custom Mods -url: https://pytorch.org/ labels: [mods, monitoring, app] dataset: [CIFAR-10] framework: [torch, wandb, tensorboard, torchvision] diff --git a/examples/embedded-devices/README.md b/examples/embedded-devices/README.md index 5bd08d7ca563..5854d1bfe089 100644 --- a/examples/embedded-devices/README.md +++ b/examples/embedded-devices/README.md @@ -1,6 +1,5 @@ --- title: Flower Embedded Devices Example -url: https://pytorch.org/ labels: [basic, vision, fds] dataset: [CIFAR-10] framework: [PyTorch, TensorFlow] diff --git a/examples/federated-kaplan-meier-fitter/README.md b/examples/federated-kaplan-meier-fitter/README.md index fb5f6cbda453..e8f353dc3c47 100644 --- a/examples/federated-kaplan-meier-fitter/README.md +++ b/examples/federated-kaplan-meier-fitter/README.md @@ -1,6 +1,5 @@ --- title: Flower Example using KaplanMeierFitter -url: https://pytorch.org/ labels: [estimator, medical] dataset: [Walton] framework: [lifelines] diff --git a/examples/fl-dp-sa/README.md b/examples/fl-dp-sa/README.md index c131d03abf6b..e8910706d3b8 100644 --- a/examples/fl-dp-sa/README.md +++ b/examples/fl-dp-sa/README.md @@ -1,6 +1,5 @@ --- title: Example of Flower App with DP and SA -url: https://pytorch.org/ labels: [basic, vision, fds] dataset: [CIFAR-10] framework: [torch, torchvision] diff --git a/examples/fl-tabular/README.md b/examples/fl-tabular/README.md index 6e37b0d0c9c4..b56732947b7b 100644 --- a/examples/fl-tabular/README.md +++ b/examples/fl-tabular/README.md @@ -1,6 +1,5 @@ --- title: Flower Example on Adult Census Income Tabular Dataset -url: https://pytorch.org/ labels: [basic, tabular, fds] dataset: [adult-census-income] framework: [scikit-learn] diff --git a/examples/flower-in-30-minutes/README.md b/examples/flower-in-30-minutes/README.md index 860af57fb7d5..3c4e13c4a294 100644 --- a/examples/flower-in-30-minutes/README.md +++ b/examples/flower-in-30-minutes/README.md @@ -1,6 +1,5 @@ --- title: 30-minute tutorial running Flower simulation with PyTorch -url: https://pytorch.org/ labels: [colab, vision, simulation] dataset: [CIFAR-10] framework: [torch] diff --git a/examples/flower-simulation-step-by-step-pytorch/README.md b/examples/flower-simulation-step-by-step-pytorch/README.md index c21609e71b62..890a3b2ed35d 100644 --- a/examples/flower-simulation-step-by-step-pytorch/README.md +++ b/examples/flower-simulation-step-by-step-pytorch/README.md @@ -1,6 +1,5 @@ --- title: Flower Simulation Step-by-Step -url: https://pytorch.org/ labels: [basic, vision, simulation] dataset: [MNIST] framework: [torch] diff --git a/examples/flower-via-docker-compose/README.md b/examples/flower-via-docker-compose/README.md index 8acd0f609512..b54b2c29ab84 100644 --- a/examples/flower-via-docker-compose/README.md +++ b/examples/flower-via-docker-compose/README.md @@ -1,6 +1,5 @@ --- title: Leveraging Flower and Docker for Device Heterogeneity Management in FL -url: https://pytorch.org/ labels: [deployment, vision, tutorial] dataset: [CIFAR-10] framework: [Docker] diff --git a/examples/ios/README.md b/examples/ios/README.md index 6c10e5298d55..e7d2d10808aa 100644 --- a/examples/ios/README.md +++ b/examples/ios/README.md @@ -1,6 +1,5 @@ --- title: Simple Flower Example on iOS -url: https://pytorch.org/ labels: [mobile, vision, fds] dataset: [MNIST] framework: [swift] diff --git a/examples/llm-flowertune/README.md b/examples/llm-flowertune/README.md index 797bc81cda50..ffa147c2e4f9 100644 --- a/examples/llm-flowertune/README.md +++ b/examples/llm-flowertune/README.md @@ -1,6 +1,5 @@ --- title: Federated LLM Fine-tuning with Flower -url: https://pytorch.org/ labels: [llm, nlp, LLama2] dataset: [Alpaca-GPT4] framework: [PEFT] diff --git a/examples/opacus/README.md b/examples/opacus/README.md index c3a6f0e43415..8cc6a96ebbfd 100644 --- a/examples/opacus/README.md +++ b/examples/opacus/README.md @@ -1,6 +1,5 @@ --- title: Sample-Level Differential Privacy using Opacus -url: https://pytorch.org/ labels: [dp, security, fds] dataset: [CIFAR-10] framework: [opacus, PyTorch] diff --git a/examples/pytorch-federated-variational-autoencoder/README.md b/examples/pytorch-federated-variational-autoencoder/README.md index be552c673c8d..a169b8fee8a1 100644 --- a/examples/pytorch-federated-variational-autoencoder/README.md +++ b/examples/pytorch-federated-variational-autoencoder/README.md @@ -1,6 +1,5 @@ --- title: Federated Variational Autoencoder using Pytorch -url: https://pytorch.org/ labels: [basic, vision, fds] dataset: [CIFAR-10] framework: [torch, torchvision] diff --git a/examples/pytorch-from-centralized-to-federated/README.md b/examples/pytorch-from-centralized-to-federated/README.md index 365e68bd5547..d377a9aa05ba 100644 --- a/examples/pytorch-from-centralized-to-federated/README.md +++ b/examples/pytorch-from-centralized-to-federated/README.md @@ -1,6 +1,5 @@ --- title: PyTorch, From Centralized To Federated -url: https://pytorch.org/ labels: [basic, vision, fds] dataset: [CIFAR-10] framework: [torch] diff --git a/examples/quickstart-cpp/README.md b/examples/quickstart-cpp/README.md index 3ddc09324493..4615ff3fb434 100644 --- a/examples/quickstart-cpp/README.md +++ b/examples/quickstart-cpp/README.md @@ -1,6 +1,5 @@ --- title: Simple Flower Example using C++ -url: https://pytorch.org/ labels: [quickstart, linear regression, tabular] dataset: [synthetic] framework: [c++] diff --git a/examples/quickstart-fastai/README.md b/examples/quickstart-fastai/README.md index da024a8d3ebb..aefbe6742f8c 100644 --- a/examples/quickstart-fastai/README.md +++ b/examples/quickstart-fastai/README.md @@ -1,6 +1,5 @@ --- title: Simple Flower Example using fastai -url: https://fast.ai/ labels: [quickstart, vision] dataset: [MNIST] framework: [fastai] diff --git a/examples/quickstart-huggingface/README.md b/examples/quickstart-huggingface/README.md index 62b611f9e45d..0385cbec01bb 100644 --- a/examples/quickstart-huggingface/README.md +++ b/examples/quickstart-huggingface/README.md @@ -1,6 +1,5 @@ --- title: Flower Transformers Example using HuggingFace -url: https://huggingface.co/ labels: [quickstart, llm, nlp, sentiment] dataset: [IMDB] framework: [transformers] diff --git a/examples/quickstart-jax/README.md b/examples/quickstart-jax/README.md index 2218372a67f2..1e9dfe18de97 100644 --- a/examples/quickstart-jax/README.md +++ b/examples/quickstart-jax/README.md @@ -1,6 +1,5 @@ --- title: Simple Flower Example using Jax -url: https://github.com/google/jax labels: [quickstart, linear regression] dataset: [synthetic] framework: [JAX] diff --git a/examples/quickstart-mlcube/README.md b/examples/quickstart-mlcube/README.md index b30da9bf540c..b287b00beca5 100644 --- a/examples/quickstart-mlcube/README.md +++ b/examples/quickstart-mlcube/README.md @@ -1,6 +1,5 @@ --- title: Flower Example using TensorFlow/Keras + MLCube -url: https://mlcube.org/ labels: [quickstart, vision, deployment] dataset: [MNIST] framework: [TensorFlow, Keras] diff --git a/examples/quickstart-mlx/README.md b/examples/quickstart-mlx/README.md index 2454d4743387..d0db96e9e049 100644 --- a/examples/quickstart-mlx/README.md +++ b/examples/quickstart-mlx/README.md @@ -1,6 +1,5 @@ --- title: Simple Flower Example using MLX -url: https://ml-explore.github.io/mlx/build/html/index.html labels: [quickstart, vision] dataset: [MNIST] framework: [MLX] diff --git a/examples/quickstart-monai/README.md b/examples/quickstart-monai/README.md index 6723fb883805..178268f98e3d 100644 --- a/examples/quickstart-monai/README.md +++ b/examples/quickstart-monai/README.md @@ -1,6 +1,5 @@ --- title: Flower Example using MONAI -url: https://docs.monai.io/en/latest/index.html labels: [quickstart, medical, vision] dataset: [MedNIST] framework: [MONAI] diff --git a/examples/quickstart-pandas/README.md b/examples/quickstart-pandas/README.md index 0fec9d588aa0..e94244714b29 100644 --- a/examples/quickstart-pandas/README.md +++ b/examples/quickstart-pandas/README.md @@ -1,6 +1,5 @@ --- title: Simple Flower Example using Pandas -url: https://pandas.pydata.org/ labels: [quickstart, tabular, federated analytics] dataset: [iris] framework: [Pandas] diff --git a/examples/quickstart-pytorch-lightning/README.md b/examples/quickstart-pytorch-lightning/README.md index 5c1c995ec9a5..af80bd8a5e9d 100644 --- a/examples/quickstart-pytorch-lightning/README.md +++ b/examples/quickstart-pytorch-lightning/README.md @@ -1,6 +1,5 @@ --- title: Simple Flower Example using PyTorch-Lightning -url: https://pytorch.org/ labels: [quickstart, vision, fds] dataset: [MNIST] framework: [PyTorch-Lightning] diff --git a/examples/quickstart-pytorch/README.md b/examples/quickstart-pytorch/README.md index c6000a0cffc4..a497e5d68837 100644 --- a/examples/quickstart-pytorch/README.md +++ b/examples/quickstart-pytorch/README.md @@ -1,6 +1,5 @@ --- title: Simple Flower Example using PyTorch -url: https://pytorch.org/ labels: [quickstart, vision, fds] dataset: [CIFAR-10] framework: [torch, torchvision] diff --git a/examples/quickstart-sklearn-tabular/README.md b/examples/quickstart-sklearn-tabular/README.md index 043defae2487..25ecd26ddf27 100644 --- a/examples/quickstart-sklearn-tabular/README.md +++ b/examples/quickstart-sklearn-tabular/README.md @@ -1,6 +1,5 @@ --- title: Flower Example using Scikit-Learn -url: https://scikit-learn.org/ labels: [quickstart, tabular, fds] dataset: [iris] framework: [scikit-learn] diff --git a/examples/quickstart-tabnet/README.md b/examples/quickstart-tabnet/README.md index 290c3c18da88..d07c79e88cb5 100644 --- a/examples/quickstart-tabnet/README.md +++ b/examples/quickstart-tabnet/README.md @@ -1,6 +1,5 @@ --- title: Simple Flower Example using Tabnet -url: https://github.com/titu1994/tf-TabNet labels: [quickstart, tabular] dataset: [iris] framework: [tabnet] diff --git a/examples/quickstart-tensorflow/README.md b/examples/quickstart-tensorflow/README.md index 84459fdbb644..4983074b44c7 100644 --- a/examples/quickstart-tensorflow/README.md +++ b/examples/quickstart-tensorflow/README.md @@ -1,6 +1,5 @@ --- title: Simple Flower Example using TensorFlow -url: https://tensorflow.org/ labels: [quickstart, vision, fds] dataset: [CIFAR-10] framework: [TensorFlow] diff --git a/examples/simulation-pytorch/README.md b/examples/simulation-pytorch/README.md index c2155d5b0b83..6c5a1dea4d6d 100644 --- a/examples/simulation-pytorch/README.md +++ b/examples/simulation-pytorch/README.md @@ -1,6 +1,5 @@ --- title: Flower Simulation Example using PyTorch -url: https://pytorch.org/ labels: [basic, vision, fds, simulation] dataset: [MNIST] framework: [torch, torchvision] diff --git a/examples/simulation-tensorflow/README.md b/examples/simulation-tensorflow/README.md index a4446969b677..7a80531a08b5 100644 --- a/examples/simulation-tensorflow/README.md +++ b/examples/simulation-tensorflow/README.md @@ -1,6 +1,5 @@ --- title: Flower Simulation Example using TensorFlow/Keras -url: https://tensorflow.org/ labels: [basic, vision, fds, simulation] dataset: [MNIST] framework: [TensorFlow, Keras] diff --git a/examples/sklearn-logreg-mnist/README.md b/examples/sklearn-logreg-mnist/README.md index d3be9fac9ea6..8d8a2eda4141 100644 --- a/examples/sklearn-logreg-mnist/README.md +++ b/examples/sklearn-logreg-mnist/README.md @@ -1,6 +1,5 @@ --- title: Flower LogReg Example using Scikit-Learn -url: https://scikit-learn.org/ labels: [basic, vision, logistic regression, fds] dataset: [MNIST] framework: [scikit-learn] diff --git a/examples/tensorflow-privacy/README.md b/examples/tensorflow-privacy/README.md index 7f69c8290aba..207bb8948734 100644 --- a/examples/tensorflow-privacy/README.md +++ b/examples/tensorflow-privacy/README.md @@ -1,6 +1,5 @@ --- title: Sample-Level DP using TensorFlow-Privacy Engine -url: https://tensorflow.org/ labels: [basic, vision, fds, privacy, dp] dataset: [MNIST] framework: [TensorFlow] diff --git a/examples/vertical-fl/README.md b/examples/vertical-fl/README.md index 706bb1d7b42f..020247612715 100644 --- a/examples/vertical-fl/README.md +++ b/examples/vertical-fl/README.md @@ -1,6 +1,5 @@ --- title: Vertical FL Flower Example -url: https://www.kaggle.com/competitions/titanic/data labels: [vertical, tabular, advanced] dataset: [Titanic] framework: [torch, pandas, scikit-learn] diff --git a/examples/vit-finetune/README.md b/examples/vit-finetune/README.md index 241fadec48c9..2cdb7af34b25 100644 --- a/examples/vit-finetune/README.md +++ b/examples/vit-finetune/README.md @@ -1,6 +1,5 @@ --- title: Federated finetuning of a ViT -url: https://pytorch.org/ labels: [finetuneing, vision, fds] dataset: [Oxford Flower-102] framework: [torch, torchvision] diff --git a/examples/whisper-federated-finetuning/README.md b/examples/whisper-federated-finetuning/README.md index da22ebb545ab..5aadfbeb7426 100644 --- a/examples/whisper-federated-finetuning/README.md +++ b/examples/whisper-federated-finetuning/README.md @@ -1,6 +1,5 @@ --- title: On-device Federated Finetuning for Speech Classification -url: https://pytorch.org/ labels: [finetuning, speech, transformers] dataset: [speech_commands] framework: [huggingface, whisper] diff --git a/examples/xgboost-comprehensive/README.md b/examples/xgboost-comprehensive/README.md index e9e71da1b19d..834d5f8bbbf6 100644 --- a/examples/xgboost-comprehensive/README.md +++ b/examples/xgboost-comprehensive/README.md @@ -1,6 +1,5 @@ --- title: Flower Example using XGBoost -url: https://pytorch.org/ labels: [comprehensive, classification, tabular] dataset: [HIGGS] framework: [xgboost] diff --git a/examples/xgboost-quickstart/README.md b/examples/xgboost-quickstart/README.md index 0fba8e5a84bd..1ad9b0b4d3f0 100644 --- a/examples/xgboost-quickstart/README.md +++ b/examples/xgboost-quickstart/README.md @@ -1,6 +1,5 @@ --- title: Flower Example using PyTorch -url: https://pytorch.org/ labels: [comprehensive, classification, tabular] dataset: [HIGGS] framework: [xgboost] From efcd732bdd5b48feeea169ad9a48a0d0f0a369e4 Mon Sep 17 00:00:00 2001 From: Charles Beauville Date: Wed, 26 Jun 2024 18:13:45 +0200 Subject: [PATCH 17/66] Remove URL handling --- dev/build-example-docs.sh | 3 --- 1 file changed, 3 deletions(-) diff --git a/dev/build-example-docs.sh b/dev/build-example-docs.sh index 5fb641569af4..31773046f372 100755 --- a/dev/build-example-docs.sh +++ b/dev/build-example-docs.sh @@ -33,9 +33,6 @@ function add_table_entry () # get text after "title:" in metadata using sed title=$(echo "$metadata" | sed -n 's/title: //p') - # get text after "url:" in metadata using sed - url=$(echo "$metadata" | sed -n 's|url: ||p') - # get text after "labels:" in metadata using sed labels=$(echo "$metadata" | sed -n 's/labels: //p' | sed 's/\[//g; s/\]//g') From af1716177ce398518a44d76af06de698025d6606 Mon Sep 17 00:00:00 2001 From: Charles Beauville Date: Fri, 28 Jun 2024 13:46:23 +0200 Subject: [PATCH 18/66] Improve format and add dscription to table --- dev/build-example-docs.sh | 48 ++++++++++++++++++++++++++++++--------- 1 file changed, 37 insertions(+), 11 deletions(-) diff --git a/dev/build-example-docs.sh b/dev/build-example-docs.sh index 31773046f372..00da746b5fec 100755 --- a/dev/build-example-docs.sh +++ b/dev/build-example-docs.sh @@ -6,10 +6,10 @@ ROOT=`pwd` INDEX=$ROOT/examples/doc/source/index.rst INSERT_LINE=6 -initial_text=$(cat <<-END +table_text=$(cat <<-END .. toctree:: :maxdepth: 1 - :caption: References + :caption: Projects END ) @@ -22,7 +22,7 @@ table_body="\\ - Framework \\ - Dataset \\ - Tags \\ - .. BASELINES_TABLE_ENTRY \\ + .. EXAMPLES_TABLE_ENTRY \\ " function add_table_entry () @@ -47,7 +47,7 @@ function add_table_entry () - $dataset \\ - $labels \\ \\ -.. BASELINES_TABLE_ENTRY \ +.. EXAMPLES_TABLE_ENTRY \ " } @@ -124,12 +124,38 @@ rm -f $INDEX # Create empty index file touch $INDEX -echo "Flower Examples Documentation" >> $INDEX -echo "-----------------------------" >> $INDEX -echo "" >> $INDEX -echo ".. BASELINES_TABLE_ANCHOR" >> $INDEX -! sed -i '' -e "s/.. BASELINES_TABLE_ANCHOR/$table_body/" $INDEX +initial_text=$(cat <<-END +Flower Examples Documentation +----------------------------- + +Welcome to Flower Examples' documentation. \`Flower \`_ is a friendly federated learning framework. + + +Join the Flower Community +------------------------- + +The Flower Community is growing quickly - we're a friendly group of researchers, engineers, students, professionals, academics, and other enthusiasts. + +.. button-link:: https://flower.ai/join-slack + :color: primary + :shadow: + + Join us on Slack + + +Flower Examples +--------------- + +Flower Examples are a collection of example projects written with Flower that explore different domains and features. You can check which examples already exist and/or contribute your own baseline. + +.. EXAMPLES_TABLE_ANCHOR +END +) + +echo "$initial_text" >> $INDEX + +! sed -i '' -e "s/.. EXAMPLES_TABLE_ANCHOR/$table_body/" $INDEX cd $ROOT/examples # Iterate through each folder in examples/ @@ -150,12 +176,12 @@ for d in $(printf '%s\n' */ | sort -V); do copy_images $example add_table_entry $example - ! sed -i '' -e "s/.. BASELINES_TABLE_ENTRY/$table_entry/" $INDEX + ! sed -i '' -e "s/.. EXAMPLES_TABLE_ENTRY/$table_entry/" $INDEX fi done echo "" >> $INDEX -echo "$initial_text" >> $INDEX +echo "$table_text" >> $INDEX echo "" >> $INDEX add_all_entries From 0baefdc68afe011da5b6b99c5d493c9d0b71bcdd Mon Sep 17 00:00:00 2001 From: Charles Beauville Date: Fri, 28 Jun 2024 14:13:12 +0200 Subject: [PATCH 19/66] Separate tables --- dev/build-example-docs.sh | 97 ++++++++++++++++++++--------- examples/embedded-devices/README.md | 2 +- 2 files changed, 68 insertions(+), 31 deletions(-) diff --git a/dev/build-example-docs.sh b/dev/build-example-docs.sh index 00da746b5fec..aadede27a010 100755 --- a/dev/build-example-docs.sh +++ b/dev/build-example-docs.sh @@ -13,22 +13,14 @@ table_text=$(cat <<-END END ) -table_body="\\ -.. list-table:: \\ - :widths: 50 15 15 15 \\ - :header-rows: 1 \\ - \\ - * - Title \\ - - Framework \\ - - Dataset \\ - - Tags \\ - .. EXAMPLES_TABLE_ENTRY \\ - " - function add_table_entry () { + local example="$1" + local label="$2" + local table_var="$3" + # extract lines from markdown file between --- and ---, preserving newlines and store in variable called metadata - metadata=$(awk '/^---$/{flag=1; next} flag; /^---$/{exit}' $1/README.md) + metadata=$(awk '/^---$/{flag=1; next} flag; /^---$/{exit}' $example/README.md) # get text after "title:" in metadata using sed title=$(echo "$metadata" | sed -n 's/title: //p') @@ -41,14 +33,13 @@ function add_table_entry () framework=$(echo "$metadata" | sed -n 's/framework: //p' | sed 's/\[//g; s/\]//g') - table_entry="\\ - * - \`$title <$1.html>\`_ \\ - - $framework \\ - - $dataset \\ - - $labels \\ - \\ -.. EXAMPLES_TABLE_ENTRY \ - " + table_entry=" * - \`$title <$example.html>\`_ \n - $framework \n - $dataset \n - $labels\n\n" + + if [[ "$labels" == *"$label"* ]]; then + eval "$table_var+=\$table_entry" + return 0 + fi + return 1 } copy_markdown_files () { @@ -124,7 +115,6 @@ rm -f $INDEX # Create empty index file touch $INDEX - initial_text=$(cat <<-END Flower Examples Documentation ----------------------------- @@ -144,18 +134,21 @@ The Flower Community is growing quickly - we're a friendly group of researchers, Join us on Slack -Flower Examples ---------------- +Quickstart Examples +------------------- -Flower Examples are a collection of example projects written with Flower that explore different domains and features. You can check which examples already exist and/or contribute your own baseline. +Flower Quickstart Examples are a collection of demo project that show how you can use Flower in combination with other existing frameworks or technologies. -.. EXAMPLES_TABLE_ANCHOR END ) echo "$initial_text" >> $INDEX -! sed -i '' -e "s/.. EXAMPLES_TABLE_ANCHOR/$table_body/" $INDEX +# Table headers +quickstart_table="\n.. list-table::\n :widths: 50 15 15 15\n :header-rows: 1\n\n * - Title\n - Framework\n - Dataset\n - Tags\n\n" +comprehensive_table="\n.. list-table::\n :widths: 50 15 15 15\n :header-rows: 1\n\n * - Title\n - Framework\n - Dataset\n - Tags\n\n" +advanced_table="\n.. list-table::\n :widths: 50 15 15 15\n :header-rows: 1\n\n * - Title\n - Framework\n - Dataset\n - Tags\n\n" +other_table="\n.. list-table::\n :widths: 50 15 15 15\n :header-rows: 1\n\n * - Title\n - Framework\n - Dataset\n - Tags\n\n" cd $ROOT/examples # Iterate through each folder in examples/ @@ -164,7 +157,6 @@ for d in $(printf '%s\n' */ | sort -V); do example=${d%/} if [[ $example != doc ]]; then - # Copy markdown files to correct folder copy_markdown_files $example @@ -175,11 +167,56 @@ for d in $(printf '%s\n' */ | sort -V); do # docs static folder copy_images $example - add_table_entry $example - ! sed -i '' -e "s/.. EXAMPLES_TABLE_ENTRY/$table_entry/" $INDEX + # Add entry to the appropriate table + if ! add_table_entry $example "quickstart" quickstart_table; then + if ! add_table_entry $example "comprehensive" comprehensive_table; then + if ! add_table_entry $example "advanced" advanced_table; then + add_table_entry $example "" other_table + fi + fi + fi fi done +# Add the tables to the index +echo -e "$quickstart_table" >> $INDEX + +tmp_text=$(cat <<-END +Comprehensive Examples +---------------------- + +Comprehensive example allow us to explore certain topics more in-depth and are often associated with a simpler, less detailed, example. + +END +) +echo -e "$tmp_text" >> $INDEX + +echo -e "$comprehensive_table" >> $INDEX + +tmp_text=$(cat <<-END +Advanced Examples +----------------- + +Advanced Examples are mostly for users that are both familiar with Federated Learning but also somewhat familiar with Flower\'s main features. + +END +) +echo -e "$tmp_text" >> $INDEX + +echo -e "$advanced_table" >> $INDEX + +tmp_text=$(cat <<-END +Other Examples +-------------- + +Flower Examples are a collection of example projects written with Flower that explore different domains and features. You can check which examples already exist and/or contribute your own example. + +END +) +echo -e "$tmp_text" >> $INDEX + +echo -e "$other_table" >> $INDEX + echo "" >> $INDEX echo "$table_text" >> $INDEX echo "" >> $INDEX diff --git a/examples/embedded-devices/README.md b/examples/embedded-devices/README.md index 5854d1bfe089..bae0d6a7078e 100644 --- a/examples/embedded-devices/README.md +++ b/examples/embedded-devices/README.md @@ -72,7 +72,7 @@ If you are working on this tutorial on your laptop or desktop, it can host the F - Install `pip`. In the terminal type: `sudo apt install python3-pip -y` - Now clone this directory. You just need to execute the `git clone` command shown at the top of this README.md on your device. - - Install Flower and your ML framework: We have prepared some convenient installation scripts that will install everything you need. You are free to install other versions of these ML frameworks to suit your needs. + - Install Flower and your ML framework of choice: We have prepared some convenient installation scripts that will install everything you need. You are free to install other versions of these ML frameworks to suit your needs. - If you want your clients to use PyTorch: `pip3 install -r requirements_pytorch.txt` - If you want your clients to use TensorFlow: `pip3 install -r requirements_tf.txt` From 5b0cda8805ab877d12dfef9f2ae2093bd7330de3 Mon Sep 17 00:00:00 2001 From: Charles Beauville Date: Fri, 28 Jun 2024 14:16:48 +0200 Subject: [PATCH 20/66] Capitalize Cp --- examples/quickstart-cpp/README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/examples/quickstart-cpp/README.md b/examples/quickstart-cpp/README.md index 4615ff3fb434..ed7e511e7a85 100644 --- a/examples/quickstart-cpp/README.md +++ b/examples/quickstart-cpp/README.md @@ -2,7 +2,7 @@ title: Simple Flower Example using C++ labels: [quickstart, linear regression, tabular] dataset: [synthetic] -framework: [c++] +framework: [C++] --- # Flower Clients in C++ (under development) From acc5bf2e1b2f5440c4b67a5edfa9beb187a9024b Mon Sep 17 00:00:00 2001 From: Charles Beauville Date: Fri, 28 Jun 2024 15:08:28 +0200 Subject: [PATCH 21/66] Add Python script --- dev/build-example-docs.py | 193 ++++++++++++++++++++++++++++++++++++++ 1 file changed, 193 insertions(+) create mode 100644 dev/build-example-docs.py diff --git a/dev/build-example-docs.py b/dev/build-example-docs.py new file mode 100644 index 000000000000..9dc7c7131214 --- /dev/null +++ b/dev/build-example-docs.py @@ -0,0 +1,193 @@ +import os +import shutil +import re +from pathlib import Path + +ROOT = os.path.abspath(os.path.join(os.path.dirname(__file__), "..")) +INDEX = os.path.join(ROOT, "examples", "doc", "source", "index.rst") + +initial_text = """ +Flower Examples Documentation +----------------------------- + +Welcome to Flower Examples' documentation. `Flower `_ is +a friendly federated learning framework. + +Join the Flower Community +------------------------- + +The Flower Community is growing quickly - we're a friendly group of researchers, +engineers, students, professionals, academics, and other enthusiasts. + +.. button-link:: https://flower.ai/join-slack + :color: primary + :shadow: + + Join us on Slack + +Quickstart Examples +------------------- + +Flower Quickstart Examples are a collection of demo project that show how you +can use Flower in combination with other existing frameworks or technologies. + +""" + +table_headers = "\n.. list-table::\n :widths: 50 15 15 15\n :header-rows: 1\n\n * - Title\n - Framework\n - Dataset\n - Tags\n\n" + +categories = { + "quickstart": {"table": table_headers, "list": ""}, + "comprehensive": {"table": table_headers, "list": ""}, + "advanced": {"table": table_headers, "list": ""}, + "other": {"table": table_headers, "list": ""}, +} + + +def _read_metadata(example): + with open(os.path.join(example, "README.md")) as f: + content = f.read() + metadata = re.search(r"^---(.*?)^---", content, re.DOTALL | re.MULTILINE).group(1) + title = re.search(r"^title:\s*(.+)$", metadata, re.MULTILINE).group(1).strip() + labels = ( + re.search(r"^labels:\s*\[(.+?)\]$", metadata, re.MULTILINE).group(1).strip() + ) + dataset = ( + re.search(r"^dataset:\s*\[(.+?)\]$", metadata, re.MULTILINE).group(1).strip() + ) + framework = ( + re.search(r"^framework:\s*\[(.+?)\]$", metadata, re.MULTILINE).group(1).strip() + ) + return title, labels, dataset, framework + + +def _add_table_entry(example, label, table_var): + title, labels, dataset, framework = _read_metadata(example) + example_name = Path(example).stem + table_entry = f" * - `{title} <{example_name}.html>`_ \n - {framework} \n - {dataset} \n - {labels}\n\n" + if label in labels: + categories[table_var]["table"] += table_entry + categories[table_var]["list"] += f" {example_name}\n" + return True + return False + + +def _copy_markdown_files(example): + for file in os.listdir(example): + if file.endswith(".md"): + src = os.path.join(example, file) + dest = os.path.join( + ROOT, "examples", "doc", "source", os.path.basename(example) + ".md" + ) + shutil.copyfile(src, dest) + + +def _add_gh_button(example): + gh_text = f'[View on GitHub](https://github.com/adap/flower/blob/main/examples/{example})' + readme_file = os.path.join(ROOT, "examples", "doc", "source", example + ".md") + with open(readme_file, "r+") as f: + content = f.read() + if gh_text not in content: + content = re.sub( + r"(^# .+$)", rf"\1\n\n{gh_text}", content, count=1, flags=re.MULTILINE + ) + f.seek(0) + f.write(content) + f.truncate() + + +def _copy_images(example): + static_dir = os.path.join(example, "_static") + dest_dir = os.path.join(ROOT, "examples", "doc", "source", "_static") + if os.path.isdir(static_dir): + for file in os.listdir(static_dir): + if file.endswith((".jpg", ".png", ".jpeg")): + shutil.copyfile( + os.path.join(static_dir, file), os.path.join(dest_dir, file) + ) + + +def _add_all_entries(index_file): + examples_dir = os.path.join(ROOT, "examples") + for example in sorted(os.listdir(examples_dir)): + example_path = os.path.join(examples_dir, example) + if os.path.isdir(example_path) and example != "doc": + _copy_markdown_files(example_path) + _add_gh_button(example) + _copy_images(example) + # index_file.write(f" {example}\n") + + +def _main(): + if os.path.exists(INDEX): + os.remove(INDEX) + + with open(INDEX, "w") as index_file: + index_file.write(initial_text) + + examples_dir = os.path.join(ROOT, "examples") + for example in sorted(os.listdir(examples_dir)): + example_path = os.path.join(examples_dir, example) + if os.path.isdir(example_path) and example != "doc": + _copy_markdown_files(example_path) + _add_gh_button(example) + _copy_images(example_path) + if not _add_table_entry(example_path, "quickstart", "quickstart"): + if not _add_table_entry(example_path, "comprehensive", "comprehensive"): + if not _add_table_entry(example_path, "advanced", "advanced"): + _add_table_entry(example_path, "", "other") + + with open(INDEX, "a") as index_file: + index_file.write(categories["quickstart"]["table"]) + + index_file.write("\nComprehensive Examples\n----------------------\n") + index_file.write( + "Comprehensive examples allow us to explore certain topics more " + "in-depth and are often associated with a simpler, less detailed example.\n" + ) + index_file.write(categories["comprehensive"]["table"]) + + index_file.write("\nAdvanced Examples\n-----------------\n") + index_file.write( + "Advanced Examples are mostly for users that are both familiar with " + "Federated Learning but also somewhat familiar with Flower's main " + "features.\n" + ) + index_file.write(categories["advanced"]["table"]) + + index_file.write("\nOther Examples\n--------------\n") + index_file.write( + "Flower Examples are a collection of example projects written with " + "Flower that explore different domains and features. You can check " + "which examples already exist and/or contribute your own example.\n" + ) + index_file.write(categories["other"]["table"]) + + _add_all_entries(index_file) + + index_file.write( + "\n.. toctree::\n :maxdepth: 1\n :caption: Quickstart\n :hidden:\n\n" + ) + index_file.write(categories["quickstart"]["list"]) + + index_file.write( + "\n.. toctree::\n :maxdepth: 1\n :caption: Comprehensive\n :hidden:\n\n" + ) + index_file.write(categories["comprehensive"]["list"]) + + index_file.write( + "\n.. toctree::\n :maxdepth: 1\n :caption: Advanced\n :hidden:\n\n" + ) + index_file.write(categories["advanced"]["list"]) + + index_file.write( + "\n.. toctree::\n :maxdepth: 1\n :caption: Others\n :hidden:\n\n" + ) + index_file.write(categories["other"]["list"]) + + index_file.write("\n") + + print(f"Done! Example index written to {INDEX}") + + +if __name__ == "__main__": + _main() From 301d9d4626a49f4ce0cca12094d1ff8ae2d8397f Mon Sep 17 00:00:00 2001 From: Charles Beauville Date: Fri, 28 Jun 2024 15:23:23 +0200 Subject: [PATCH 22/66] Update metadata --- dev/build-example-docs.py | 14 -------------- examples/advanced-pytorch/README.md | 2 +- examples/advanced-tensorflow/README.md | 2 +- examples/quickstart-fastai/README.md | 2 +- examples/quickstart-huggingface/README.md | 4 ++-- examples/quickstart-jax/README.md | 4 ++-- examples/quickstart-mlx/README.md | 2 +- examples/quickstart-monai/README.md | 2 +- examples/xgboost-comprehensive/README.md | 2 +- examples/xgboost-quickstart/README.md | 2 +- 10 files changed, 11 insertions(+), 25 deletions(-) diff --git a/dev/build-example-docs.py b/dev/build-example-docs.py index 9dc7c7131214..9dcd611a9728 100644 --- a/dev/build-example-docs.py +++ b/dev/build-example-docs.py @@ -37,7 +37,6 @@ categories = { "quickstart": {"table": table_headers, "list": ""}, - "comprehensive": {"table": table_headers, "list": ""}, "advanced": {"table": table_headers, "list": ""}, "other": {"table": table_headers, "list": ""}, } @@ -114,7 +113,6 @@ def _add_all_entries(index_file): _copy_markdown_files(example_path) _add_gh_button(example) _copy_images(example) - # index_file.write(f" {example}\n") def _main(): @@ -139,13 +137,6 @@ def _main(): with open(INDEX, "a") as index_file: index_file.write(categories["quickstart"]["table"]) - index_file.write("\nComprehensive Examples\n----------------------\n") - index_file.write( - "Comprehensive examples allow us to explore certain topics more " - "in-depth and are often associated with a simpler, less detailed example.\n" - ) - index_file.write(categories["comprehensive"]["table"]) - index_file.write("\nAdvanced Examples\n-----------------\n") index_file.write( "Advanced Examples are mostly for users that are both familiar with " @@ -169,11 +160,6 @@ def _main(): ) index_file.write(categories["quickstart"]["list"]) - index_file.write( - "\n.. toctree::\n :maxdepth: 1\n :caption: Comprehensive\n :hidden:\n\n" - ) - index_file.write(categories["comprehensive"]["list"]) - index_file.write( "\n.. toctree::\n :maxdepth: 1\n :caption: Advanced\n :hidden:\n\n" ) diff --git a/examples/advanced-pytorch/README.md b/examples/advanced-pytorch/README.md index 183c1532bc70..e7f2f0c00152 100644 --- a/examples/advanced-pytorch/README.md +++ b/examples/advanced-pytorch/README.md @@ -1,6 +1,6 @@ --- title: Advanced Flower Example using PyTorch -labels: [basic, vision, fds] +labels: [advanced, vision, fds] dataset: [CIFAR-10] framework: [torch, torchvision] --- diff --git a/examples/advanced-tensorflow/README.md b/examples/advanced-tensorflow/README.md index 8bad31755aa4..852b7a979743 100644 --- a/examples/advanced-tensorflow/README.md +++ b/examples/advanced-tensorflow/README.md @@ -1,6 +1,6 @@ --- title: Advanced Flower Example using TensorFlow/Keras -labels: [basic, vision, fds] +labels: [advanced, vision, fds] dataset: [CIFAR-10] framework: [TensorFlow, Keras] --- diff --git a/examples/quickstart-fastai/README.md b/examples/quickstart-fastai/README.md index aefbe6742f8c..688072b9e75c 100644 --- a/examples/quickstart-fastai/README.md +++ b/examples/quickstart-fastai/README.md @@ -2,7 +2,7 @@ title: Simple Flower Example using fastai labels: [quickstart, vision] dataset: [MNIST] -framework: [fastai] +framework: [`fastai `_] --- # Flower Example using fastai diff --git a/examples/quickstart-huggingface/README.md b/examples/quickstart-huggingface/README.md index 0385cbec01bb..11a10fa69035 100644 --- a/examples/quickstart-huggingface/README.md +++ b/examples/quickstart-huggingface/README.md @@ -1,8 +1,8 @@ --- title: Flower Transformers Example using HuggingFace labels: [quickstart, llm, nlp, sentiment] -dataset: [IMDB] -framework: [transformers] +dataset: [`IMDB `_] +framework: [`transformers `_] --- # Federated HuggingFace Transformers using Flower and PyTorch diff --git a/examples/quickstart-jax/README.md b/examples/quickstart-jax/README.md index 1e9dfe18de97..b68b1a1bc738 100644 --- a/examples/quickstart-jax/README.md +++ b/examples/quickstart-jax/README.md @@ -1,8 +1,8 @@ --- title: Simple Flower Example using Jax labels: [quickstart, linear regression] -dataset: [synthetic] -framework: [JAX] +dataset: [Synthetic] +framework: [`JAX `_] --- # JAX: From Centralized To Federated diff --git a/examples/quickstart-mlx/README.md b/examples/quickstart-mlx/README.md index d0db96e9e049..0ccedf594194 100644 --- a/examples/quickstart-mlx/README.md +++ b/examples/quickstart-mlx/README.md @@ -2,7 +2,7 @@ title: Simple Flower Example using MLX labels: [quickstart, vision] dataset: [MNIST] -framework: [MLX] +framework: [`MLX `_] --- # Flower Example using MONAI diff --git a/examples/xgboost-comprehensive/README.md b/examples/xgboost-comprehensive/README.md index 834d5f8bbbf6..697b2fe19b6f 100644 --- a/examples/xgboost-comprehensive/README.md +++ b/examples/xgboost-comprehensive/README.md @@ -1,6 +1,6 @@ --- title: Flower Example using XGBoost -labels: [comprehensive, classification, tabular] +labels: [advanced, classification, tabular] dataset: [HIGGS] framework: [xgboost] --- diff --git a/examples/xgboost-quickstart/README.md b/examples/xgboost-quickstart/README.md index 1ad9b0b4d3f0..78aa4f9ee75f 100644 --- a/examples/xgboost-quickstart/README.md +++ b/examples/xgboost-quickstart/README.md @@ -1,6 +1,6 @@ --- title: Flower Example using PyTorch -labels: [comprehensive, classification, tabular] +labels: [quickstart, classification, tabular] dataset: [HIGGS] framework: [xgboost] --- From 0db320e99dedea8d06935131738dbde3040472db Mon Sep 17 00:00:00 2001 From: Charles Beauville Date: Fri, 28 Jun 2024 15:24:14 +0200 Subject: [PATCH 23/66] Update metadata --- examples/quickstart-mlx/README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/examples/quickstart-mlx/README.md b/examples/quickstart-mlx/README.md index 0ccedf594194..2df3af52db5a 100644 --- a/examples/quickstart-mlx/README.md +++ b/examples/quickstart-mlx/README.md @@ -2,7 +2,7 @@ title: Simple Flower Example using MLX labels: [quickstart, vision] dataset: [MNIST] -framework: [`MLX `_] --- # Flower Example using MLX From c4e2263b700f310ea1dd2d63f2fdff18ad6d3a42 Mon Sep 17 00:00:00 2001 From: Charles Beauville Date: Fri, 28 Jun 2024 15:26:28 +0200 Subject: [PATCH 24/66] Try markdown format --- examples/quickstart-cpp/README.md | 2 +- examples/quickstart-jax/README.md | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/examples/quickstart-cpp/README.md b/examples/quickstart-cpp/README.md index ed7e511e7a85..2baf35616f24 100644 --- a/examples/quickstart-cpp/README.md +++ b/examples/quickstart-cpp/README.md @@ -1,7 +1,7 @@ --- title: Simple Flower Example using C++ labels: [quickstart, linear regression, tabular] -dataset: [synthetic] +dataset: [Synthetic] framework: [C++] --- diff --git a/examples/quickstart-jax/README.md b/examples/quickstart-jax/README.md index b68b1a1bc738..3fc1663b7f35 100644 --- a/examples/quickstart-jax/README.md +++ b/examples/quickstart-jax/README.md @@ -2,7 +2,7 @@ title: Simple Flower Example using Jax labels: [quickstart, linear regression] dataset: [Synthetic] -framework: [`JAX `_] +framework: [[JAX](https://jax.readthedocs.io/en/latest/)] --- # JAX: From Centralized To Federated From f4db217499c58b1ba2f6b87e98ff0dad90125a95 Mon Sep 17 00:00:00 2001 From: Charles Beauville Date: Fri, 28 Jun 2024 15:28:03 +0200 Subject: [PATCH 25/66] Test with quotes --- examples/quickstart-jax/README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/examples/quickstart-jax/README.md b/examples/quickstart-jax/README.md index 3fc1663b7f35..8bc912a634ae 100644 --- a/examples/quickstart-jax/README.md +++ b/examples/quickstart-jax/README.md @@ -2,7 +2,7 @@ title: Simple Flower Example using Jax labels: [quickstart, linear regression] dataset: [Synthetic] -framework: [[JAX](https://jax.readthedocs.io/en/latest/)] +framework: ["`JAX `_"] --- # JAX: From Centralized To Federated From 3a073a6050fdda8e3bc8f4460bac72e9ec363c8f Mon Sep 17 00:00:00 2001 From: Charles Beauville Date: Fri, 28 Jun 2024 15:29:42 +0200 Subject: [PATCH 26/66] Remove quotes --- dev/build-example-docs.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/dev/build-example-docs.py b/dev/build-example-docs.py index 9dcd611a9728..68945c24dd8c 100644 --- a/dev/build-example-docs.py +++ b/dev/build-example-docs.py @@ -55,7 +55,7 @@ def _read_metadata(example): ) framework = ( re.search(r"^framework:\s*\[(.+?)\]$", metadata, re.MULTILINE).group(1).strip() - ) + ).replace('"', "") return title, labels, dataset, framework From 2f59185e21f83f373902f0ba90ff52072c6ced86 Mon Sep 17 00:00:00 2001 From: Charles Beauville Date: Fri, 28 Jun 2024 15:33:51 +0200 Subject: [PATCH 27/66] Update MNIST --- examples/flower-simulation-step-by-step-pytorch/README.md | 2 +- examples/ios/README.md | 2 +- examples/quickstart-fastai/README.md | 2 +- examples/quickstart-mlcube/README.md | 2 +- examples/quickstart-mlx/README.md | 2 +- examples/quickstart-pytorch-lightning/README.md | 2 +- examples/simulation-pytorch/README.md | 2 +- examples/simulation-tensorflow/README.md | 2 +- examples/sklearn-logreg-mnist/README.md | 2 +- examples/tensorflow-privacy/README.md | 2 +- 10 files changed, 10 insertions(+), 10 deletions(-) diff --git a/examples/flower-simulation-step-by-step-pytorch/README.md b/examples/flower-simulation-step-by-step-pytorch/README.md index 890a3b2ed35d..fae8fc9e1bcf 100644 --- a/examples/flower-simulation-step-by-step-pytorch/README.md +++ b/examples/flower-simulation-step-by-step-pytorch/README.md @@ -1,7 +1,7 @@ --- title: Flower Simulation Step-by-Step labels: [basic, vision, simulation] -dataset: [MNIST] +dataset: [`MNIST `_] framework: [torch] --- diff --git a/examples/ios/README.md b/examples/ios/README.md index e7d2d10808aa..5bf6eb1469e6 100644 --- a/examples/ios/README.md +++ b/examples/ios/README.md @@ -1,7 +1,7 @@ --- title: Simple Flower Example on iOS labels: [mobile, vision, fds] -dataset: [MNIST] +dataset: [`MNIST `_] framework: [swift] --- diff --git a/examples/quickstart-fastai/README.md b/examples/quickstart-fastai/README.md index 688072b9e75c..a7c877804386 100644 --- a/examples/quickstart-fastai/README.md +++ b/examples/quickstart-fastai/README.md @@ -1,7 +1,7 @@ --- title: Simple Flower Example using fastai labels: [quickstart, vision] -dataset: [MNIST] +dataset: [`MNIST `_] framework: [`fastai `_] --- diff --git a/examples/quickstart-mlcube/README.md b/examples/quickstart-mlcube/README.md index b287b00beca5..ead084c51afa 100644 --- a/examples/quickstart-mlcube/README.md +++ b/examples/quickstart-mlcube/README.md @@ -1,7 +1,7 @@ --- title: Flower Example using TensorFlow/Keras + MLCube labels: [quickstart, vision, deployment] -dataset: [MNIST] +dataset: [`MNIST `_] framework: [TensorFlow, Keras] --- diff --git a/examples/quickstart-mlx/README.md b/examples/quickstart-mlx/README.md index 2df3af52db5a..693684170935 100644 --- a/examples/quickstart-mlx/README.md +++ b/examples/quickstart-mlx/README.md @@ -1,7 +1,7 @@ --- title: Simple Flower Example using MLX labels: [quickstart, vision] -dataset: [MNIST] +dataset: [`MNIST `_] framework: [`MLX `_] --- diff --git a/examples/quickstart-pytorch-lightning/README.md b/examples/quickstart-pytorch-lightning/README.md index af80bd8a5e9d..4343b13ad5cb 100644 --- a/examples/quickstart-pytorch-lightning/README.md +++ b/examples/quickstart-pytorch-lightning/README.md @@ -1,7 +1,7 @@ --- title: Simple Flower Example using PyTorch-Lightning labels: [quickstart, vision, fds] -dataset: [MNIST] +dataset: [`MNIST `_] framework: [PyTorch-Lightning] --- diff --git a/examples/simulation-pytorch/README.md b/examples/simulation-pytorch/README.md index 6c5a1dea4d6d..a607ae8468db 100644 --- a/examples/simulation-pytorch/README.md +++ b/examples/simulation-pytorch/README.md @@ -1,7 +1,7 @@ --- title: Flower Simulation Example using PyTorch labels: [basic, vision, fds, simulation] -dataset: [MNIST] +dataset: [`MNIST `_] framework: [torch, torchvision] --- diff --git a/examples/simulation-tensorflow/README.md b/examples/simulation-tensorflow/README.md index 7a80531a08b5..bafe3a8a5b94 100644 --- a/examples/simulation-tensorflow/README.md +++ b/examples/simulation-tensorflow/README.md @@ -1,7 +1,7 @@ --- title: Flower Simulation Example using TensorFlow/Keras labels: [basic, vision, fds, simulation] -dataset: [MNIST] +dataset: [`MNIST `_] framework: [TensorFlow, Keras] --- diff --git a/examples/sklearn-logreg-mnist/README.md b/examples/sklearn-logreg-mnist/README.md index 8d8a2eda4141..46c843172d78 100644 --- a/examples/sklearn-logreg-mnist/README.md +++ b/examples/sklearn-logreg-mnist/README.md @@ -1,7 +1,7 @@ --- title: Flower LogReg Example using Scikit-Learn labels: [basic, vision, logistic regression, fds] -dataset: [MNIST] +dataset: [`MNIST `_] framework: [scikit-learn] --- diff --git a/examples/tensorflow-privacy/README.md b/examples/tensorflow-privacy/README.md index 207bb8948734..21ad4e8215ed 100644 --- a/examples/tensorflow-privacy/README.md +++ b/examples/tensorflow-privacy/README.md @@ -1,7 +1,7 @@ --- title: Sample-Level DP using TensorFlow-Privacy Engine labels: [basic, vision, fds, privacy, dp] -dataset: [MNIST] +dataset: [`MNIST `_] framework: [TensorFlow] --- From 78b7ca348cc4c7762a80338bb9bbf22af83d1640 Mon Sep 17 00:00:00 2001 From: Charles Beauville Date: Fri, 28 Jun 2024 15:35:50 +0200 Subject: [PATCH 28/66] Try quotes markdown --- examples/quickstart-jax/README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/examples/quickstart-jax/README.md b/examples/quickstart-jax/README.md index 8bc912a634ae..95274cf0c5bf 100644 --- a/examples/quickstart-jax/README.md +++ b/examples/quickstart-jax/README.md @@ -2,7 +2,7 @@ title: Simple Flower Example using Jax labels: [quickstart, linear regression] dataset: [Synthetic] -framework: ["`JAX `_"] +framework: ["[JAX](https://jax.readthedocs.io/en/latest/)"] --- # JAX: From Centralized To Federated From 72d994661ac68c4023efc19a179bda16aea831cc Mon Sep 17 00:00:00 2001 From: Charles Beauville Date: Fri, 28 Jun 2024 15:36:35 +0200 Subject: [PATCH 29/66] Try simple string --- examples/quickstart-jax/README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/examples/quickstart-jax/README.md b/examples/quickstart-jax/README.md index 95274cf0c5bf..aaa75925903e 100644 --- a/examples/quickstart-jax/README.md +++ b/examples/quickstart-jax/README.md @@ -2,7 +2,7 @@ title: Simple Flower Example using Jax labels: [quickstart, linear regression] dataset: [Synthetic] -framework: ["[JAX](https://jax.readthedocs.io/en/latest/)"] +framework: ["JAX: https://jax.readthedocs.io/en/latest/"] --- # JAX: From Centralized To Federated From 9020e9e6629545ecc661d8f413e3b602e8d91995 Mon Sep 17 00:00:00 2001 From: Charles Beauville Date: Fri, 28 Jun 2024 15:41:31 +0200 Subject: [PATCH 30/66] use pipe --- dev/build-example-docs.py | 17 ++++++++++++++--- examples/quickstart-jax/README.md | 2 +- 2 files changed, 15 insertions(+), 4 deletions(-) diff --git a/dev/build-example-docs.py b/dev/build-example-docs.py index 68945c24dd8c..13ebab300cc3 100644 --- a/dev/build-example-docs.py +++ b/dev/build-example-docs.py @@ -53,9 +53,20 @@ def _read_metadata(example): dataset = ( re.search(r"^dataset:\s*\[(.+?)\]$", metadata, re.MULTILINE).group(1).strip() ) - framework = ( - re.search(r"^framework:\s*\[(.+?)\]$", metadata, re.MULTILINE).group(1).strip() - ).replace('"', "") + framework_str = ( + ( + re.search(r"^framework:\s*\[(.+?)\]$", metadata, re.MULTILINE) + .group(1) + .strip() + ) + .replace('"', "") + .split(":") + ) + if len(framework_str) > 1: + framework_name, framework_url = framework_str + framework = f"`{framework_name} <{framework_url.strip()}>`_" + else: + framework = framework_str return title, labels, dataset, framework diff --git a/examples/quickstart-jax/README.md b/examples/quickstart-jax/README.md index aaa75925903e..9c14db21199e 100644 --- a/examples/quickstart-jax/README.md +++ b/examples/quickstart-jax/README.md @@ -2,7 +2,7 @@ title: Simple Flower Example using Jax labels: [quickstart, linear regression] dataset: [Synthetic] -framework: ["JAX: https://jax.readthedocs.io/en/latest/"] +framework: ["JAX | https://jax.readthedocs.io/en/latest/"] --- # JAX: From Centralized To Federated From a5266b8063300bef3b0e84ec761b3c3957f2d27e Mon Sep 17 00:00:00 2001 From: Charles Beauville Date: Fri, 28 Jun 2024 15:44:26 +0200 Subject: [PATCH 31/66] Fix MNIST metadata format --- dev/build-example-docs.py | 4 ++-- examples/flower-simulation-step-by-step-pytorch/README.md | 2 +- examples/ios/README.md | 2 +- examples/quickstart-fastai/README.md | 2 +- examples/quickstart-mlcube/README.md | 2 +- examples/quickstart-mlx/README.md | 2 +- examples/quickstart-pytorch-lightning/README.md | 2 +- examples/simulation-pytorch/README.md | 2 +- examples/simulation-tensorflow/README.md | 2 +- examples/sklearn-logreg-mnist/README.md | 2 +- examples/tensorflow-privacy/README.md | 2 +- 11 files changed, 12 insertions(+), 12 deletions(-) diff --git a/dev/build-example-docs.py b/dev/build-example-docs.py index 13ebab300cc3..b21b46b60489 100644 --- a/dev/build-example-docs.py +++ b/dev/build-example-docs.py @@ -60,11 +60,11 @@ def _read_metadata(example): .strip() ) .replace('"', "") - .split(":") + .split("|") ) if len(framework_str) > 1: framework_name, framework_url = framework_str - framework = f"`{framework_name} <{framework_url.strip()}>`_" + framework = f"`{framework_name.strip()} <{framework_url.strip()}>`_" else: framework = framework_str return title, labels, dataset, framework diff --git a/examples/flower-simulation-step-by-step-pytorch/README.md b/examples/flower-simulation-step-by-step-pytorch/README.md index fae8fc9e1bcf..8ded7e07a324 100644 --- a/examples/flower-simulation-step-by-step-pytorch/README.md +++ b/examples/flower-simulation-step-by-step-pytorch/README.md @@ -1,7 +1,7 @@ --- title: Flower Simulation Step-by-Step labels: [basic, vision, simulation] -dataset: [`MNIST `_] +dataset: [MNIST | https://en.wikipedia.org/wiki/MNIST_database] framework: [torch] --- diff --git a/examples/ios/README.md b/examples/ios/README.md index 5bf6eb1469e6..e0c3ed303c8c 100644 --- a/examples/ios/README.md +++ b/examples/ios/README.md @@ -1,7 +1,7 @@ --- title: Simple Flower Example on iOS labels: [mobile, vision, fds] -dataset: [`MNIST `_] +dataset: [MNIST | https://en.wikipedia.org/wiki/MNIST_database] framework: [swift] --- diff --git a/examples/quickstart-fastai/README.md b/examples/quickstart-fastai/README.md index a7c877804386..40c49fbfb885 100644 --- a/examples/quickstart-fastai/README.md +++ b/examples/quickstart-fastai/README.md @@ -1,7 +1,7 @@ --- title: Simple Flower Example using fastai labels: [quickstart, vision] -dataset: [`MNIST `_] +dataset: [MNIST | https://en.wikipedia.org/wiki/MNIST_database] framework: [`fastai `_] --- diff --git a/examples/quickstart-mlcube/README.md b/examples/quickstart-mlcube/README.md index ead084c51afa..f219f015c272 100644 --- a/examples/quickstart-mlcube/README.md +++ b/examples/quickstart-mlcube/README.md @@ -1,7 +1,7 @@ --- title: Flower Example using TensorFlow/Keras + MLCube labels: [quickstart, vision, deployment] -dataset: [`MNIST `_] +dataset: [MNIST | https://en.wikipedia.org/wiki/MNIST_database] framework: [TensorFlow, Keras] --- diff --git a/examples/quickstart-mlx/README.md b/examples/quickstart-mlx/README.md index 693684170935..e740519d057a 100644 --- a/examples/quickstart-mlx/README.md +++ b/examples/quickstart-mlx/README.md @@ -1,7 +1,7 @@ --- title: Simple Flower Example using MLX labels: [quickstart, vision] -dataset: [`MNIST `_] +dataset: [MNIST | https://en.wikipedia.org/wiki/MNIST_database] framework: [`MLX `_] --- diff --git a/examples/quickstart-pytorch-lightning/README.md b/examples/quickstart-pytorch-lightning/README.md index 4343b13ad5cb..65fa5b9a0d62 100644 --- a/examples/quickstart-pytorch-lightning/README.md +++ b/examples/quickstart-pytorch-lightning/README.md @@ -1,7 +1,7 @@ --- title: Simple Flower Example using PyTorch-Lightning labels: [quickstart, vision, fds] -dataset: [`MNIST `_] +dataset: [MNIST | https://en.wikipedia.org/wiki/MNIST_database] framework: [PyTorch-Lightning] --- diff --git a/examples/simulation-pytorch/README.md b/examples/simulation-pytorch/README.md index a607ae8468db..077a931e4177 100644 --- a/examples/simulation-pytorch/README.md +++ b/examples/simulation-pytorch/README.md @@ -1,7 +1,7 @@ --- title: Flower Simulation Example using PyTorch labels: [basic, vision, fds, simulation] -dataset: [`MNIST `_] +dataset: [MNIST | https://en.wikipedia.org/wiki/MNIST_database] framework: [torch, torchvision] --- diff --git a/examples/simulation-tensorflow/README.md b/examples/simulation-tensorflow/README.md index bafe3a8a5b94..4db39666ce31 100644 --- a/examples/simulation-tensorflow/README.md +++ b/examples/simulation-tensorflow/README.md @@ -1,7 +1,7 @@ --- title: Flower Simulation Example using TensorFlow/Keras labels: [basic, vision, fds, simulation] -dataset: [`MNIST `_] +dataset: [MNIST | https://en.wikipedia.org/wiki/MNIST_database] framework: [TensorFlow, Keras] --- diff --git a/examples/sklearn-logreg-mnist/README.md b/examples/sklearn-logreg-mnist/README.md index 46c843172d78..3dcfd7bffda1 100644 --- a/examples/sklearn-logreg-mnist/README.md +++ b/examples/sklearn-logreg-mnist/README.md @@ -1,7 +1,7 @@ --- title: Flower LogReg Example using Scikit-Learn labels: [basic, vision, logistic regression, fds] -dataset: [`MNIST `_] +dataset: [MNIST | https://en.wikipedia.org/wiki/MNIST_database] framework: [scikit-learn] --- diff --git a/examples/tensorflow-privacy/README.md b/examples/tensorflow-privacy/README.md index 21ad4e8215ed..f5936df47450 100644 --- a/examples/tensorflow-privacy/README.md +++ b/examples/tensorflow-privacy/README.md @@ -1,7 +1,7 @@ --- title: Sample-Level DP using TensorFlow-Privacy Engine labels: [basic, vision, fds, privacy, dp] -dataset: [`MNIST `_] +dataset: [MNIST | https://en.wikipedia.org/wiki/MNIST_database] framework: [TensorFlow] --- From 919798ff5bba47a492bc9442e21a2d601bc5fff2 Mon Sep 17 00:00:00 2001 From: Charles Beauville Date: Fri, 28 Jun 2024 15:46:20 +0200 Subject: [PATCH 32/66] Update rest of metadata --- examples/quickstart-fastai/README.md | 2 +- examples/quickstart-huggingface/README.md | 4 ++-- examples/quickstart-mlx/README.md | 2 +- examples/quickstart-monai/README.md | 2 +- 4 files changed, 5 insertions(+), 5 deletions(-) diff --git a/examples/quickstart-fastai/README.md b/examples/quickstart-fastai/README.md index 40c49fbfb885..31f4765fd131 100644 --- a/examples/quickstart-fastai/README.md +++ b/examples/quickstart-fastai/README.md @@ -2,7 +2,7 @@ title: Simple Flower Example using fastai labels: [quickstart, vision] dataset: [MNIST | https://en.wikipedia.org/wiki/MNIST_database] -framework: [`fastai `_] +framework: [fastai | https://fast.ai] --- # Flower Example using fastai diff --git a/examples/quickstart-huggingface/README.md b/examples/quickstart-huggingface/README.md index 11a10fa69035..7235b12d7c8e 100644 --- a/examples/quickstart-huggingface/README.md +++ b/examples/quickstart-huggingface/README.md @@ -1,8 +1,8 @@ --- title: Flower Transformers Example using HuggingFace labels: [quickstart, llm, nlp, sentiment] -dataset: [`IMDB `_] -framework: [`transformers `_] +dataset: [IMDB | https://huggingface.co/datasets/stanfordnlp/imdb] +framework: [transformers | https://huggingface.co/docs/transformers/index] --- # Federated HuggingFace Transformers using Flower and PyTorch diff --git a/examples/quickstart-mlx/README.md b/examples/quickstart-mlx/README.md index e740519d057a..739a97647f28 100644 --- a/examples/quickstart-mlx/README.md +++ b/examples/quickstart-mlx/README.md @@ -2,7 +2,7 @@ title: Simple Flower Example using MLX labels: [quickstart, vision] dataset: [MNIST | https://en.wikipedia.org/wiki/MNIST_database] -framework: [`MLX `_] +framework: [MLX | https://ml-explore.github.io/mlx/build/html/index.html] --- # Flower Example using MLX diff --git a/examples/quickstart-monai/README.md b/examples/quickstart-monai/README.md index db5f5567997d..3aeb373d3342 100644 --- a/examples/quickstart-monai/README.md +++ b/examples/quickstart-monai/README.md @@ -2,7 +2,7 @@ title: Flower Example using MONAI labels: [quickstart, medical, vision] dataset: [MedNIST] -framework: [`MONAI `_] +framework: [MONAI | https://monai.io/] --- # Flower Example using MONAI From 0eecd2ae4438a4a7f1e712ae6f6906e24ea4b850 Mon Sep 17 00:00:00 2001 From: Charles Beauville Date: Fri, 28 Jun 2024 15:51:59 +0200 Subject: [PATCH 33/66] Fix script --- dev/build-example-docs.py | 25 +++++++++++-------------- 1 file changed, 11 insertions(+), 14 deletions(-) diff --git a/dev/build-example-docs.py b/dev/build-example-docs.py index b21b46b60489..2064e75af0c7 100644 --- a/dev/build-example-docs.py +++ b/dev/build-example-docs.py @@ -42,6 +42,14 @@ } +def _convert_to_link(search_result): + if "|" in search_result: + name, url = search_result.replace('"', "").split("|") + return f"`{name.strip()} <{url.strip()}>`_" + + return search_result + + def _read_metadata(example): with open(os.path.join(example, "README.md")) as f: content = f.read() @@ -50,23 +58,12 @@ def _read_metadata(example): labels = ( re.search(r"^labels:\s*\[(.+?)\]$", metadata, re.MULTILINE).group(1).strip() ) - dataset = ( + dataset = _convert_to_link( re.search(r"^dataset:\s*\[(.+?)\]$", metadata, re.MULTILINE).group(1).strip() ) - framework_str = ( - ( - re.search(r"^framework:\s*\[(.+?)\]$", metadata, re.MULTILINE) - .group(1) - .strip() - ) - .replace('"', "") - .split("|") + framework = _convert_to_link( + re.search(r"^framework:\s*\[(.+?)\]$", metadata, re.MULTILINE).group(1).strip() ) - if len(framework_str) > 1: - framework_name, framework_url = framework_str - framework = f"`{framework_name.strip()} <{framework_url.strip()}>`_" - else: - framework = framework_str return title, labels, dataset, framework From ccf76a0e2c3ee52ecaaf33e2167b6869693c55d0 Mon Sep 17 00:00:00 2001 From: Charles Beauville Date: Fri, 28 Jun 2024 15:53:55 +0200 Subject: [PATCH 34/66] Update Cifar metadata --- examples/advanced-pytorch/README.md | 2 +- examples/advanced-tensorflow/README.md | 2 +- examples/android-kotlin/README.md | 2 +- examples/android/README.md | 2 +- examples/app-pytorch/README.md | 2 +- examples/app-secure-aggregation/README.md | 2 +- examples/custom-metrics/README.md | 2 +- examples/custom-mods/README.md | 2 +- examples/embedded-devices/README.md | 4 ++-- examples/fl-dp-sa/README.md | 2 +- examples/flower-authentication/README.md | 2 +- examples/flower-in-30-minutes/README.md | 2 +- examples/flower-via-docker-compose/README.md | 2 +- examples/opacus/README.md | 2 +- examples/pytorch-federated-variational-autoencoder/README.md | 2 +- examples/pytorch-from-centralized-to-federated/README.md | 2 +- examples/quickstart-pytorch/README.md | 2 +- examples/quickstart-tensorflow/README.md | 2 +- 18 files changed, 19 insertions(+), 19 deletions(-) diff --git a/examples/advanced-pytorch/README.md b/examples/advanced-pytorch/README.md index e7f2f0c00152..64e74bb68317 100644 --- a/examples/advanced-pytorch/README.md +++ b/examples/advanced-pytorch/README.md @@ -1,7 +1,7 @@ --- title: Advanced Flower Example using PyTorch labels: [advanced, vision, fds] -dataset: [CIFAR-10] +dataset: ["CIFAR-10 | https://huggingface.co/datasets/uoft-cs/cifar10"] framework: [torch, torchvision] --- diff --git a/examples/advanced-tensorflow/README.md b/examples/advanced-tensorflow/README.md index 852b7a979743..9e64307903b4 100644 --- a/examples/advanced-tensorflow/README.md +++ b/examples/advanced-tensorflow/README.md @@ -1,7 +1,7 @@ --- title: Advanced Flower Example using TensorFlow/Keras labels: [advanced, vision, fds] -dataset: [CIFAR-10] +dataset: ["CIFAR-10 | https://huggingface.co/datasets/uoft-cs/cifar10"] framework: [TensorFlow, Keras] --- diff --git a/examples/android-kotlin/README.md b/examples/android-kotlin/README.md index efa84770ae2b..e8c8f01ab2c8 100644 --- a/examples/android-kotlin/README.md +++ b/examples/android-kotlin/README.md @@ -1,7 +1,7 @@ --- title: Flower Android Example using Kotlin and TF Lite labels: [basic, vision, fds] -dataset: [CIFAR-10] +dataset: ["CIFAR-10 | https://huggingface.co/datasets/uoft-cs/cifar10"] framework: [Android, Kotlin, TensorFlowLite] --- diff --git a/examples/android/README.md b/examples/android/README.md index e9408568fc3b..894914fcf495 100644 --- a/examples/android/README.md +++ b/examples/android/README.md @@ -1,7 +1,7 @@ --- title: Flower Android Example using Java and TF Lite labels: [basic, vision, fds] -dataset: [CIFAR-10] +dataset: ["CIFAR-10 | https://huggingface.co/datasets/uoft-cs/cifar10"] framework: [Android, Java, TensorFlowLite] --- diff --git a/examples/app-pytorch/README.md b/examples/app-pytorch/README.md index 7ded976b1582..cb833e967f30 100644 --- a/examples/app-pytorch/README.md +++ b/examples/app-pytorch/README.md @@ -1,7 +1,7 @@ --- title: Example Flower App using PyTorch labels: [basic, vision, fds] -dataset: [CIFAR-10] +dataset: ["CIFAR-10 | https://huggingface.co/datasets/uoft-cs/cifar10"] framework: [torch, torchvision] --- diff --git a/examples/app-secure-aggregation/README.md b/examples/app-secure-aggregation/README.md index 29526beb6ef9..91d8139b33f3 100644 --- a/examples/app-secure-aggregation/README.md +++ b/examples/app-secure-aggregation/README.md @@ -1,7 +1,7 @@ --- title: Example Flower App with Secure Aggregation labels: [basic, vision, fds] -dataset: [CIFAR-10] +dataset: ["CIFAR-10 | https://huggingface.co/datasets/uoft-cs/cifar10"] framework: [numpy] --- diff --git a/examples/custom-metrics/README.md b/examples/custom-metrics/README.md index 0d3827482211..b3b492c472f3 100644 --- a/examples/custom-metrics/README.md +++ b/examples/custom-metrics/README.md @@ -1,7 +1,7 @@ --- title: Example Flower App with Custom Metrics labels: [basic, vision, fds] -dataset: [CIFAR-10] +dataset: ["CIFAR-10 | https://huggingface.co/datasets/uoft-cs/cifar10"] framework: [tensorflow] --- diff --git a/examples/custom-mods/README.md b/examples/custom-mods/README.md index ed62faf7e57b..b359652c9c73 100644 --- a/examples/custom-mods/README.md +++ b/examples/custom-mods/README.md @@ -1,7 +1,7 @@ --- title: Example Flower App with Custom Mods labels: [mods, monitoring, app] -dataset: [CIFAR-10] +dataset: ["CIFAR-10 | https://huggingface.co/datasets/uoft-cs/cifar10"] framework: [torch, wandb, tensorboard, torchvision] --- diff --git a/examples/embedded-devices/README.md b/examples/embedded-devices/README.md index bae0d6a7078e..65f68ace2481 100644 --- a/examples/embedded-devices/README.md +++ b/examples/embedded-devices/README.md @@ -1,7 +1,7 @@ --- title: Flower Embedded Devices Example labels: [basic, vision, fds] -dataset: [CIFAR-10] +dataset: ["CIFAR-10 | https://huggingface.co/datasets/uoft-cs/cifar10"] framework: [PyTorch, TensorFlow] --- @@ -187,7 +187,7 @@ If you are working on this tutorial on your laptop or desktop, it can host the F ## Running Embedded FL with Flower -For this demo, we'll be using [CIFAR-10](https://www.cs.toronto.edu/~kriz/cifar.html), a popular dataset for image classification comprised of 10 classes (e.g. car, bird, airplane) and a total of 60K `32x32` RGB images. The training set contains 50K images. The server will automatically download the dataset should it not be found in `./data`. The clients do the same. The dataset is by default split into 50 partitions (each to be assigned to a different client). This can be controlled with the `NUM_CLIENTS` global variable in the client scripts. In this example, each device will play the role of a specific user (specified via `--cid` -- we'll show this later) and therefore only do local training with that portion of the data. For CIFAR-10, clients will be training a MobileNet-v2/3 model. +For this demo, we'll be using ["CIFAR-10 | https://huggingface.co/datasets/uoft-cs/cifar10"](https://www.cs.toronto.edu/~kriz/cifar.html), a popular dataset for image classification comprised of 10 classes (e.g. car, bird, airplane) and a total of 60K `32x32` RGB images. The training set contains 50K images. The server will automatically download the dataset should it not be found in `./data`. The clients do the same. The dataset is by default split into 50 partitions (each to be assigned to a different client). This can be controlled with the `NUM_CLIENTS` global variable in the client scripts. In this example, each device will play the role of a specific user (specified via `--cid` -- we'll show this later) and therefore only do local training with that portion of the data. For CIFAR-10, clients will be training a MobileNet-v2/3 model. You can run this example using MNIST and a smaller CNN model by passing flag `--mnist`. This is useful if you are using devices with a very limited amount of memory (e.g. RaspberryPi Zero) or if you want the training taking place on the embedded devices to be much faster (specially if these are CPU-only). The partitioning of the dataset is done in the same way. diff --git a/examples/fl-dp-sa/README.md b/examples/fl-dp-sa/README.md index e8910706d3b8..cbc1664de3ee 100644 --- a/examples/fl-dp-sa/README.md +++ b/examples/fl-dp-sa/README.md @@ -1,7 +1,7 @@ --- title: Example of Flower App with DP and SA labels: [basic, vision, fds] -dataset: [CIFAR-10] +dataset: ["CIFAR-10 | https://huggingface.co/datasets/uoft-cs/cifar10"] framework: [torch, torchvision] --- diff --git a/examples/flower-authentication/README.md b/examples/flower-authentication/README.md index 5bb9e04e75da..c787cb493b74 100644 --- a/examples/flower-authentication/README.md +++ b/examples/flower-authentication/README.md @@ -1,7 +1,7 @@ --- title: Flower Example with Authentication labels: [advanced, vision, fds] -dataset: [CIFAR-10] +dataset: ["CIFAR-10 | https://huggingface.co/datasets/uoft-cs/cifar10"] framework: [torch, torchvision] --- diff --git a/examples/flower-in-30-minutes/README.md b/examples/flower-in-30-minutes/README.md index 3c4e13c4a294..e5d5eb6f7d42 100644 --- a/examples/flower-in-30-minutes/README.md +++ b/examples/flower-in-30-minutes/README.md @@ -1,7 +1,7 @@ --- title: 30-minute tutorial running Flower simulation with PyTorch labels: [colab, vision, simulation] -dataset: [CIFAR-10] +dataset: ["CIFAR-10 | https://huggingface.co/datasets/uoft-cs/cifar10"] framework: [torch] --- diff --git a/examples/flower-via-docker-compose/README.md b/examples/flower-via-docker-compose/README.md index b54b2c29ab84..a142bd699b4d 100644 --- a/examples/flower-via-docker-compose/README.md +++ b/examples/flower-via-docker-compose/README.md @@ -1,7 +1,7 @@ --- title: Leveraging Flower and Docker for Device Heterogeneity Management in FL labels: [deployment, vision, tutorial] -dataset: [CIFAR-10] +dataset: ["CIFAR-10 | https://huggingface.co/datasets/uoft-cs/cifar10"] framework: [Docker] --- diff --git a/examples/opacus/README.md b/examples/opacus/README.md index 8cc6a96ebbfd..ae5befb14fa1 100644 --- a/examples/opacus/README.md +++ b/examples/opacus/README.md @@ -1,7 +1,7 @@ --- title: Sample-Level Differential Privacy using Opacus labels: [dp, security, fds] -dataset: [CIFAR-10] +dataset: ["CIFAR-10 | https://huggingface.co/datasets/uoft-cs/cifar10"] framework: [opacus, PyTorch] --- diff --git a/examples/pytorch-federated-variational-autoencoder/README.md b/examples/pytorch-federated-variational-autoencoder/README.md index a169b8fee8a1..ee79bcbbd2cc 100644 --- a/examples/pytorch-federated-variational-autoencoder/README.md +++ b/examples/pytorch-federated-variational-autoencoder/README.md @@ -1,7 +1,7 @@ --- title: Federated Variational Autoencoder using Pytorch labels: [basic, vision, fds] -dataset: [CIFAR-10] +dataset: ["CIFAR-10 | https://huggingface.co/datasets/uoft-cs/cifar10"] framework: [torch, torchvision] --- diff --git a/examples/pytorch-from-centralized-to-federated/README.md b/examples/pytorch-from-centralized-to-federated/README.md index d377a9aa05ba..b0234366466c 100644 --- a/examples/pytorch-from-centralized-to-federated/README.md +++ b/examples/pytorch-from-centralized-to-federated/README.md @@ -1,7 +1,7 @@ --- title: PyTorch, From Centralized To Federated labels: [basic, vision, fds] -dataset: [CIFAR-10] +dataset: ["CIFAR-10 | https://huggingface.co/datasets/uoft-cs/cifar10"] framework: [torch] --- diff --git a/examples/quickstart-pytorch/README.md b/examples/quickstart-pytorch/README.md index a497e5d68837..819cc0ab68fa 100644 --- a/examples/quickstart-pytorch/README.md +++ b/examples/quickstart-pytorch/README.md @@ -1,7 +1,7 @@ --- title: Simple Flower Example using PyTorch labels: [quickstart, vision, fds] -dataset: [CIFAR-10] +dataset: ["CIFAR-10 | https://huggingface.co/datasets/uoft-cs/cifar10"] framework: [torch, torchvision] --- diff --git a/examples/quickstart-tensorflow/README.md b/examples/quickstart-tensorflow/README.md index 4983074b44c7..750d1c4a9e21 100644 --- a/examples/quickstart-tensorflow/README.md +++ b/examples/quickstart-tensorflow/README.md @@ -1,7 +1,7 @@ --- title: Simple Flower Example using TensorFlow labels: [quickstart, vision, fds] -dataset: [CIFAR-10] +dataset: ["CIFAR-10 | https://huggingface.co/datasets/uoft-cs/cifar10"] framework: [TensorFlow] --- From 0c0a19847a6075b6b50178668c7991ea46103280 Mon Sep 17 00:00:00 2001 From: Charles Beauville Date: Fri, 28 Jun 2024 15:56:04 +0200 Subject: [PATCH 35/66] Use HF for MNIST link --- examples/flower-simulation-step-by-step-pytorch/README.md | 2 +- examples/ios/README.md | 2 +- examples/quickstart-fastai/README.md | 2 +- examples/quickstart-mlcube/README.md | 2 +- examples/quickstart-mlx/README.md | 2 +- examples/quickstart-pytorch-lightning/README.md | 2 +- examples/simulation-pytorch/README.md | 2 +- examples/simulation-tensorflow/README.md | 2 +- examples/sklearn-logreg-mnist/README.md | 2 +- examples/tensorflow-privacy/README.md | 2 +- 10 files changed, 10 insertions(+), 10 deletions(-) diff --git a/examples/flower-simulation-step-by-step-pytorch/README.md b/examples/flower-simulation-step-by-step-pytorch/README.md index 8ded7e07a324..0ddc3f30967a 100644 --- a/examples/flower-simulation-step-by-step-pytorch/README.md +++ b/examples/flower-simulation-step-by-step-pytorch/README.md @@ -1,7 +1,7 @@ --- title: Flower Simulation Step-by-Step labels: [basic, vision, simulation] -dataset: [MNIST | https://en.wikipedia.org/wiki/MNIST_database] +dataset: [MNIST | https://huggingface.co/datasets/ylecun/mnist] framework: [torch] --- diff --git a/examples/ios/README.md b/examples/ios/README.md index e0c3ed303c8c..787cc7f502fb 100644 --- a/examples/ios/README.md +++ b/examples/ios/README.md @@ -1,7 +1,7 @@ --- title: Simple Flower Example on iOS labels: [mobile, vision, fds] -dataset: [MNIST | https://en.wikipedia.org/wiki/MNIST_database] +dataset: [MNIST | https://huggingface.co/datasets/ylecun/mnist] framework: [swift] --- diff --git a/examples/quickstart-fastai/README.md b/examples/quickstart-fastai/README.md index 31f4765fd131..8a8c41a49c22 100644 --- a/examples/quickstart-fastai/README.md +++ b/examples/quickstart-fastai/README.md @@ -1,7 +1,7 @@ --- title: Simple Flower Example using fastai labels: [quickstart, vision] -dataset: [MNIST | https://en.wikipedia.org/wiki/MNIST_database] +dataset: [MNIST | https://huggingface.co/datasets/ylecun/mnist] framework: [fastai | https://fast.ai] --- diff --git a/examples/quickstart-mlcube/README.md b/examples/quickstart-mlcube/README.md index f219f015c272..ca1f0b74ebc3 100644 --- a/examples/quickstart-mlcube/README.md +++ b/examples/quickstart-mlcube/README.md @@ -1,7 +1,7 @@ --- title: Flower Example using TensorFlow/Keras + MLCube labels: [quickstart, vision, deployment] -dataset: [MNIST | https://en.wikipedia.org/wiki/MNIST_database] +dataset: [MNIST | https://huggingface.co/datasets/ylecun/mnist] framework: [TensorFlow, Keras] --- diff --git a/examples/quickstart-mlx/README.md b/examples/quickstart-mlx/README.md index 739a97647f28..633b32f7bde7 100644 --- a/examples/quickstart-mlx/README.md +++ b/examples/quickstart-mlx/README.md @@ -1,7 +1,7 @@ --- title: Simple Flower Example using MLX labels: [quickstart, vision] -dataset: [MNIST | https://en.wikipedia.org/wiki/MNIST_database] +dataset: [MNIST | https://huggingface.co/datasets/ylecun/mnist] framework: [MLX | https://ml-explore.github.io/mlx/build/html/index.html] --- diff --git a/examples/quickstart-pytorch-lightning/README.md b/examples/quickstart-pytorch-lightning/README.md index 65fa5b9a0d62..7dc264bc72df 100644 --- a/examples/quickstart-pytorch-lightning/README.md +++ b/examples/quickstart-pytorch-lightning/README.md @@ -1,7 +1,7 @@ --- title: Simple Flower Example using PyTorch-Lightning labels: [quickstart, vision, fds] -dataset: [MNIST | https://en.wikipedia.org/wiki/MNIST_database] +dataset: [MNIST | https://huggingface.co/datasets/ylecun/mnist] framework: [PyTorch-Lightning] --- diff --git a/examples/simulation-pytorch/README.md b/examples/simulation-pytorch/README.md index 077a931e4177..8cc2f32332cc 100644 --- a/examples/simulation-pytorch/README.md +++ b/examples/simulation-pytorch/README.md @@ -1,7 +1,7 @@ --- title: Flower Simulation Example using PyTorch labels: [basic, vision, fds, simulation] -dataset: [MNIST | https://en.wikipedia.org/wiki/MNIST_database] +dataset: [MNIST | https://huggingface.co/datasets/ylecun/mnist] framework: [torch, torchvision] --- diff --git a/examples/simulation-tensorflow/README.md b/examples/simulation-tensorflow/README.md index 4db39666ce31..6dc7632ddb96 100644 --- a/examples/simulation-tensorflow/README.md +++ b/examples/simulation-tensorflow/README.md @@ -1,7 +1,7 @@ --- title: Flower Simulation Example using TensorFlow/Keras labels: [basic, vision, fds, simulation] -dataset: [MNIST | https://en.wikipedia.org/wiki/MNIST_database] +dataset: [MNIST | https://huggingface.co/datasets/ylecun/mnist] framework: [TensorFlow, Keras] --- diff --git a/examples/sklearn-logreg-mnist/README.md b/examples/sklearn-logreg-mnist/README.md index 3dcfd7bffda1..e0b34f760292 100644 --- a/examples/sklearn-logreg-mnist/README.md +++ b/examples/sklearn-logreg-mnist/README.md @@ -1,7 +1,7 @@ --- title: Flower LogReg Example using Scikit-Learn labels: [basic, vision, logistic regression, fds] -dataset: [MNIST | https://en.wikipedia.org/wiki/MNIST_database] +dataset: [MNIST | https://huggingface.co/datasets/ylecun/mnist] framework: [scikit-learn] --- diff --git a/examples/tensorflow-privacy/README.md b/examples/tensorflow-privacy/README.md index f5936df47450..04b81a29ee99 100644 --- a/examples/tensorflow-privacy/README.md +++ b/examples/tensorflow-privacy/README.md @@ -1,7 +1,7 @@ --- title: Sample-Level DP using TensorFlow-Privacy Engine labels: [basic, vision, fds, privacy, dp] -dataset: [MNIST | https://en.wikipedia.org/wiki/MNIST_database] +dataset: [MNIST | https://huggingface.co/datasets/ylecun/mnist] framework: [TensorFlow] --- From 9e41df73d6b31e39cefba824fc0463b5b302d46f Mon Sep 17 00:00:00 2001 From: Charles Beauville Date: Fri, 28 Jun 2024 15:56:43 +0200 Subject: [PATCH 36/66] Remove quotes --- examples/advanced-pytorch/README.md | 2 +- examples/advanced-tensorflow/README.md | 2 +- examples/android-kotlin/README.md | 2 +- examples/android/README.md | 2 +- examples/app-pytorch/README.md | 2 +- examples/app-secure-aggregation/README.md | 2 +- examples/custom-metrics/README.md | 2 +- examples/custom-mods/README.md | 2 +- examples/embedded-devices/README.md | 4 ++-- examples/fl-dp-sa/README.md | 2 +- examples/flower-authentication/README.md | 2 +- examples/flower-in-30-minutes/README.md | 2 +- examples/flower-via-docker-compose/README.md | 2 +- examples/opacus/README.md | 2 +- examples/pytorch-federated-variational-autoencoder/README.md | 2 +- examples/pytorch-from-centralized-to-federated/README.md | 2 +- examples/quickstart-pytorch/README.md | 2 +- examples/quickstart-tensorflow/README.md | 2 +- 18 files changed, 19 insertions(+), 19 deletions(-) diff --git a/examples/advanced-pytorch/README.md b/examples/advanced-pytorch/README.md index 64e74bb68317..be42e4f12b76 100644 --- a/examples/advanced-pytorch/README.md +++ b/examples/advanced-pytorch/README.md @@ -1,7 +1,7 @@ --- title: Advanced Flower Example using PyTorch labels: [advanced, vision, fds] -dataset: ["CIFAR-10 | https://huggingface.co/datasets/uoft-cs/cifar10"] +dataset: [CIFAR-10 | https://huggingface.co/datasets/uoft-cs/cifar10] framework: [torch, torchvision] --- diff --git a/examples/advanced-tensorflow/README.md b/examples/advanced-tensorflow/README.md index 9e64307903b4..a436668d6445 100644 --- a/examples/advanced-tensorflow/README.md +++ b/examples/advanced-tensorflow/README.md @@ -1,7 +1,7 @@ --- title: Advanced Flower Example using TensorFlow/Keras labels: [advanced, vision, fds] -dataset: ["CIFAR-10 | https://huggingface.co/datasets/uoft-cs/cifar10"] +dataset: [CIFAR-10 | https://huggingface.co/datasets/uoft-cs/cifar10] framework: [TensorFlow, Keras] --- diff --git a/examples/android-kotlin/README.md b/examples/android-kotlin/README.md index e8c8f01ab2c8..7a3db21e0f17 100644 --- a/examples/android-kotlin/README.md +++ b/examples/android-kotlin/README.md @@ -1,7 +1,7 @@ --- title: Flower Android Example using Kotlin and TF Lite labels: [basic, vision, fds] -dataset: ["CIFAR-10 | https://huggingface.co/datasets/uoft-cs/cifar10"] +dataset: [CIFAR-10 | https://huggingface.co/datasets/uoft-cs/cifar10] framework: [Android, Kotlin, TensorFlowLite] --- diff --git a/examples/android/README.md b/examples/android/README.md index 894914fcf495..e326ed9149a8 100644 --- a/examples/android/README.md +++ b/examples/android/README.md @@ -1,7 +1,7 @@ --- title: Flower Android Example using Java and TF Lite labels: [basic, vision, fds] -dataset: ["CIFAR-10 | https://huggingface.co/datasets/uoft-cs/cifar10"] +dataset: [CIFAR-10 | https://huggingface.co/datasets/uoft-cs/cifar10] framework: [Android, Java, TensorFlowLite] --- diff --git a/examples/app-pytorch/README.md b/examples/app-pytorch/README.md index cb833e967f30..fa4c3ccf8d5b 100644 --- a/examples/app-pytorch/README.md +++ b/examples/app-pytorch/README.md @@ -1,7 +1,7 @@ --- title: Example Flower App using PyTorch labels: [basic, vision, fds] -dataset: ["CIFAR-10 | https://huggingface.co/datasets/uoft-cs/cifar10"] +dataset: [CIFAR-10 | https://huggingface.co/datasets/uoft-cs/cifar10] framework: [torch, torchvision] --- diff --git a/examples/app-secure-aggregation/README.md b/examples/app-secure-aggregation/README.md index 91d8139b33f3..d5b4bbc5dffd 100644 --- a/examples/app-secure-aggregation/README.md +++ b/examples/app-secure-aggregation/README.md @@ -1,7 +1,7 @@ --- title: Example Flower App with Secure Aggregation labels: [basic, vision, fds] -dataset: ["CIFAR-10 | https://huggingface.co/datasets/uoft-cs/cifar10"] +dataset: [CIFAR-10 | https://huggingface.co/datasets/uoft-cs/cifar10] framework: [numpy] --- diff --git a/examples/custom-metrics/README.md b/examples/custom-metrics/README.md index b3b492c472f3..92a5587528a1 100644 --- a/examples/custom-metrics/README.md +++ b/examples/custom-metrics/README.md @@ -1,7 +1,7 @@ --- title: Example Flower App with Custom Metrics labels: [basic, vision, fds] -dataset: ["CIFAR-10 | https://huggingface.co/datasets/uoft-cs/cifar10"] +dataset: [CIFAR-10 | https://huggingface.co/datasets/uoft-cs/cifar10] framework: [tensorflow] --- diff --git a/examples/custom-mods/README.md b/examples/custom-mods/README.md index b359652c9c73..acc282a59afe 100644 --- a/examples/custom-mods/README.md +++ b/examples/custom-mods/README.md @@ -1,7 +1,7 @@ --- title: Example Flower App with Custom Mods labels: [mods, monitoring, app] -dataset: ["CIFAR-10 | https://huggingface.co/datasets/uoft-cs/cifar10"] +dataset: [CIFAR-10 | https://huggingface.co/datasets/uoft-cs/cifar10] framework: [torch, wandb, tensorboard, torchvision] --- diff --git a/examples/embedded-devices/README.md b/examples/embedded-devices/README.md index 65f68ace2481..d072bc4dbefd 100644 --- a/examples/embedded-devices/README.md +++ b/examples/embedded-devices/README.md @@ -1,7 +1,7 @@ --- title: Flower Embedded Devices Example labels: [basic, vision, fds] -dataset: ["CIFAR-10 | https://huggingface.co/datasets/uoft-cs/cifar10"] +dataset: [CIFAR-10 | https://huggingface.co/datasets/uoft-cs/cifar10] framework: [PyTorch, TensorFlow] --- @@ -187,7 +187,7 @@ If you are working on this tutorial on your laptop or desktop, it can host the F ## Running Embedded FL with Flower -For this demo, we'll be using ["CIFAR-10 | https://huggingface.co/datasets/uoft-cs/cifar10"](https://www.cs.toronto.edu/~kriz/cifar.html), a popular dataset for image classification comprised of 10 classes (e.g. car, bird, airplane) and a total of 60K `32x32` RGB images. The training set contains 50K images. The server will automatically download the dataset should it not be found in `./data`. The clients do the same. The dataset is by default split into 50 partitions (each to be assigned to a different client). This can be controlled with the `NUM_CLIENTS` global variable in the client scripts. In this example, each device will play the role of a specific user (specified via `--cid` -- we'll show this later) and therefore only do local training with that portion of the data. For CIFAR-10, clients will be training a MobileNet-v2/3 model. +For this demo, we'll be using [CIFAR-10 | https://huggingface.co/datasets/uoft-cs/cifar10](https://www.cs.toronto.edu/~kriz/cifar.html), a popular dataset for image classification comprised of 10 classes (e.g. car, bird, airplane) and a total of 60K `32x32` RGB images. The training set contains 50K images. The server will automatically download the dataset should it not be found in `./data`. The clients do the same. The dataset is by default split into 50 partitions (each to be assigned to a different client). This can be controlled with the `NUM_CLIENTS` global variable in the client scripts. In this example, each device will play the role of a specific user (specified via `--cid` -- we'll show this later) and therefore only do local training with that portion of the data. For CIFAR-10, clients will be training a MobileNet-v2/3 model. You can run this example using MNIST and a smaller CNN model by passing flag `--mnist`. This is useful if you are using devices with a very limited amount of memory (e.g. RaspberryPi Zero) or if you want the training taking place on the embedded devices to be much faster (specially if these are CPU-only). The partitioning of the dataset is done in the same way. diff --git a/examples/fl-dp-sa/README.md b/examples/fl-dp-sa/README.md index cbc1664de3ee..6b5bf3381179 100644 --- a/examples/fl-dp-sa/README.md +++ b/examples/fl-dp-sa/README.md @@ -1,7 +1,7 @@ --- title: Example of Flower App with DP and SA labels: [basic, vision, fds] -dataset: ["CIFAR-10 | https://huggingface.co/datasets/uoft-cs/cifar10"] +dataset: [CIFAR-10 | https://huggingface.co/datasets/uoft-cs/cifar10] framework: [torch, torchvision] --- diff --git a/examples/flower-authentication/README.md b/examples/flower-authentication/README.md index c787cb493b74..402e17fdc8a0 100644 --- a/examples/flower-authentication/README.md +++ b/examples/flower-authentication/README.md @@ -1,7 +1,7 @@ --- title: Flower Example with Authentication labels: [advanced, vision, fds] -dataset: ["CIFAR-10 | https://huggingface.co/datasets/uoft-cs/cifar10"] +dataset: [CIFAR-10 | https://huggingface.co/datasets/uoft-cs/cifar10] framework: [torch, torchvision] --- diff --git a/examples/flower-in-30-minutes/README.md b/examples/flower-in-30-minutes/README.md index e5d5eb6f7d42..2d6ced221e41 100644 --- a/examples/flower-in-30-minutes/README.md +++ b/examples/flower-in-30-minutes/README.md @@ -1,7 +1,7 @@ --- title: 30-minute tutorial running Flower simulation with PyTorch labels: [colab, vision, simulation] -dataset: ["CIFAR-10 | https://huggingface.co/datasets/uoft-cs/cifar10"] +dataset: [CIFAR-10 | https://huggingface.co/datasets/uoft-cs/cifar10] framework: [torch] --- diff --git a/examples/flower-via-docker-compose/README.md b/examples/flower-via-docker-compose/README.md index a142bd699b4d..e19ffa7b7e3e 100644 --- a/examples/flower-via-docker-compose/README.md +++ b/examples/flower-via-docker-compose/README.md @@ -1,7 +1,7 @@ --- title: Leveraging Flower and Docker for Device Heterogeneity Management in FL labels: [deployment, vision, tutorial] -dataset: ["CIFAR-10 | https://huggingface.co/datasets/uoft-cs/cifar10"] +dataset: [CIFAR-10 | https://huggingface.co/datasets/uoft-cs/cifar10] framework: [Docker] --- diff --git a/examples/opacus/README.md b/examples/opacus/README.md index ae5befb14fa1..8829a11f8ef4 100644 --- a/examples/opacus/README.md +++ b/examples/opacus/README.md @@ -1,7 +1,7 @@ --- title: Sample-Level Differential Privacy using Opacus labels: [dp, security, fds] -dataset: ["CIFAR-10 | https://huggingface.co/datasets/uoft-cs/cifar10"] +dataset: [CIFAR-10 | https://huggingface.co/datasets/uoft-cs/cifar10] framework: [opacus, PyTorch] --- diff --git a/examples/pytorch-federated-variational-autoencoder/README.md b/examples/pytorch-federated-variational-autoencoder/README.md index ee79bcbbd2cc..c8d33ec41e70 100644 --- a/examples/pytorch-federated-variational-autoencoder/README.md +++ b/examples/pytorch-federated-variational-autoencoder/README.md @@ -1,7 +1,7 @@ --- title: Federated Variational Autoencoder using Pytorch labels: [basic, vision, fds] -dataset: ["CIFAR-10 | https://huggingface.co/datasets/uoft-cs/cifar10"] +dataset: [CIFAR-10 | https://huggingface.co/datasets/uoft-cs/cifar10] framework: [torch, torchvision] --- diff --git a/examples/pytorch-from-centralized-to-federated/README.md b/examples/pytorch-from-centralized-to-federated/README.md index b0234366466c..82c30c113778 100644 --- a/examples/pytorch-from-centralized-to-federated/README.md +++ b/examples/pytorch-from-centralized-to-federated/README.md @@ -1,7 +1,7 @@ --- title: PyTorch, From Centralized To Federated labels: [basic, vision, fds] -dataset: ["CIFAR-10 | https://huggingface.co/datasets/uoft-cs/cifar10"] +dataset: [CIFAR-10 | https://huggingface.co/datasets/uoft-cs/cifar10] framework: [torch] --- diff --git a/examples/quickstart-pytorch/README.md b/examples/quickstart-pytorch/README.md index 819cc0ab68fa..6c3255b9cc95 100644 --- a/examples/quickstart-pytorch/README.md +++ b/examples/quickstart-pytorch/README.md @@ -1,7 +1,7 @@ --- title: Simple Flower Example using PyTorch labels: [quickstart, vision, fds] -dataset: ["CIFAR-10 | https://huggingface.co/datasets/uoft-cs/cifar10"] +dataset: [CIFAR-10 | https://huggingface.co/datasets/uoft-cs/cifar10] framework: [torch, torchvision] --- diff --git a/examples/quickstart-tensorflow/README.md b/examples/quickstart-tensorflow/README.md index 750d1c4a9e21..1f482ffc8dd1 100644 --- a/examples/quickstart-tensorflow/README.md +++ b/examples/quickstart-tensorflow/README.md @@ -1,7 +1,7 @@ --- title: Simple Flower Example using TensorFlow labels: [quickstart, vision, fds] -dataset: ["CIFAR-10 | https://huggingface.co/datasets/uoft-cs/cifar10"] +dataset: [CIFAR-10 | https://huggingface.co/datasets/uoft-cs/cifar10] framework: [TensorFlow] --- From 21f02e22ead8fcd0b2947e1a8fee97bf0b7cf9a1 Mon Sep 17 00:00:00 2001 From: Charles Beauville Date: Fri, 28 Jun 2024 15:59:03 +0200 Subject: [PATCH 37/66] Update iris and MedNist --- examples/quickstart-monai/README.md | 2 +- examples/quickstart-pandas/README.md | 2 +- examples/quickstart-sklearn-tabular/README.md | 2 +- examples/quickstart-tabnet/README.md | 2 +- 4 files changed, 4 insertions(+), 4 deletions(-) diff --git a/examples/quickstart-monai/README.md b/examples/quickstart-monai/README.md index 3aeb373d3342..43f8c1cacbc7 100644 --- a/examples/quickstart-monai/README.md +++ b/examples/quickstart-monai/README.md @@ -1,7 +1,7 @@ --- title: Flower Example using MONAI labels: [quickstart, medical, vision] -dataset: [MedNIST] +dataset: [MedNIST | https://medmnist.com/] framework: [MONAI | https://monai.io/] --- diff --git a/examples/quickstart-pandas/README.md b/examples/quickstart-pandas/README.md index e94244714b29..b90aca979e16 100644 --- a/examples/quickstart-pandas/README.md +++ b/examples/quickstart-pandas/README.md @@ -1,7 +1,7 @@ --- title: Simple Flower Example using Pandas labels: [quickstart, tabular, federated analytics] -dataset: [iris] +dataset: [Iris | https://scikit-learn.org/stable/auto_examples/datasets/plot_iris_dataset.html] framework: [Pandas] --- diff --git a/examples/quickstart-sklearn-tabular/README.md b/examples/quickstart-sklearn-tabular/README.md index 25ecd26ddf27..53fcbbbbdc8d 100644 --- a/examples/quickstart-sklearn-tabular/README.md +++ b/examples/quickstart-sklearn-tabular/README.md @@ -1,7 +1,7 @@ --- title: Flower Example using Scikit-Learn labels: [quickstart, tabular, fds] -dataset: [iris] +dataset: [Iris | https://scikit-learn.org/stable/auto_examples/datasets/plot_iris_dataset.html] framework: [scikit-learn] --- diff --git a/examples/quickstart-tabnet/README.md b/examples/quickstart-tabnet/README.md index d07c79e88cb5..a6aff705c70d 100644 --- a/examples/quickstart-tabnet/README.md +++ b/examples/quickstart-tabnet/README.md @@ -1,7 +1,7 @@ --- title: Simple Flower Example using Tabnet labels: [quickstart, tabular] -dataset: [iris] +dataset: [Iris | https://scikit-learn.org/stable/auto_examples/datasets/plot_iris_dataset.html] framework: [tabnet] --- From 319bc119f9dca5c0de3be7824d7a5c87ab387c0b Mon Sep 17 00:00:00 2001 From: Charles Beauville Date: Fri, 28 Jun 2024 16:03:27 +0200 Subject: [PATCH 38/66] Update metadata --- examples/fl-tabular/README.md | 2 +- examples/llm-flowertune/README.md | 2 +- examples/vit-finetune/README.md | 2 +- examples/whisper-federated-finetuning/README.md | 2 +- 4 files changed, 4 insertions(+), 4 deletions(-) diff --git a/examples/fl-tabular/README.md b/examples/fl-tabular/README.md index b56732947b7b..6496e8c30b55 100644 --- a/examples/fl-tabular/README.md +++ b/examples/fl-tabular/README.md @@ -1,7 +1,7 @@ --- title: Flower Example on Adult Census Income Tabular Dataset labels: [basic, tabular, fds] -dataset: [adult-census-income] +dataset: [Adult Census Income | https://www.kaggle.com/datasets/uciml/adult-census-income/data] framework: [scikit-learn] --- diff --git a/examples/llm-flowertune/README.md b/examples/llm-flowertune/README.md index ffa147c2e4f9..64490a0b7340 100644 --- a/examples/llm-flowertune/README.md +++ b/examples/llm-flowertune/README.md @@ -1,7 +1,7 @@ --- title: Federated LLM Fine-tuning with Flower labels: [llm, nlp, LLama2] -dataset: [Alpaca-GPT4] +dataset: [Alpaca-GPT4 | https://huggingface.co/datasets/vicgalle/alpaca-gpt4] framework: [PEFT] --- diff --git a/examples/vit-finetune/README.md b/examples/vit-finetune/README.md index 2cdb7af34b25..7005c699926e 100644 --- a/examples/vit-finetune/README.md +++ b/examples/vit-finetune/README.md @@ -1,7 +1,7 @@ --- title: Federated finetuning of a ViT labels: [finetuneing, vision, fds] -dataset: [Oxford Flower-102] +dataset: [Oxford Flower-102 | https://www.robots.ox.ac.uk/~vgg/data/flowers/102/] framework: [torch, torchvision] --- diff --git a/examples/whisper-federated-finetuning/README.md b/examples/whisper-federated-finetuning/README.md index 5aadfbeb7426..3f3317b81bba 100644 --- a/examples/whisper-federated-finetuning/README.md +++ b/examples/whisper-federated-finetuning/README.md @@ -1,7 +1,7 @@ --- title: On-device Federated Finetuning for Speech Classification labels: [finetuning, speech, transformers] -dataset: [speech_commands] +dataset: [SpeechCommands | https://huggingface.co/datasets/google/speech_commands] framework: [huggingface, whisper] --- From 8a4b26bd08564e22b1b1f79bf72a7e70ddccdfd6 Mon Sep 17 00:00:00 2001 From: Charles Beauville Date: Fri, 28 Jun 2024 16:06:55 +0200 Subject: [PATCH 39/66] Update metadata --- examples/federated-kaplan-meier-fitter/README.md | 4 ++-- examples/vertical-fl/README.md | 2 +- examples/xgboost-comprehensive/README.md | 2 +- examples/xgboost-quickstart/README.md | 2 +- 4 files changed, 5 insertions(+), 5 deletions(-) diff --git a/examples/federated-kaplan-meier-fitter/README.md b/examples/federated-kaplan-meier-fitter/README.md index e8f353dc3c47..3a5f832eec20 100644 --- a/examples/federated-kaplan-meier-fitter/README.md +++ b/examples/federated-kaplan-meier-fitter/README.md @@ -1,8 +1,8 @@ --- title: Flower Example using KaplanMeierFitter labels: [estimator, medical] -dataset: [Walton] -framework: [lifelines] +dataset: [Waltons | https://lifelines.readthedocs.io/en/latest/lifelines.datasets.html#lifelines.datasets.load_waltons] +framework: [lifelines | https://lifelines.readthedocs.io/en/latest/index.html] --- # Flower Example using KaplanMeierFitter diff --git a/examples/vertical-fl/README.md b/examples/vertical-fl/README.md index 020247612715..7ada1480d67e 100644 --- a/examples/vertical-fl/README.md +++ b/examples/vertical-fl/README.md @@ -1,7 +1,7 @@ --- title: Vertical FL Flower Example labels: [vertical, tabular, advanced] -dataset: [Titanic] +dataset: [Titanic | https://www.kaggle.com/competitions/titanic] framework: [torch, pandas, scikit-learn] --- diff --git a/examples/xgboost-comprehensive/README.md b/examples/xgboost-comprehensive/README.md index 697b2fe19b6f..cc895c7be88a 100644 --- a/examples/xgboost-comprehensive/README.md +++ b/examples/xgboost-comprehensive/README.md @@ -1,7 +1,7 @@ --- title: Flower Example using XGBoost labels: [advanced, classification, tabular] -dataset: [HIGGS] +dataset: [HIGGS | https://archive.ics.uci.edu/dataset/280/higgs] framework: [xgboost] --- diff --git a/examples/xgboost-quickstart/README.md b/examples/xgboost-quickstart/README.md index 78aa4f9ee75f..2be7fa76a66b 100644 --- a/examples/xgboost-quickstart/README.md +++ b/examples/xgboost-quickstart/README.md @@ -1,7 +1,7 @@ --- title: Flower Example using PyTorch labels: [quickstart, classification, tabular] -dataset: [HIGGS] +dataset: [HIGGS | https://archive.ics.uci.edu/dataset/280/higgs] framework: [xgboost] --- From d749720596cbb370e9bfced82d8990c6c3596a6f Mon Sep 17 00:00:00 2001 From: Charles Beauville Date: Fri, 28 Jun 2024 16:26:15 +0200 Subject: [PATCH 40/66] Support lists of tags --- dev/build-example-docs.py | 6 ++++++ examples/advanced-tensorflow/README.md | 2 +- examples/quickstart-mlcube/README.md | 2 +- examples/simulation-tensorflow/README.md | 2 +- 4 files changed, 9 insertions(+), 3 deletions(-) diff --git a/dev/build-example-docs.py b/dev/build-example-docs.py index 2064e75af0c7..addb66906954 100644 --- a/dev/build-example-docs.py +++ b/dev/build-example-docs.py @@ -44,6 +44,12 @@ def _convert_to_link(search_result): if "|" in search_result: + if "," in search_result: + result = "" + for part in search_result.split(","): + result += f"{_convert_to_link(part)}, " + return result[:-2] + name, url = search_result.replace('"', "").split("|") return f"`{name.strip()} <{url.strip()}>`_" diff --git a/examples/advanced-tensorflow/README.md b/examples/advanced-tensorflow/README.md index a436668d6445..7f9edcea3d0f 100644 --- a/examples/advanced-tensorflow/README.md +++ b/examples/advanced-tensorflow/README.md @@ -2,7 +2,7 @@ title: Advanced Flower Example using TensorFlow/Keras labels: [advanced, vision, fds] dataset: [CIFAR-10 | https://huggingface.co/datasets/uoft-cs/cifar10] -framework: [TensorFlow, Keras] +framework: [tensorflow | https://www.tensorflow.org/, Keras] --- # Advanced Flower Example (TensorFlow/Keras) diff --git a/examples/quickstart-mlcube/README.md b/examples/quickstart-mlcube/README.md index ca1f0b74ebc3..49ae09b376f9 100644 --- a/examples/quickstart-mlcube/README.md +++ b/examples/quickstart-mlcube/README.md @@ -2,7 +2,7 @@ title: Flower Example using TensorFlow/Keras + MLCube labels: [quickstart, vision, deployment] dataset: [MNIST | https://huggingface.co/datasets/ylecun/mnist] -framework: [TensorFlow, Keras] +framework: [tensorflow | https://www.tensorflow.org/, Keras] --- # Flower Example using TensorFlow/Keras + MLCube diff --git a/examples/simulation-tensorflow/README.md b/examples/simulation-tensorflow/README.md index 6dc7632ddb96..79da3dbedd13 100644 --- a/examples/simulation-tensorflow/README.md +++ b/examples/simulation-tensorflow/README.md @@ -2,7 +2,7 @@ title: Flower Simulation Example using TensorFlow/Keras labels: [basic, vision, fds, simulation] dataset: [MNIST | https://huggingface.co/datasets/ylecun/mnist] -framework: [TensorFlow, Keras] +framework: [tensorflow | https://www.tensorflow.org/, Keras] --- # Flower Simulation example using TensorFlow/Keras From 24be99c3be705d05712ae6b0f49b3542c9c9cb79 Mon Sep 17 00:00:00 2001 From: Charles Beauville Date: Fri, 28 Jun 2024 16:27:33 +0200 Subject: [PATCH 41/66] Update metadata --- examples/quickstart-tensorflow/README.md | 2 +- examples/tensorflow-privacy/README.md | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/examples/quickstart-tensorflow/README.md b/examples/quickstart-tensorflow/README.md index 1f482ffc8dd1..ce7190b35ef9 100644 --- a/examples/quickstart-tensorflow/README.md +++ b/examples/quickstart-tensorflow/README.md @@ -2,7 +2,7 @@ title: Simple Flower Example using TensorFlow labels: [quickstart, vision, fds] dataset: [CIFAR-10 | https://huggingface.co/datasets/uoft-cs/cifar10] -framework: [TensorFlow] +framework: [tensorflow | https://www.tensorflow.org/] --- # Flower Example using TensorFlow/Keras diff --git a/examples/tensorflow-privacy/README.md b/examples/tensorflow-privacy/README.md index 04b81a29ee99..b0b7ec0fab3e 100644 --- a/examples/tensorflow-privacy/README.md +++ b/examples/tensorflow-privacy/README.md @@ -2,7 +2,7 @@ title: Sample-Level DP using TensorFlow-Privacy Engine labels: [basic, vision, fds, privacy, dp] dataset: [MNIST | https://huggingface.co/datasets/ylecun/mnist] -framework: [TensorFlow] +framework: [tensorflow | https://www.tensorflow.org/] --- # Training with Sample-Level Differential Privacy using TensorFlow-Privacy Engine From 9bcf90f6872043bcf0bfa043b9f1a66eac5cf762 Mon Sep 17 00:00:00 2001 From: Charles Beauville Date: Fri, 28 Jun 2024 16:29:13 +0200 Subject: [PATCH 42/66] Update scikit-learn --- examples/fl-tabular/README.md | 2 +- examples/quickstart-sklearn-tabular/README.md | 2 +- examples/sklearn-logreg-mnist/README.md | 2 +- examples/vertical-fl/README.md | 2 +- 4 files changed, 4 insertions(+), 4 deletions(-) diff --git a/examples/fl-tabular/README.md b/examples/fl-tabular/README.md index 6496e8c30b55..5e006dfe0e58 100644 --- a/examples/fl-tabular/README.md +++ b/examples/fl-tabular/README.md @@ -2,7 +2,7 @@ title: Flower Example on Adult Census Income Tabular Dataset labels: [basic, tabular, fds] dataset: [Adult Census Income | https://www.kaggle.com/datasets/uciml/adult-census-income/data] -framework: [scikit-learn] +framework: [scikit-learn | https://scikit-learn.org/] --- # Flower Example on Adult Census Income Tabular Dataset diff --git a/examples/quickstart-sklearn-tabular/README.md b/examples/quickstart-sklearn-tabular/README.md index 53fcbbbbdc8d..bb9aac58a0ed 100644 --- a/examples/quickstart-sklearn-tabular/README.md +++ b/examples/quickstart-sklearn-tabular/README.md @@ -2,7 +2,7 @@ title: Flower Example using Scikit-Learn labels: [quickstart, tabular, fds] dataset: [Iris | https://scikit-learn.org/stable/auto_examples/datasets/plot_iris_dataset.html] -framework: [scikit-learn] +framework: [scikit-learn | https://scikit-learn.org/] --- # Flower Example using scikit-learn diff --git a/examples/sklearn-logreg-mnist/README.md b/examples/sklearn-logreg-mnist/README.md index e0b34f760292..edea3d7b28e8 100644 --- a/examples/sklearn-logreg-mnist/README.md +++ b/examples/sklearn-logreg-mnist/README.md @@ -2,7 +2,7 @@ title: Flower LogReg Example using Scikit-Learn labels: [basic, vision, logistic regression, fds] dataset: [MNIST | https://huggingface.co/datasets/ylecun/mnist] -framework: [scikit-learn] +framework: [scikit-learn | https://scikit-learn.org/] --- # Flower Example using scikit-learn diff --git a/examples/vertical-fl/README.md b/examples/vertical-fl/README.md index 7ada1480d67e..0fac9ed2b5d4 100644 --- a/examples/vertical-fl/README.md +++ b/examples/vertical-fl/README.md @@ -2,7 +2,7 @@ title: Vertical FL Flower Example labels: [vertical, tabular, advanced] dataset: [Titanic | https://www.kaggle.com/competitions/titanic] -framework: [torch, pandas, scikit-learn] +framework: [torch, pandas, scikit-learn | https://scikit-learn.org/] --- # Vertical Federated Learning example From 56005ba7a59458ce7f8aa268d151b66d5b10ba55 Mon Sep 17 00:00:00 2001 From: Charles Beauville Date: Fri, 28 Jun 2024 16:30:55 +0200 Subject: [PATCH 43/66] Update torchvision metadata --- examples/advanced-pytorch/README.md | 2 +- examples/app-pytorch/README.md | 2 +- examples/custom-mods/README.md | 2 +- examples/fl-dp-sa/README.md | 2 +- examples/flower-authentication/README.md | 2 +- examples/pytorch-federated-variational-autoencoder/README.md | 2 +- examples/quickstart-pytorch/README.md | 2 +- examples/simulation-pytorch/README.md | 2 +- examples/vit-finetune/README.md | 2 +- 9 files changed, 9 insertions(+), 9 deletions(-) diff --git a/examples/advanced-pytorch/README.md b/examples/advanced-pytorch/README.md index be42e4f12b76..0f309b035996 100644 --- a/examples/advanced-pytorch/README.md +++ b/examples/advanced-pytorch/README.md @@ -2,7 +2,7 @@ title: Advanced Flower Example using PyTorch labels: [advanced, vision, fds] dataset: [CIFAR-10 | https://huggingface.co/datasets/uoft-cs/cifar10] -framework: [torch, torchvision] +framework: [torch, torchvision | https://pytorch.org/vision/stable/index.html] --- # Advanced Flower Example (PyTorch) diff --git a/examples/app-pytorch/README.md b/examples/app-pytorch/README.md index fa4c3ccf8d5b..d9a9a2a15a61 100644 --- a/examples/app-pytorch/README.md +++ b/examples/app-pytorch/README.md @@ -2,7 +2,7 @@ title: Example Flower App using PyTorch labels: [basic, vision, fds] dataset: [CIFAR-10 | https://huggingface.co/datasets/uoft-cs/cifar10] -framework: [torch, torchvision] +framework: [torch, torchvision | https://pytorch.org/vision/stable/index.html] --- # Flower App (PyTorch) 🧪 diff --git a/examples/custom-mods/README.md b/examples/custom-mods/README.md index acc282a59afe..6ce82096df23 100644 --- a/examples/custom-mods/README.md +++ b/examples/custom-mods/README.md @@ -2,7 +2,7 @@ title: Example Flower App with Custom Mods labels: [mods, monitoring, app] dataset: [CIFAR-10 | https://huggingface.co/datasets/uoft-cs/cifar10] -framework: [torch, wandb, tensorboard, torchvision] +framework: [torch, wandb, tensorboard, torchvision | https://pytorch.org/vision/stable/index.html] --- # Using custom mods 🧪 diff --git a/examples/fl-dp-sa/README.md b/examples/fl-dp-sa/README.md index 6b5bf3381179..c2f8276e10f0 100644 --- a/examples/fl-dp-sa/README.md +++ b/examples/fl-dp-sa/README.md @@ -2,7 +2,7 @@ title: Example of Flower App with DP and SA labels: [basic, vision, fds] dataset: [CIFAR-10 | https://huggingface.co/datasets/uoft-cs/cifar10] -framework: [torch, torchvision] +framework: [torch, torchvision | https://pytorch.org/vision/stable/index.html] --- # Example of Flower App with DP and SA diff --git a/examples/flower-authentication/README.md b/examples/flower-authentication/README.md index 402e17fdc8a0..278bcdb8ab39 100644 --- a/examples/flower-authentication/README.md +++ b/examples/flower-authentication/README.md @@ -2,7 +2,7 @@ title: Flower Example with Authentication labels: [advanced, vision, fds] dataset: [CIFAR-10 | https://huggingface.co/datasets/uoft-cs/cifar10] -framework: [torch, torchvision] +framework: [torch, torchvision | https://pytorch.org/vision/stable/index.html] --- # Flower Authentication with PyTorch 🧪 diff --git a/examples/pytorch-federated-variational-autoencoder/README.md b/examples/pytorch-federated-variational-autoencoder/README.md index c8d33ec41e70..5f6ef1687ac4 100644 --- a/examples/pytorch-federated-variational-autoencoder/README.md +++ b/examples/pytorch-federated-variational-autoencoder/README.md @@ -2,7 +2,7 @@ title: Federated Variational Autoencoder using Pytorch labels: [basic, vision, fds] dataset: [CIFAR-10 | https://huggingface.co/datasets/uoft-cs/cifar10] -framework: [torch, torchvision] +framework: [torch, torchvision | https://pytorch.org/vision/stable/index.html] --- # Flower Example for Federated Variational Autoencoder using Pytorch diff --git a/examples/quickstart-pytorch/README.md b/examples/quickstart-pytorch/README.md index 6c3255b9cc95..922f4a7def8c 100644 --- a/examples/quickstart-pytorch/README.md +++ b/examples/quickstart-pytorch/README.md @@ -2,7 +2,7 @@ title: Simple Flower Example using PyTorch labels: [quickstart, vision, fds] dataset: [CIFAR-10 | https://huggingface.co/datasets/uoft-cs/cifar10] -framework: [torch, torchvision] +framework: [torch, torchvision | https://pytorch.org/vision/stable/index.html] --- # Flower Example using PyTorch diff --git a/examples/simulation-pytorch/README.md b/examples/simulation-pytorch/README.md index 8cc2f32332cc..7281e9d278d5 100644 --- a/examples/simulation-pytorch/README.md +++ b/examples/simulation-pytorch/README.md @@ -2,7 +2,7 @@ title: Flower Simulation Example using PyTorch labels: [basic, vision, fds, simulation] dataset: [MNIST | https://huggingface.co/datasets/ylecun/mnist] -framework: [torch, torchvision] +framework: [torch, torchvision | https://pytorch.org/vision/stable/index.html] --- # Flower Simulation example using PyTorch diff --git a/examples/vit-finetune/README.md b/examples/vit-finetune/README.md index 7005c699926e..f57a8409de58 100644 --- a/examples/vit-finetune/README.md +++ b/examples/vit-finetune/README.md @@ -2,7 +2,7 @@ title: Federated finetuning of a ViT labels: [finetuneing, vision, fds] dataset: [Oxford Flower-102 | https://www.robots.ox.ac.uk/~vgg/data/flowers/102/] -framework: [torch, torchvision] +framework: [torch, torchvision | https://pytorch.org/vision/stable/index.html] --- # Federated finetuning of a ViT From 2b79e989526894b25261af7a24f798919ccaa1be Mon Sep 17 00:00:00 2001 From: Charles Beauville Date: Fri, 28 Jun 2024 16:31:54 +0200 Subject: [PATCH 44/66] Update torch metadata --- examples/advanced-pytorch/README.md | 2 +- examples/app-pytorch/README.md | 2 +- examples/custom-mods/README.md | 2 +- examples/fl-dp-sa/README.md | 2 +- examples/flower-authentication/README.md | 2 +- examples/flower-in-30-minutes/README.md | 2 +- examples/flower-simulation-step-by-step-pytorch/README.md | 2 +- examples/pytorch-federated-variational-autoencoder/README.md | 2 +- examples/pytorch-from-centralized-to-federated/README.md | 2 +- examples/quickstart-pytorch/README.md | 2 +- examples/simulation-pytorch/README.md | 2 +- examples/vertical-fl/README.md | 2 +- examples/vit-finetune/README.md | 2 +- 13 files changed, 13 insertions(+), 13 deletions(-) diff --git a/examples/advanced-pytorch/README.md b/examples/advanced-pytorch/README.md index 0f309b035996..bce80ab2f53d 100644 --- a/examples/advanced-pytorch/README.md +++ b/examples/advanced-pytorch/README.md @@ -2,7 +2,7 @@ title: Advanced Flower Example using PyTorch labels: [advanced, vision, fds] dataset: [CIFAR-10 | https://huggingface.co/datasets/uoft-cs/cifar10] -framework: [torch, torchvision | https://pytorch.org/vision/stable/index.html] +framework: [torch | https://pytorch.org/, torchvision | https://pytorch.org/vision/stable/index.html] --- # Advanced Flower Example (PyTorch) diff --git a/examples/app-pytorch/README.md b/examples/app-pytorch/README.md index d9a9a2a15a61..cb41b371ed22 100644 --- a/examples/app-pytorch/README.md +++ b/examples/app-pytorch/README.md @@ -2,7 +2,7 @@ title: Example Flower App using PyTorch labels: [basic, vision, fds] dataset: [CIFAR-10 | https://huggingface.co/datasets/uoft-cs/cifar10] -framework: [torch, torchvision | https://pytorch.org/vision/stable/index.html] +framework: [torch | https://pytorch.org/, torchvision | https://pytorch.org/vision/stable/index.html] --- # Flower App (PyTorch) 🧪 diff --git a/examples/custom-mods/README.md b/examples/custom-mods/README.md index 6ce82096df23..80d9ce1f9f11 100644 --- a/examples/custom-mods/README.md +++ b/examples/custom-mods/README.md @@ -2,7 +2,7 @@ title: Example Flower App with Custom Mods labels: [mods, monitoring, app] dataset: [CIFAR-10 | https://huggingface.co/datasets/uoft-cs/cifar10] -framework: [torch, wandb, tensorboard, torchvision | https://pytorch.org/vision/stable/index.html] +framework: [torch | https://pytorch.org/, wandb, tensorboard, torchvision | https://pytorch.org/vision/stable/index.html] --- # Using custom mods 🧪 diff --git a/examples/fl-dp-sa/README.md b/examples/fl-dp-sa/README.md index c2f8276e10f0..a551510c1d4e 100644 --- a/examples/fl-dp-sa/README.md +++ b/examples/fl-dp-sa/README.md @@ -2,7 +2,7 @@ title: Example of Flower App with DP and SA labels: [basic, vision, fds] dataset: [CIFAR-10 | https://huggingface.co/datasets/uoft-cs/cifar10] -framework: [torch, torchvision | https://pytorch.org/vision/stable/index.html] +framework: [torch | https://pytorch.org/, torchvision | https://pytorch.org/vision/stable/index.html] --- # Example of Flower App with DP and SA diff --git a/examples/flower-authentication/README.md b/examples/flower-authentication/README.md index 278bcdb8ab39..3709ab4139c1 100644 --- a/examples/flower-authentication/README.md +++ b/examples/flower-authentication/README.md @@ -2,7 +2,7 @@ title: Flower Example with Authentication labels: [advanced, vision, fds] dataset: [CIFAR-10 | https://huggingface.co/datasets/uoft-cs/cifar10] -framework: [torch, torchvision | https://pytorch.org/vision/stable/index.html] +framework: [torch | https://pytorch.org/, torchvision | https://pytorch.org/vision/stable/index.html] --- # Flower Authentication with PyTorch 🧪 diff --git a/examples/flower-in-30-minutes/README.md b/examples/flower-in-30-minutes/README.md index 2d6ced221e41..e13921f8c2b2 100644 --- a/examples/flower-in-30-minutes/README.md +++ b/examples/flower-in-30-minutes/README.md @@ -2,7 +2,7 @@ title: 30-minute tutorial running Flower simulation with PyTorch labels: [colab, vision, simulation] dataset: [CIFAR-10 | https://huggingface.co/datasets/uoft-cs/cifar10] -framework: [torch] +framework: [torch | https://pytorch.org/] --- # 30-minute tutorial running Flower simulation with PyTorch diff --git a/examples/flower-simulation-step-by-step-pytorch/README.md b/examples/flower-simulation-step-by-step-pytorch/README.md index 0ddc3f30967a..28f99ab5fa6e 100644 --- a/examples/flower-simulation-step-by-step-pytorch/README.md +++ b/examples/flower-simulation-step-by-step-pytorch/README.md @@ -2,7 +2,7 @@ title: Flower Simulation Step-by-Step labels: [basic, vision, simulation] dataset: [MNIST | https://huggingface.co/datasets/ylecun/mnist] -framework: [torch] +framework: [torch | https://pytorch.org/] --- # Flower Simulation Step-by-Step diff --git a/examples/pytorch-federated-variational-autoencoder/README.md b/examples/pytorch-federated-variational-autoencoder/README.md index 5f6ef1687ac4..539ab6904a1c 100644 --- a/examples/pytorch-federated-variational-autoencoder/README.md +++ b/examples/pytorch-federated-variational-autoencoder/README.md @@ -2,7 +2,7 @@ title: Federated Variational Autoencoder using Pytorch labels: [basic, vision, fds] dataset: [CIFAR-10 | https://huggingface.co/datasets/uoft-cs/cifar10] -framework: [torch, torchvision | https://pytorch.org/vision/stable/index.html] +framework: [torch | https://pytorch.org/, torchvision | https://pytorch.org/vision/stable/index.html] --- # Flower Example for Federated Variational Autoencoder using Pytorch diff --git a/examples/pytorch-from-centralized-to-federated/README.md b/examples/pytorch-from-centralized-to-federated/README.md index 82c30c113778..683604ec4eb9 100644 --- a/examples/pytorch-from-centralized-to-federated/README.md +++ b/examples/pytorch-from-centralized-to-federated/README.md @@ -2,7 +2,7 @@ title: PyTorch, From Centralized To Federated labels: [basic, vision, fds] dataset: [CIFAR-10 | https://huggingface.co/datasets/uoft-cs/cifar10] -framework: [torch] +framework: [torch | https://pytorch.org/] --- # PyTorch: From Centralized To Federated diff --git a/examples/quickstart-pytorch/README.md b/examples/quickstart-pytorch/README.md index 922f4a7def8c..63a357b37e58 100644 --- a/examples/quickstart-pytorch/README.md +++ b/examples/quickstart-pytorch/README.md @@ -2,7 +2,7 @@ title: Simple Flower Example using PyTorch labels: [quickstart, vision, fds] dataset: [CIFAR-10 | https://huggingface.co/datasets/uoft-cs/cifar10] -framework: [torch, torchvision | https://pytorch.org/vision/stable/index.html] +framework: [torch | https://pytorch.org/, torchvision | https://pytorch.org/vision/stable/index.html] --- # Flower Example using PyTorch diff --git a/examples/simulation-pytorch/README.md b/examples/simulation-pytorch/README.md index 7281e9d278d5..85b9e136e6dc 100644 --- a/examples/simulation-pytorch/README.md +++ b/examples/simulation-pytorch/README.md @@ -2,7 +2,7 @@ title: Flower Simulation Example using PyTorch labels: [basic, vision, fds, simulation] dataset: [MNIST | https://huggingface.co/datasets/ylecun/mnist] -framework: [torch, torchvision | https://pytorch.org/vision/stable/index.html] +framework: [torch | https://pytorch.org/, torchvision | https://pytorch.org/vision/stable/index.html] --- # Flower Simulation example using PyTorch diff --git a/examples/vertical-fl/README.md b/examples/vertical-fl/README.md index 0fac9ed2b5d4..50d5c2ceca50 100644 --- a/examples/vertical-fl/README.md +++ b/examples/vertical-fl/README.md @@ -2,7 +2,7 @@ title: Vertical FL Flower Example labels: [vertical, tabular, advanced] dataset: [Titanic | https://www.kaggle.com/competitions/titanic] -framework: [torch, pandas, scikit-learn | https://scikit-learn.org/] +framework: [torch | https://pytorch.org/, pandas, scikit-learn | https://scikit-learn.org/] --- # Vertical Federated Learning example diff --git a/examples/vit-finetune/README.md b/examples/vit-finetune/README.md index f57a8409de58..5a544d84b9fa 100644 --- a/examples/vit-finetune/README.md +++ b/examples/vit-finetune/README.md @@ -2,7 +2,7 @@ title: Federated finetuning of a ViT labels: [finetuneing, vision, fds] dataset: [Oxford Flower-102 | https://www.robots.ox.ac.uk/~vgg/data/flowers/102/] -framework: [torch, torchvision | https://pytorch.org/vision/stable/index.html] +framework: [torch | https://pytorch.org/, torchvision | https://pytorch.org/vision/stable/index.html] --- # Federated finetuning of a ViT From 207c3736367f110f82d20265221684c12a19e784 Mon Sep 17 00:00:00 2001 From: Charles Beauville Date: Fri, 28 Jun 2024 16:33:34 +0200 Subject: [PATCH 45/66] Add link to xgboost --- examples/xgboost-comprehensive/README.md | 2 +- examples/xgboost-quickstart/README.md | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/examples/xgboost-comprehensive/README.md b/examples/xgboost-comprehensive/README.md index cc895c7be88a..ea06febe43a7 100644 --- a/examples/xgboost-comprehensive/README.md +++ b/examples/xgboost-comprehensive/README.md @@ -2,7 +2,7 @@ title: Flower Example using XGBoost labels: [advanced, classification, tabular] dataset: [HIGGS | https://archive.ics.uci.edu/dataset/280/higgs] -framework: [xgboost] +framework: [xgboost | https://xgboost.readthedocs.io/en/stable/] --- # Flower Example using XGBoost (Comprehensive) diff --git a/examples/xgboost-quickstart/README.md b/examples/xgboost-quickstart/README.md index 2be7fa76a66b..40edfd0c1870 100644 --- a/examples/xgboost-quickstart/README.md +++ b/examples/xgboost-quickstart/README.md @@ -2,7 +2,7 @@ title: Flower Example using PyTorch labels: [quickstart, classification, tabular] dataset: [HIGGS | https://archive.ics.uci.edu/dataset/280/higgs] -framework: [xgboost] +framework: [xgboost | https://xgboost.readthedocs.io/en/stable/] --- # Flower Example using XGBoost From 604fe0b2b4c75b604beab44d5fd9cdd48a7af1e3 Mon Sep 17 00:00:00 2001 From: Charles Beauville Date: Fri, 28 Jun 2024 16:34:50 +0200 Subject: [PATCH 46/66] Update metadata --- examples/quickstart-pandas/README.md | 2 +- examples/vertical-fl/README.md | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/examples/quickstart-pandas/README.md b/examples/quickstart-pandas/README.md index b90aca979e16..d2cc7abbacd1 100644 --- a/examples/quickstart-pandas/README.md +++ b/examples/quickstart-pandas/README.md @@ -2,7 +2,7 @@ title: Simple Flower Example using Pandas labels: [quickstart, tabular, federated analytics] dataset: [Iris | https://scikit-learn.org/stable/auto_examples/datasets/plot_iris_dataset.html] -framework: [Pandas] +framework: [pandas | https://pandas.pydata.org/] --- # Flower Example using Pandas diff --git a/examples/vertical-fl/README.md b/examples/vertical-fl/README.md index 50d5c2ceca50..3c29e1babcdf 100644 --- a/examples/vertical-fl/README.md +++ b/examples/vertical-fl/README.md @@ -2,7 +2,7 @@ title: Vertical FL Flower Example labels: [vertical, tabular, advanced] dataset: [Titanic | https://www.kaggle.com/competitions/titanic] -framework: [torch | https://pytorch.org/, pandas, scikit-learn | https://scikit-learn.org/] +framework: [torch | https://pytorch.org/, pandas | https://pandas.pydata.org/, scikit-learn | https://scikit-learn.org/] --- # Vertical Federated Learning example From 81e7b12081d15990296687287ebb5d17e1c22287 Mon Sep 17 00:00:00 2001 From: Charles Beauville Date: Fri, 28 Jun 2024 16:43:47 +0200 Subject: [PATCH 47/66] Add building to script --- dev/build-example-docs.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/dev/build-example-docs.py b/dev/build-example-docs.py index addb66906954..777c1cfed6aa 100644 --- a/dev/build-example-docs.py +++ b/dev/build-example-docs.py @@ -1,6 +1,7 @@ import os import shutil import re +import subprocess from pathlib import Path ROOT = os.path.abspath(os.path.join(os.path.dirname(__file__), "..")) @@ -186,8 +187,7 @@ def _main(): index_file.write("\n") - print(f"Done! Example index written to {INDEX}") - if __name__ == "__main__": _main() + subprocess.call(f"cd {ROOT}/examples/doc && make html", shell=True) From a169a59f32837689648a9233be2fa5e5dcdd210a Mon Sep 17 00:00:00 2001 From: Charles Beauville Date: Fri, 28 Jun 2024 16:45:18 +0200 Subject: [PATCH 48/66] Add keras link --- examples/advanced-tensorflow/README.md | 2 +- examples/quickstart-mlcube/README.md | 2 +- examples/simulation-tensorflow/README.md | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/examples/advanced-tensorflow/README.md b/examples/advanced-tensorflow/README.md index 7f9edcea3d0f..2b44baded43e 100644 --- a/examples/advanced-tensorflow/README.md +++ b/examples/advanced-tensorflow/README.md @@ -2,7 +2,7 @@ title: Advanced Flower Example using TensorFlow/Keras labels: [advanced, vision, fds] dataset: [CIFAR-10 | https://huggingface.co/datasets/uoft-cs/cifar10] -framework: [tensorflow | https://www.tensorflow.org/, Keras] +framework: [tensorflow | https://www.tensorflow.org/, Keras | https://keras.io/] --- # Advanced Flower Example (TensorFlow/Keras) diff --git a/examples/quickstart-mlcube/README.md b/examples/quickstart-mlcube/README.md index 49ae09b376f9..9f944cb9fdd8 100644 --- a/examples/quickstart-mlcube/README.md +++ b/examples/quickstart-mlcube/README.md @@ -2,7 +2,7 @@ title: Flower Example using TensorFlow/Keras + MLCube labels: [quickstart, vision, deployment] dataset: [MNIST | https://huggingface.co/datasets/ylecun/mnist] -framework: [tensorflow | https://www.tensorflow.org/, Keras] +framework: [tensorflow | https://www.tensorflow.org/, Keras | https://keras.io/] --- # Flower Example using TensorFlow/Keras + MLCube diff --git a/examples/simulation-tensorflow/README.md b/examples/simulation-tensorflow/README.md index 79da3dbedd13..2dc9a41cb959 100644 --- a/examples/simulation-tensorflow/README.md +++ b/examples/simulation-tensorflow/README.md @@ -2,7 +2,7 @@ title: Flower Simulation Example using TensorFlow/Keras labels: [basic, vision, fds, simulation] dataset: [MNIST | https://huggingface.co/datasets/ylecun/mnist] -framework: [tensorflow | https://www.tensorflow.org/, Keras] +framework: [tensorflow | https://www.tensorflow.org/, Keras | https://keras.io/] --- # Flower Simulation example using TensorFlow/Keras From bdd2ba922287008319ff1afb6262eea789d11b64 Mon Sep 17 00:00:00 2001 From: Charles Beauville Date: Fri, 28 Jun 2024 16:50:17 +0200 Subject: [PATCH 49/66] Update metadata --- examples/app-secure-aggregation/README.md | 2 +- examples/custom-metrics/README.md | 2 +- examples/custom-mods/README.md | 2 +- examples/embedded-devices/README.md | 2 +- examples/quickstart-pytorch-lightning/README.md | 2 +- examples/quickstart-tabnet/README.md | 2 +- 6 files changed, 6 insertions(+), 6 deletions(-) diff --git a/examples/app-secure-aggregation/README.md b/examples/app-secure-aggregation/README.md index d5b4bbc5dffd..e97fe0ab038f 100644 --- a/examples/app-secure-aggregation/README.md +++ b/examples/app-secure-aggregation/README.md @@ -2,7 +2,7 @@ title: Example Flower App with Secure Aggregation labels: [basic, vision, fds] dataset: [CIFAR-10 | https://huggingface.co/datasets/uoft-cs/cifar10] -framework: [numpy] +framework: [numpy | https://numpy.org/] --- # Secure aggregation with Flower (the SecAgg+ protocol) 🧪 diff --git a/examples/custom-metrics/README.md b/examples/custom-metrics/README.md index 92a5587528a1..e173d7d32703 100644 --- a/examples/custom-metrics/README.md +++ b/examples/custom-metrics/README.md @@ -2,7 +2,7 @@ title: Example Flower App with Custom Metrics labels: [basic, vision, fds] dataset: [CIFAR-10 | https://huggingface.co/datasets/uoft-cs/cifar10] -framework: [tensorflow] +framework: [tensorflow | https://www.tensorflow.org/] --- # Flower Example using Custom Metrics diff --git a/examples/custom-mods/README.md b/examples/custom-mods/README.md index 80d9ce1f9f11..ce83097c6675 100644 --- a/examples/custom-mods/README.md +++ b/examples/custom-mods/README.md @@ -2,7 +2,7 @@ title: Example Flower App with Custom Mods labels: [mods, monitoring, app] dataset: [CIFAR-10 | https://huggingface.co/datasets/uoft-cs/cifar10] -framework: [torch | https://pytorch.org/, wandb, tensorboard, torchvision | https://pytorch.org/vision/stable/index.html] +framework: [torch | https://pytorch.org/, wandb | https://wandb.ai/home, tensorboard | https://www.tensorflow.org/tensorboard?hl=fr, torchvision | https://pytorch.org/vision/stable/index.html] --- # Using custom mods 🧪 diff --git a/examples/embedded-devices/README.md b/examples/embedded-devices/README.md index d072bc4dbefd..a48bcfe4b8bd 100644 --- a/examples/embedded-devices/README.md +++ b/examples/embedded-devices/README.md @@ -2,7 +2,7 @@ title: Flower Embedded Devices Example labels: [basic, vision, fds] dataset: [CIFAR-10 | https://huggingface.co/datasets/uoft-cs/cifar10] -framework: [PyTorch, TensorFlow] +framework: [torch | https://pytorch.org/, tensorflow | https://www.tensorflow.org/] --- # Federated Learning on Embedded Devices with Flower diff --git a/examples/quickstart-pytorch-lightning/README.md b/examples/quickstart-pytorch-lightning/README.md index 7dc264bc72df..ec968a1d8d0a 100644 --- a/examples/quickstart-pytorch-lightning/README.md +++ b/examples/quickstart-pytorch-lightning/README.md @@ -2,7 +2,7 @@ title: Simple Flower Example using PyTorch-Lightning labels: [quickstart, vision, fds] dataset: [MNIST | https://huggingface.co/datasets/ylecun/mnist] -framework: [PyTorch-Lightning] +framework: [lightning | https://lightning.ai/docs/pytorch/stable/] --- # Flower Example using PyTorch Lightning diff --git a/examples/quickstart-tabnet/README.md b/examples/quickstart-tabnet/README.md index a6aff705c70d..13cddc2bc737 100644 --- a/examples/quickstart-tabnet/README.md +++ b/examples/quickstart-tabnet/README.md @@ -2,7 +2,7 @@ title: Simple Flower Example using Tabnet labels: [quickstart, tabular] dataset: [Iris | https://scikit-learn.org/stable/auto_examples/datasets/plot_iris_dataset.html] -framework: [tabnet] +framework: [tabnet | https://github.com/titu1994/tf-TabNet] --- # Flower TabNet Example using TensorFlow From 4d593ce3f5c141f565d449a77a7a6c5e632ba9fe Mon Sep 17 00:00:00 2001 From: Charles Beauville Date: Fri, 28 Jun 2024 16:51:40 +0200 Subject: [PATCH 50/66] Add metadata --- examples/llm-flowertune/README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/examples/llm-flowertune/README.md b/examples/llm-flowertune/README.md index 64490a0b7340..daf534f2f8c5 100644 --- a/examples/llm-flowertune/README.md +++ b/examples/llm-flowertune/README.md @@ -2,7 +2,7 @@ title: Federated LLM Fine-tuning with Flower labels: [llm, nlp, LLama2] dataset: [Alpaca-GPT4 | https://huggingface.co/datasets/vicgalle/alpaca-gpt4] -framework: [PEFT] +framework: [PEFT | https://huggingface.co/docs/peft/index] --- # LLM FlowerTune: Federated LLM Fine-tuning with Flower From 5ac931a0b62f498acf9b5d125a6eca57c591d82b Mon Sep 17 00:00:00 2001 From: Charles Beauville Date: Fri, 28 Jun 2024 16:53:30 +0200 Subject: [PATCH 51/66] Shorten mods --- examples/custom-mods/README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/examples/custom-mods/README.md b/examples/custom-mods/README.md index ce83097c6675..b9e1ff465c8a 100644 --- a/examples/custom-mods/README.md +++ b/examples/custom-mods/README.md @@ -2,7 +2,7 @@ title: Example Flower App with Custom Mods labels: [mods, monitoring, app] dataset: [CIFAR-10 | https://huggingface.co/datasets/uoft-cs/cifar10] -framework: [torch | https://pytorch.org/, wandb | https://wandb.ai/home, tensorboard | https://www.tensorflow.org/tensorboard?hl=fr, torchvision | https://pytorch.org/vision/stable/index.html] +framework: [wandb | https://wandb.ai/home, tensorboard | https://www.tensorflow.org/tensorboard?hl=fr] --- # Using custom mods 🧪 From 105c4e988b3faf5c96382905e03a701d1623a9c5 Mon Sep 17 00:00:00 2001 From: Charles Beauville Date: Fri, 28 Jun 2024 16:54:04 +0200 Subject: [PATCH 52/66] Remove locale --- examples/custom-mods/README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/examples/custom-mods/README.md b/examples/custom-mods/README.md index b9e1ff465c8a..7127a27975c5 100644 --- a/examples/custom-mods/README.md +++ b/examples/custom-mods/README.md @@ -2,7 +2,7 @@ title: Example Flower App with Custom Mods labels: [mods, monitoring, app] dataset: [CIFAR-10 | https://huggingface.co/datasets/uoft-cs/cifar10] -framework: [wandb | https://wandb.ai/home, tensorboard | https://www.tensorflow.org/tensorboard?hl=fr] +framework: [wandb | https://wandb.ai/home, tensorboard | https://www.tensorflow.org/tensorboard] --- # Using custom mods 🧪 From dd29d270ad97194cbd19974496c7bd4e3b89f44a Mon Sep 17 00:00:00 2001 From: Charles Beauville Date: Fri, 28 Jun 2024 17:01:14 +0200 Subject: [PATCH 53/66] Update metadata --- examples/android-kotlin/README.md | 2 +- examples/android/README.md | 2 +- examples/flower-via-docker-compose/README.md | 2 +- examples/ios/README.md | 2 +- examples/opacus/README.md | 2 +- examples/quickstart-cpp/README.md | 2 +- examples/whisper-federated-finetuning/README.md | 2 +- 7 files changed, 7 insertions(+), 7 deletions(-) diff --git a/examples/android-kotlin/README.md b/examples/android-kotlin/README.md index 7a3db21e0f17..e171cff2824b 100644 --- a/examples/android-kotlin/README.md +++ b/examples/android-kotlin/README.md @@ -2,7 +2,7 @@ title: Flower Android Example using Kotlin and TF Lite labels: [basic, vision, fds] dataset: [CIFAR-10 | https://huggingface.co/datasets/uoft-cs/cifar10] -framework: [Android, Kotlin, TensorFlowLite] +framework: [Android | https://www.android.com/, Kotlin | https://kotlinlang.org/, TensorFlowLite | https://www.tensorflow.org/lite] --- # Flower Android Client Example with Kotlin and TensorFlow Lite 2022 diff --git a/examples/android/README.md b/examples/android/README.md index e326ed9149a8..d8d9553f6270 100644 --- a/examples/android/README.md +++ b/examples/android/README.md @@ -2,7 +2,7 @@ title: Flower Android Example using Java and TF Lite labels: [basic, vision, fds] dataset: [CIFAR-10 | https://huggingface.co/datasets/uoft-cs/cifar10] -framework: [Android, Java, TensorFlowLite] +framework: [Android | https://www.android.com/, Java | https://www.java.com/, TensorFlowLite | https://www.tensorflow.org/lite] --- # Flower Android Example (TensorFlowLite) diff --git a/examples/flower-via-docker-compose/README.md b/examples/flower-via-docker-compose/README.md index e19ffa7b7e3e..abc3a0bee01f 100644 --- a/examples/flower-via-docker-compose/README.md +++ b/examples/flower-via-docker-compose/README.md @@ -2,7 +2,7 @@ title: Leveraging Flower and Docker for Device Heterogeneity Management in FL labels: [deployment, vision, tutorial] dataset: [CIFAR-10 | https://huggingface.co/datasets/uoft-cs/cifar10] -framework: [Docker] +framework: [Docker | https://www.docker.com/] --- # Leveraging Flower and Docker for Device Heterogeneity Management in Federated Learning diff --git a/examples/ios/README.md b/examples/ios/README.md index 787cc7f502fb..bb36a3f1729f 100644 --- a/examples/ios/README.md +++ b/examples/ios/README.md @@ -2,7 +2,7 @@ title: Simple Flower Example on iOS labels: [mobile, vision, fds] dataset: [MNIST | https://huggingface.co/datasets/ylecun/mnist] -framework: [swift] +framework: [Swift | https://www.swift.org/] --- # FLiOS - A Flower SDK for iOS Devices with Example diff --git a/examples/opacus/README.md b/examples/opacus/README.md index 8829a11f8ef4..2c586ccabaff 100644 --- a/examples/opacus/README.md +++ b/examples/opacus/README.md @@ -2,7 +2,7 @@ title: Sample-Level Differential Privacy using Opacus labels: [dp, security, fds] dataset: [CIFAR-10 | https://huggingface.co/datasets/uoft-cs/cifar10] -framework: [opacus, PyTorch] +framework: [opacus | https://opacus.ai/, torch | https://pytorch.org/] --- # Training with Sample-Level Differential Privacy using Opacus Privacy Engine diff --git a/examples/quickstart-cpp/README.md b/examples/quickstart-cpp/README.md index 2baf35616f24..7e79aa63b851 100644 --- a/examples/quickstart-cpp/README.md +++ b/examples/quickstart-cpp/README.md @@ -2,7 +2,7 @@ title: Simple Flower Example using C++ labels: [quickstart, linear regression, tabular] dataset: [Synthetic] -framework: [C++] +framework: [C++ | https://isocpp.org/] --- # Flower Clients in C++ (under development) diff --git a/examples/whisper-federated-finetuning/README.md b/examples/whisper-federated-finetuning/README.md index 3f3317b81bba..d6b86e2bde09 100644 --- a/examples/whisper-federated-finetuning/README.md +++ b/examples/whisper-federated-finetuning/README.md @@ -2,7 +2,7 @@ title: On-device Federated Finetuning for Speech Classification labels: [finetuning, speech, transformers] dataset: [SpeechCommands | https://huggingface.co/datasets/google/speech_commands] -framework: [huggingface, whisper] +framework: [transformers | https://huggingface.co/docs/transformers/index, whisper | https://huggingface.co/openai/whisper-tiny] --- # On-device Federated Finetuning for Speech Classification From 3f5f35aa54cbc931bce7b27f75da9d9e845e71c1 Mon Sep 17 00:00:00 2001 From: Charles Beauville Date: Sun, 30 Jun 2024 16:20:28 +0200 Subject: [PATCH 54/66] Format README files and update script --- dev/build-example-docs.py | 14 +++++++++---- examples/android-kotlin/README.md | 3 ++- examples/android/README.md | 3 ++- examples/embedded-devices/README.md | 20 +++++++++---------- .../federated-kaplan-meier-fitter/README.md | 3 ++- examples/fl-tabular/README.md | 2 +- examples/flower-in-30-minutes/README.md | 2 +- examples/flower-via-docker-compose/README.md | 18 ++++++++--------- examples/llm-flowertune/README.md | 6 +++--- examples/quickstart-jax/README.md | 2 +- examples/quickstart-mlcube/README.md | 2 +- examples/tensorflow-privacy/README.md | 2 +- examples/vertical-fl/README.md | 3 ++- examples/vit-finetune/README.md | 2 +- .../whisper-federated-finetuning/README.md | 9 +++++---- 15 files changed, 51 insertions(+), 40 deletions(-) diff --git a/dev/build-example-docs.py b/dev/build-example-docs.py index 777c1cfed6aa..3421b5b09c6b 100644 --- a/dev/build-example-docs.py +++ b/dev/build-example-docs.py @@ -65,12 +65,18 @@ def _read_metadata(example): labels = ( re.search(r"^labels:\s*\[(.+?)\]$", metadata, re.MULTILINE).group(1).strip() ) - dataset = _convert_to_link( - re.search(r"^dataset:\s*\[(.+?)\]$", metadata, re.MULTILINE).group(1).strip() + dataset = ( + re.search(r"^dataset:\s*\[(.+?)\]$", metadata, re.DOTALL | re.MULTILINE) + .group(1) + .strip() ) - framework = _convert_to_link( - re.search(r"^framework:\s*\[(.+?)\]$", metadata, re.MULTILINE).group(1).strip() + framework = ( + re.search(r"^framework:\s*\[(.+?)\]$", metadata, re.DOTALL | re.MULTILINE) + .group(1) + .strip() ) + dataset = _convert_to_link(re.sub(r"\s+", " ", dataset).strip()) + framework = _convert_to_link(re.sub(r"\s+", " ", framework).strip()) return title, labels, dataset, framework diff --git a/examples/android-kotlin/README.md b/examples/android-kotlin/README.md index e171cff2824b..28ca5565b64c 100644 --- a/examples/android-kotlin/README.md +++ b/examples/android-kotlin/README.md @@ -2,7 +2,8 @@ title: Flower Android Example using Kotlin and TF Lite labels: [basic, vision, fds] dataset: [CIFAR-10 | https://huggingface.co/datasets/uoft-cs/cifar10] -framework: [Android | https://www.android.com/, Kotlin | https://kotlinlang.org/, TensorFlowLite | https://www.tensorflow.org/lite] +framework: [Android | https://www.android.com/, Kotlin | https://kotlinlang.org/, + TensorFlowLite | https://www.tensorflow.org/lite] --- # Flower Android Client Example with Kotlin and TensorFlow Lite 2022 diff --git a/examples/android/README.md b/examples/android/README.md index d8d9553f6270..78c3d3a2c243 100644 --- a/examples/android/README.md +++ b/examples/android/README.md @@ -2,7 +2,8 @@ title: Flower Android Example using Java and TF Lite labels: [basic, vision, fds] dataset: [CIFAR-10 | https://huggingface.co/datasets/uoft-cs/cifar10] -framework: [Android | https://www.android.com/, Java | https://www.java.com/, TensorFlowLite | https://www.tensorflow.org/lite] +framework: [Android | https://www.android.com/, Java | https://www.java.com/, TensorFlowLite + | https://www.tensorflow.org/lite] --- # Flower Android Example (TensorFlowLite) diff --git a/examples/embedded-devices/README.md b/examples/embedded-devices/README.md index a48bcfe4b8bd..fd5a71dc0cbb 100644 --- a/examples/embedded-devices/README.md +++ b/examples/embedded-devices/README.md @@ -60,7 +60,7 @@ If you are working on this tutorial on your laptop or desktop, it can host the F - Click on the gear icon on the bottom right of the `Raspberry Pi Imager` window (the icon only appears after choosing your OS image). Here you can very conveniently set the username/password to access your device over ssh. You'll see I use as username `piubuntu` (you can choose something different) It's also the ideal place to select your WiFi network and add the password (this is of course not needed if you plan to connect the Raspberry Pi via ethernet). Click "save" when you are done. - Finally, click on `WRITE` to start flashing Ubuntu onto the uSD card. -2. **Connecting to your Rapsberry Pi** +1. **Connecting to your Rapsberry Pi** After `ssh`-ing into your Raspberry Pi for the first time, make sure your OS is up-to-date. @@ -68,7 +68,7 @@ If you are working on this tutorial on your laptop or desktop, it can host the F - And then: `sudo apt upgrade -y` to apply updates (this might take a few minutes on the RPi Zero) - Then reboot your RPi with `sudo reboot`. Then ssh into it again. -3. **Preparations for your Flower experiments** +1. **Preparations for your Flower experiments** - Install `pip`. In the terminal type: `sudo apt install python3-pip -y` - Now clone this directory. You just need to execute the `git clone` command shown at the top of this README.md on your device. @@ -92,7 +92,7 @@ If you are working on this tutorial on your laptop or desktop, it can host the F Please note using swap as if it was RAM comes with a large penalty in terms of data movement. -4. Run your Flower experiments following the steps in the [Running FL with Flower](https://github.com/adap/flower/tree/main/examples/embedded-devices#running-fl-training-with-flower) section. +1. Run your Flower experiments following the steps in the [Running FL with Flower](https://github.com/adap/flower/tree/main/examples/embedded-devices#running-fl-training-with-flower) section. ## Setting up a Jetson Xavier-NX @@ -104,9 +104,9 @@ If you are working on this tutorial on your laptop or desktop, it can host the F - Extract the image (~18GB and named `sd-blob.img`) and flash it onto the uSD card using [balenaEtcher](https://www.balena.io/etcher/) (or equivalent). -2. **Follow [the instructions](https://developer.nvidia.com/embedded/learn/get-started-jetson-xavier-nx-devkit) to set up the device.** The first time you boot your Xavier-NX you should plug it into a display to complete the installation process. After that, a display is no longer needed for this example but you could still use it instead of connecting to your device over ssh. +1. **Follow [the instructions](https://developer.nvidia.com/embedded/learn/get-started-jetson-xavier-nx-devkit) to set up the device.** The first time you boot your Xavier-NX you should plug it into a display to complete the installation process. After that, a display is no longer needed for this example but you could still use it instead of connecting to your device over ssh. -3. **Setup Docker**: Docker comes pre-installed with the Ubuntu image provided by NVIDIA. But for convenience, we will create a new user group and add our user to it (with the idea of not having to use `sudo` for every command involving docker (e.g. `docker run`, `docker ps`, etc)). More details about what this entails can be found in the [Docker documentation](https://docs.docker.com/engine/install/linux-postinstall/). You can achieve this by doing: +1. **Setup Docker**: Docker comes pre-installed with the Ubuntu image provided by NVIDIA. But for convenience, we will create a new user group and add our user to it (with the idea of not having to use `sudo` for every command involving docker (e.g. `docker run`, `docker ps`, etc)). More details about what this entails can be found in the [Docker documentation](https://docs.docker.com/engine/install/linux-postinstall/). You can achieve this by doing: ```bash sudo usermod -aG docker $USER @@ -114,7 +114,7 @@ If you are working on this tutorial on your laptop or desktop, it can host the F newgrp docker ``` -4. **Update OS and install utilities.** Then, install some useful utilities: +1. **Update OS and install utilities.** Then, install some useful utilities: ```bash sudo apt update && sudo apt upgrade -y @@ -148,7 +148,7 @@ If you are working on this tutorial on your laptop or desktop, it can host the F echo set -g mouse on > ~/.tmux.conf ``` -5. **Power modes**. The Jetson devices can operate at different power modes, each making use of more or less CPU cores clocked at different frequencies. The right power mode might very much depend on the application and scenario. When power consumption is not a limiting factor, we could use the highest 15W mode using all 6 CPU cores. On the other hand, if the devices are battery-powered we might want to make use of a low-power mode using 10W and 2 CPU cores. All the details regarding the different power modes of a Jetson Xavier-NX can be found [here](https://docs.nvidia.com/jetson/l4t/index.html#page/Tegra%2520Linux%2520Driver%2520Package%2520Development%2520Guide%2Fpower_management_jetson_xavier.html%23wwpID0E0NO0HA). For this demo, we'll be setting the device to high-performance mode: +1. **Power modes**. The Jetson devices can operate at different power modes, each making use of more or less CPU cores clocked at different frequencies. The right power mode might very much depend on the application and scenario. When power consumption is not a limiting factor, we could use the highest 15W mode using all 6 CPU cores. On the other hand, if the devices are battery-powered we might want to make use of a low-power mode using 10W and 2 CPU cores. All the details regarding the different power modes of a Jetson Xavier-NX can be found [here](https://docs.nvidia.com/jetson/l4t/index.html#page/Tegra%2520Linux%2520Driver%2520Package%2520Development%2520Guide%2Fpower_management_jetson_xavier.html%23wwpID0E0NO0HA). For this demo, we'll be setting the device to high-performance mode: ```bash sudo /usr/sbin/nvpmodel -m 2 # 15W with 6cpus @ 1.4GHz @@ -156,7 +156,7 @@ If you are working on this tutorial on your laptop or desktop, it can host the F Jetson Stats (that you launch via `jtop`) also allows you to see and set the power mode on your device. Navigate to the `CTRL` panel and click on one of the `NVM modes` available. -6. **Build base client image**. Before running a Flower client, we need to install `Flower` and other ML dependencies (i.e. Pytorch or Tensorflow). Instead of installing this manually via `pip3 install ...`, let's use the pre-built Docker images provided by NVIDIA. In this way, we can be confident that the ML infrastructure is optimized for these devices. Build your Flower client image with: +1. **Build base client image**. Before running a Flower client, we need to install `Flower` and other ML dependencies (i.e. Pytorch or Tensorflow). Instead of installing this manually via `pip3 install ...`, let's use the pre-built Docker images provided by NVIDIA. In this way, we can be confident that the ML infrastructure is optimized for these devices. Build your Flower client image with: ```bash # On your Jetson's terminal run @@ -172,7 +172,7 @@ If you are working on this tutorial on your laptop or desktop, it can host the F flower_client latest 87e935a8ee37 18 seconds ago 12.6GB ``` -7. **Access your client image**. Before launching the Flower client, we need to run the image we just created. To keep things simpler, let's run the image in interactive mode (`-it`), mount the entire repository you cloned inside the `/client` directory of your container (`` -v `pwd`:/client ``), and use the NVIDIA runtime so we can access the GPU `--runtime nvidia`: +1. **Access your client image**. Before launching the Flower client, we need to run the image we just created. To keep things simpler, let's run the image in interactive mode (`-it`), mount the entire repository you cloned inside the `/client` directory of your container (`` -v `pwd`:/client ``), and use the NVIDIA runtime so we can access the GPU `--runtime nvidia`: ```bash # first ensure you are in the `embedded-devices` directory. If you are not, use the `cd` command to navigate to it @@ -183,7 +183,7 @@ If you are working on this tutorial on your laptop or desktop, it can host the F root@6e6ce826b8bb:/client# ``` -8. **Run your FL experiments with Flower**. Follow the steps in the section below. +1. **Run your FL experiments with Flower**. Follow the steps in the section below. ## Running Embedded FL with Flower diff --git a/examples/federated-kaplan-meier-fitter/README.md b/examples/federated-kaplan-meier-fitter/README.md index 3a5f832eec20..5d0768d42ea6 100644 --- a/examples/federated-kaplan-meier-fitter/README.md +++ b/examples/federated-kaplan-meier-fitter/README.md @@ -1,7 +1,8 @@ --- title: Flower Example using KaplanMeierFitter labels: [estimator, medical] -dataset: [Waltons | https://lifelines.readthedocs.io/en/latest/lifelines.datasets.html#lifelines.datasets.load_waltons] +dataset: [Waltons | + https://lifelines.readthedocs.io/en/latest/lifelines.datasets.html#lifelines.datasets.load_waltons] framework: [lifelines | https://lifelines.readthedocs.io/en/latest/index.html] --- diff --git a/examples/fl-tabular/README.md b/examples/fl-tabular/README.md index 5e006dfe0e58..aa1250ee00d3 100644 --- a/examples/fl-tabular/README.md +++ b/examples/fl-tabular/README.md @@ -1,5 +1,5 @@ --- -title: Flower Example on Adult Census Income Tabular Dataset +title: Flower Example on Adult Census Income Tabular Dataset labels: [basic, tabular, fds] dataset: [Adult Census Income | https://www.kaggle.com/datasets/uciml/adult-census-income/data] framework: [scikit-learn | https://scikit-learn.org/] diff --git a/examples/flower-in-30-minutes/README.md b/examples/flower-in-30-minutes/README.md index e13921f8c2b2..d598694c7b56 100644 --- a/examples/flower-in-30-minutes/README.md +++ b/examples/flower-in-30-minutes/README.md @@ -1,5 +1,5 @@ --- -title: 30-minute tutorial running Flower simulation with PyTorch +title: 30-minute tutorial running Flower simulation with PyTorch labels: [colab, vision, simulation] dataset: [CIFAR-10 | https://huggingface.co/datasets/uoft-cs/cifar10] framework: [torch | https://pytorch.org/] diff --git a/examples/flower-via-docker-compose/README.md b/examples/flower-via-docker-compose/README.md index abc3a0bee01f..7e8958e5864b 100644 --- a/examples/flower-via-docker-compose/README.md +++ b/examples/flower-via-docker-compose/README.md @@ -1,5 +1,5 @@ --- -title: Leveraging Flower and Docker for Device Heterogeneity Management in FL +title: Leveraging Flower and Docker for Device Heterogeneity Management in FL labels: [deployment, vision, tutorial] dataset: [CIFAR-10 | https://huggingface.co/datasets/uoft-cs/cifar10] framework: [Docker | https://www.docker.com/] @@ -24,7 +24,7 @@ In this example, we tackle device heterogeneity in federated learning, arising f - **Cadvisor**: Collects comprehensive metrics from each Docker container. - **Prometheus**: Using `prometheus.yaml` for configuration, it scrapes data from Cadvisor at scheduled intervals, serving as a robust time-series database. Users can access the Prometheus UI at `http://localhost:9090` to create and run queries using PromQL, allowing for detailed insight into container performance. -2. **Mitigating Heterogeneity**: +1. **Mitigating Heterogeneity**: - In this basic use case, we address device heterogeneity by establishing rules tailored to each container's system capabilities. This involves modifying training parameters, such as batch sizes and learning rates, based on each device's memory capacity and CPU availability. These settings are specified in the `client_configs` array in the `create_docker_compose` script. For example: @@ -97,7 +97,7 @@ Within the script, specify the number of clients (`total_clients`) and resource - Run `docker-compose down` in another terminal if you are in the same directory. This command will stop and remove the containers, networks, and volumes created by `docker-compose up`. - Press `Ctrl+C` once in the terminal where `docker-compose up` is running. This will stop the containers but won't remove them or the networks and volumes they use. -2. **Services Startup**: +1. **Services Startup**: - Several services will automatically launch as defined in your `docker-compose.yml` file: @@ -130,7 +130,7 @@ Within the script, specify the number of clients (`total_clients`) and resource e9f4c9644a1c cadvisor 7.31% 32.14MiB / 500MiB 6.43% 139kB / 6.66MB 500kB / 0B 18 ``` -3. **Automated Grafana Configuration**: +1. **Automated Grafana Configuration**: - Grafana is configured to load pre-defined data sources and dashboards for immediate monitoring, facilitated by provisioning files. The provisioning files include `prometheus-datasource.yml` for data sources, located in the `./config/provisioning/datasources` directory, and `dashboard_index.json` for dashboards, in the `./config/provisioning/dashboards` directory. The `grafana.ini` file is also tailored to enhance user experience: - **Admin Credentials**: We provide default admin credentials in the `grafana.ini` configuration, which simplifies access by eliminating the need for users to go through the initial login process. @@ -138,7 +138,7 @@ Within the script, specify the number of clients (`total_clients`) and resource These files and settings are directly mounted into the Grafana container via Docker Compose volume mappings. This setup guarantees that upon startup, Grafana is pre-configured for monitoring, requiring no additional manual setup. -4. **Begin Training Process**: +1. **Begin Training Process**: - The federated learning training automatically begins once all client containers are successfully connected to the Flower server. This synchronizes the learning process across all participating clients. @@ -205,7 +205,7 @@ In addition to the standard metrics captured by cAdvisor, we have implemented a - We began by installing the `prometheus_client` library in our Python environment, enabling us to define and expose custom metrics that Prometheus can scrape. -2. **Defining Metrics in Server Script**: +1. **Defining Metrics in Server Script**: - Within our `server.py` script, we have established two key Prometheus Gauge metrics, specifically tailored for monitoring our federated learning model: `model_accuracy` and `model_loss`. These custom gauges are instrumental in capturing the most recent values of the model's accuracy and loss, which are essential metrics for evaluating the model's performance. The gauges are defined as follows: @@ -216,7 +216,7 @@ In addition to the standard metrics captured by cAdvisor, we have implemented a loss_gauge = Gauge('model_loss', 'Current loss of the global model') ``` -3. **Exposing Metrics via HTTP Endpoint**: +1. **Exposing Metrics via HTTP Endpoint**: - We leveraged the `start_http_server` function from the `prometheus_client` library to launch an HTTP server on port 8000. This server provides the `/metrics` endpoint, where the custom metrics are accessible for Prometheus scraping. The function is called at the end of the `main` method in `server.py`: @@ -224,7 +224,7 @@ In addition to the standard metrics captured by cAdvisor, we have implemented a start_http_server(8000) ``` -4. **Updating Metrics Recording Strategy**: +1. **Updating Metrics Recording Strategy**: - The core of our metrics tracking lies in the `strategy.py` file, particularly within the `aggregate_evaluate` method. This method is crucial as it's where the federated learning model's accuracy and loss values are computed after each round of training with the aggregated data from all clients. @@ -233,7 +233,7 @@ In addition to the standard metrics captured by cAdvisor, we have implemented a self.loss_gauge.set(loss_aggregated) ``` -5. **Configuring Prometheus Scraping**: +1. **Configuring Prometheus Scraping**: - In the `prometheus.yml` file, under `scrape_configs`, we configured a new job to scrape the custom metrics from the HTTP server. This setup includes the job's name, the scraping interval, and the target server's URL. diff --git a/examples/llm-flowertune/README.md b/examples/llm-flowertune/README.md index daf534f2f8c5..eaf6e3c1a2df 100644 --- a/examples/llm-flowertune/README.md +++ b/examples/llm-flowertune/README.md @@ -1,5 +1,5 @@ --- -title: Federated LLM Fine-tuning with Flower +title: Federated LLM Fine-tuning with Flower labels: [llm, nlp, LLama2] dataset: [Alpaca-GPT4 | https://huggingface.co/datasets/vicgalle/alpaca-gpt4] framework: [PEFT | https://huggingface.co/docs/peft/index] @@ -127,7 +127,7 @@ Please follow the steps below: ```bash flower-superlink --insecure ``` -2. Start the long-running Flower client (SuperNode) +1. Start the long-running Flower client (SuperNode) ```bash # In a new terminal window, start the first long-running Flower client: flower-client-app app:client1 --insecure @@ -136,7 +136,7 @@ Please follow the steps below: # In another new terminal window, start the second long-running Flower client: flower-client-app app:client2 --insecure ``` -3. Run the Flower App +1. Run the Flower App ```bash # With both the long-running server (SuperLink) and two clients (SuperNode) up and running, # we can now run the actual Flower App: diff --git a/examples/quickstart-jax/README.md b/examples/quickstart-jax/README.md index 9c14db21199e..5d9939a2b4fb 100644 --- a/examples/quickstart-jax/README.md +++ b/examples/quickstart-jax/README.md @@ -2,7 +2,7 @@ title: Simple Flower Example using Jax labels: [quickstart, linear regression] dataset: [Synthetic] -framework: ["JAX | https://jax.readthedocs.io/en/latest/"] +framework: [JAX | https://jax.readthedocs.io/en/latest/] --- # JAX: From Centralized To Federated diff --git a/examples/quickstart-mlcube/README.md b/examples/quickstart-mlcube/README.md index 9f944cb9fdd8..a2e989e6804b 100644 --- a/examples/quickstart-mlcube/README.md +++ b/examples/quickstart-mlcube/README.md @@ -1,5 +1,5 @@ --- -title: Flower Example using TensorFlow/Keras + MLCube +title: Flower Example using TensorFlow/Keras + MLCube labels: [quickstart, vision, deployment] dataset: [MNIST | https://huggingface.co/datasets/ylecun/mnist] framework: [tensorflow | https://www.tensorflow.org/, Keras | https://keras.io/] diff --git a/examples/tensorflow-privacy/README.md b/examples/tensorflow-privacy/README.md index b0b7ec0fab3e..48ed4594edac 100644 --- a/examples/tensorflow-privacy/README.md +++ b/examples/tensorflow-privacy/README.md @@ -1,5 +1,5 @@ --- -title: Sample-Level DP using TensorFlow-Privacy Engine +title: Sample-Level DP using TensorFlow-Privacy Engine labels: [basic, vision, fds, privacy, dp] dataset: [MNIST | https://huggingface.co/datasets/ylecun/mnist] framework: [tensorflow | https://www.tensorflow.org/] diff --git a/examples/vertical-fl/README.md b/examples/vertical-fl/README.md index 3c29e1babcdf..30b38e59c619 100644 --- a/examples/vertical-fl/README.md +++ b/examples/vertical-fl/README.md @@ -2,7 +2,8 @@ title: Vertical FL Flower Example labels: [vertical, tabular, advanced] dataset: [Titanic | https://www.kaggle.com/competitions/titanic] -framework: [torch | https://pytorch.org/, pandas | https://pandas.pydata.org/, scikit-learn | https://scikit-learn.org/] +framework: [torch | https://pytorch.org/, pandas | https://pandas.pydata.org/, scikit-learn + | https://scikit-learn.org/] --- # Vertical Federated Learning example diff --git a/examples/vit-finetune/README.md b/examples/vit-finetune/README.md index 5a544d84b9fa..3ef38aca5773 100644 --- a/examples/vit-finetune/README.md +++ b/examples/vit-finetune/README.md @@ -1,5 +1,5 @@ --- -title: Federated finetuning of a ViT +title: Federated finetuning of a ViT labels: [finetuneing, vision, fds] dataset: [Oxford Flower-102 | https://www.robots.ox.ac.uk/~vgg/data/flowers/102/] framework: [torch | https://pytorch.org/, torchvision | https://pytorch.org/vision/stable/index.html] diff --git a/examples/whisper-federated-finetuning/README.md b/examples/whisper-federated-finetuning/README.md index d6b86e2bde09..1d35fc08dea3 100644 --- a/examples/whisper-federated-finetuning/README.md +++ b/examples/whisper-federated-finetuning/README.md @@ -2,7 +2,8 @@ title: On-device Federated Finetuning for Speech Classification labels: [finetuning, speech, transformers] dataset: [SpeechCommands | https://huggingface.co/datasets/google/speech_commands] -framework: [transformers | https://huggingface.co/docs/transformers/index, whisper | https://huggingface.co/openai/whisper-tiny] +framework: [transformers | https://huggingface.co/docs/transformers/index, whisper + | https://huggingface.co/openai/whisper-tiny] --- # On-device Federated Finetuning for Speech Classification @@ -113,9 +114,9 @@ print(len(ids)) An overview of the FL pipeline built with Flower for this example is illustrated above. 1. At the start of a round, the server communicates the classification head to a fraction of the clients. At round #0, the classification head is randomly intialised. -2. Each client, using a frozen pre-trained Whisper encoder, trains the classification head using its own data samples. -3. Once on-site training is completed, each client sends back the (now updated) classification head to the Flower server. -4. The Flower server aggregates (via FedAvg) the classification heads in order to obtain a new _global_ classification head. This head will be shared with clients in the next round. +1. Each client, using a frozen pre-trained Whisper encoder, trains the classification head using its own data samples. +1. Once on-site training is completed, each client sends back the (now updated) classification head to the Flower server. +1. The Flower server aggregates (via FedAvg) the classification heads in order to obtain a new _global_ classification head. This head will be shared with clients in the next round. Flower supports two ways of doing Federated Learning: simulated and non-simulated FL. The former, managed by the [`VirtualClientEngine`](https://flower.ai/docs/framework/how-to-run-simulations.html), allows you to run large-scale workloads in a system-aware manner, that scales with the resources available on your system (whether it is a laptop, a desktop with a single GPU, or a cluster of GPU servers). The latter is better suited for settings where clients are unique devices (e.g. a server, a smart device, etc). This example shows you how to use both. From 1b8f4360b29775d20a7557a8e7be5741f842b45b Mon Sep 17 00:00:00 2001 From: Charles Beauville Date: Sun, 30 Jun 2024 16:21:42 +0200 Subject: [PATCH 55/66] Update build-docs script --- dev/build-docs.sh | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/dev/build-docs.sh b/dev/build-docs.sh index f8d4f91508de..f4bf958b0ebf 100755 --- a/dev/build-docs.sh +++ b/dev/build-docs.sh @@ -8,9 +8,7 @@ cd $ROOT ./dev/build-baseline-docs.sh cd $ROOT -./dev/update-examples.sh -cd examples/doc -make docs +python dev/build-example-docs.py cd $ROOT ./datasets/dev/build-flwr-datasets-docs.sh From 6f4dd4e4499e8ed306900b4718a2680533df7ae4 Mon Sep 17 00:00:00 2001 From: Charles Beauville Date: Sun, 30 Jun 2024 16:34:42 +0200 Subject: [PATCH 56/66] Use numbers --- examples/embedded-devices/README.md | 20 +++++++++---------- examples/flower-via-docker-compose/README.md | 16 +++++++-------- examples/llm-flowertune/README.md | 4 ++-- .../whisper-federated-finetuning/README.md | 6 +++--- 4 files changed, 23 insertions(+), 23 deletions(-) diff --git a/examples/embedded-devices/README.md b/examples/embedded-devices/README.md index fd5a71dc0cbb..a48bcfe4b8bd 100644 --- a/examples/embedded-devices/README.md +++ b/examples/embedded-devices/README.md @@ -60,7 +60,7 @@ If you are working on this tutorial on your laptop or desktop, it can host the F - Click on the gear icon on the bottom right of the `Raspberry Pi Imager` window (the icon only appears after choosing your OS image). Here you can very conveniently set the username/password to access your device over ssh. You'll see I use as username `piubuntu` (you can choose something different) It's also the ideal place to select your WiFi network and add the password (this is of course not needed if you plan to connect the Raspberry Pi via ethernet). Click "save" when you are done. - Finally, click on `WRITE` to start flashing Ubuntu onto the uSD card. -1. **Connecting to your Rapsberry Pi** +2. **Connecting to your Rapsberry Pi** After `ssh`-ing into your Raspberry Pi for the first time, make sure your OS is up-to-date. @@ -68,7 +68,7 @@ If you are working on this tutorial on your laptop or desktop, it can host the F - And then: `sudo apt upgrade -y` to apply updates (this might take a few minutes on the RPi Zero) - Then reboot your RPi with `sudo reboot`. Then ssh into it again. -1. **Preparations for your Flower experiments** +3. **Preparations for your Flower experiments** - Install `pip`. In the terminal type: `sudo apt install python3-pip -y` - Now clone this directory. You just need to execute the `git clone` command shown at the top of this README.md on your device. @@ -92,7 +92,7 @@ If you are working on this tutorial on your laptop or desktop, it can host the F Please note using swap as if it was RAM comes with a large penalty in terms of data movement. -1. Run your Flower experiments following the steps in the [Running FL with Flower](https://github.com/adap/flower/tree/main/examples/embedded-devices#running-fl-training-with-flower) section. +4. Run your Flower experiments following the steps in the [Running FL with Flower](https://github.com/adap/flower/tree/main/examples/embedded-devices#running-fl-training-with-flower) section. ## Setting up a Jetson Xavier-NX @@ -104,9 +104,9 @@ If you are working on this tutorial on your laptop or desktop, it can host the F - Extract the image (~18GB and named `sd-blob.img`) and flash it onto the uSD card using [balenaEtcher](https://www.balena.io/etcher/) (or equivalent). -1. **Follow [the instructions](https://developer.nvidia.com/embedded/learn/get-started-jetson-xavier-nx-devkit) to set up the device.** The first time you boot your Xavier-NX you should plug it into a display to complete the installation process. After that, a display is no longer needed for this example but you could still use it instead of connecting to your device over ssh. +2. **Follow [the instructions](https://developer.nvidia.com/embedded/learn/get-started-jetson-xavier-nx-devkit) to set up the device.** The first time you boot your Xavier-NX you should plug it into a display to complete the installation process. After that, a display is no longer needed for this example but you could still use it instead of connecting to your device over ssh. -1. **Setup Docker**: Docker comes pre-installed with the Ubuntu image provided by NVIDIA. But for convenience, we will create a new user group and add our user to it (with the idea of not having to use `sudo` for every command involving docker (e.g. `docker run`, `docker ps`, etc)). More details about what this entails can be found in the [Docker documentation](https://docs.docker.com/engine/install/linux-postinstall/). You can achieve this by doing: +3. **Setup Docker**: Docker comes pre-installed with the Ubuntu image provided by NVIDIA. But for convenience, we will create a new user group and add our user to it (with the idea of not having to use `sudo` for every command involving docker (e.g. `docker run`, `docker ps`, etc)). More details about what this entails can be found in the [Docker documentation](https://docs.docker.com/engine/install/linux-postinstall/). You can achieve this by doing: ```bash sudo usermod -aG docker $USER @@ -114,7 +114,7 @@ If you are working on this tutorial on your laptop or desktop, it can host the F newgrp docker ``` -1. **Update OS and install utilities.** Then, install some useful utilities: +4. **Update OS and install utilities.** Then, install some useful utilities: ```bash sudo apt update && sudo apt upgrade -y @@ -148,7 +148,7 @@ If you are working on this tutorial on your laptop or desktop, it can host the F echo set -g mouse on > ~/.tmux.conf ``` -1. **Power modes**. The Jetson devices can operate at different power modes, each making use of more or less CPU cores clocked at different frequencies. The right power mode might very much depend on the application and scenario. When power consumption is not a limiting factor, we could use the highest 15W mode using all 6 CPU cores. On the other hand, if the devices are battery-powered we might want to make use of a low-power mode using 10W and 2 CPU cores. All the details regarding the different power modes of a Jetson Xavier-NX can be found [here](https://docs.nvidia.com/jetson/l4t/index.html#page/Tegra%2520Linux%2520Driver%2520Package%2520Development%2520Guide%2Fpower_management_jetson_xavier.html%23wwpID0E0NO0HA). For this demo, we'll be setting the device to high-performance mode: +5. **Power modes**. The Jetson devices can operate at different power modes, each making use of more or less CPU cores clocked at different frequencies. The right power mode might very much depend on the application and scenario. When power consumption is not a limiting factor, we could use the highest 15W mode using all 6 CPU cores. On the other hand, if the devices are battery-powered we might want to make use of a low-power mode using 10W and 2 CPU cores. All the details regarding the different power modes of a Jetson Xavier-NX can be found [here](https://docs.nvidia.com/jetson/l4t/index.html#page/Tegra%2520Linux%2520Driver%2520Package%2520Development%2520Guide%2Fpower_management_jetson_xavier.html%23wwpID0E0NO0HA). For this demo, we'll be setting the device to high-performance mode: ```bash sudo /usr/sbin/nvpmodel -m 2 # 15W with 6cpus @ 1.4GHz @@ -156,7 +156,7 @@ If you are working on this tutorial on your laptop or desktop, it can host the F Jetson Stats (that you launch via `jtop`) also allows you to see and set the power mode on your device. Navigate to the `CTRL` panel and click on one of the `NVM modes` available. -1. **Build base client image**. Before running a Flower client, we need to install `Flower` and other ML dependencies (i.e. Pytorch or Tensorflow). Instead of installing this manually via `pip3 install ...`, let's use the pre-built Docker images provided by NVIDIA. In this way, we can be confident that the ML infrastructure is optimized for these devices. Build your Flower client image with: +6. **Build base client image**. Before running a Flower client, we need to install `Flower` and other ML dependencies (i.e. Pytorch or Tensorflow). Instead of installing this manually via `pip3 install ...`, let's use the pre-built Docker images provided by NVIDIA. In this way, we can be confident that the ML infrastructure is optimized for these devices. Build your Flower client image with: ```bash # On your Jetson's terminal run @@ -172,7 +172,7 @@ If you are working on this tutorial on your laptop or desktop, it can host the F flower_client latest 87e935a8ee37 18 seconds ago 12.6GB ``` -1. **Access your client image**. Before launching the Flower client, we need to run the image we just created. To keep things simpler, let's run the image in interactive mode (`-it`), mount the entire repository you cloned inside the `/client` directory of your container (`` -v `pwd`:/client ``), and use the NVIDIA runtime so we can access the GPU `--runtime nvidia`: +7. **Access your client image**. Before launching the Flower client, we need to run the image we just created. To keep things simpler, let's run the image in interactive mode (`-it`), mount the entire repository you cloned inside the `/client` directory of your container (`` -v `pwd`:/client ``), and use the NVIDIA runtime so we can access the GPU `--runtime nvidia`: ```bash # first ensure you are in the `embedded-devices` directory. If you are not, use the `cd` command to navigate to it @@ -183,7 +183,7 @@ If you are working on this tutorial on your laptop or desktop, it can host the F root@6e6ce826b8bb:/client# ``` -1. **Run your FL experiments with Flower**. Follow the steps in the section below. +8. **Run your FL experiments with Flower**. Follow the steps in the section below. ## Running Embedded FL with Flower diff --git a/examples/flower-via-docker-compose/README.md b/examples/flower-via-docker-compose/README.md index 7e8958e5864b..4c5e2acddce3 100644 --- a/examples/flower-via-docker-compose/README.md +++ b/examples/flower-via-docker-compose/README.md @@ -24,7 +24,7 @@ In this example, we tackle device heterogeneity in federated learning, arising f - **Cadvisor**: Collects comprehensive metrics from each Docker container. - **Prometheus**: Using `prometheus.yaml` for configuration, it scrapes data from Cadvisor at scheduled intervals, serving as a robust time-series database. Users can access the Prometheus UI at `http://localhost:9090` to create and run queries using PromQL, allowing for detailed insight into container performance. -1. **Mitigating Heterogeneity**: +2. **Mitigating Heterogeneity**: - In this basic use case, we address device heterogeneity by establishing rules tailored to each container's system capabilities. This involves modifying training parameters, such as batch sizes and learning rates, based on each device's memory capacity and CPU availability. These settings are specified in the `client_configs` array in the `create_docker_compose` script. For example: @@ -97,7 +97,7 @@ Within the script, specify the number of clients (`total_clients`) and resource - Run `docker-compose down` in another terminal if you are in the same directory. This command will stop and remove the containers, networks, and volumes created by `docker-compose up`. - Press `Ctrl+C` once in the terminal where `docker-compose up` is running. This will stop the containers but won't remove them or the networks and volumes they use. -1. **Services Startup**: +2. **Services Startup**: - Several services will automatically launch as defined in your `docker-compose.yml` file: @@ -130,7 +130,7 @@ Within the script, specify the number of clients (`total_clients`) and resource e9f4c9644a1c cadvisor 7.31% 32.14MiB / 500MiB 6.43% 139kB / 6.66MB 500kB / 0B 18 ``` -1. **Automated Grafana Configuration**: +3. **Automated Grafana Configuration**: - Grafana is configured to load pre-defined data sources and dashboards for immediate monitoring, facilitated by provisioning files. The provisioning files include `prometheus-datasource.yml` for data sources, located in the `./config/provisioning/datasources` directory, and `dashboard_index.json` for dashboards, in the `./config/provisioning/dashboards` directory. The `grafana.ini` file is also tailored to enhance user experience: - **Admin Credentials**: We provide default admin credentials in the `grafana.ini` configuration, which simplifies access by eliminating the need for users to go through the initial login process. @@ -138,7 +138,7 @@ Within the script, specify the number of clients (`total_clients`) and resource These files and settings are directly mounted into the Grafana container via Docker Compose volume mappings. This setup guarantees that upon startup, Grafana is pre-configured for monitoring, requiring no additional manual setup. -1. **Begin Training Process**: +4. **Begin Training Process**: - The federated learning training automatically begins once all client containers are successfully connected to the Flower server. This synchronizes the learning process across all participating clients. @@ -205,7 +205,7 @@ In addition to the standard metrics captured by cAdvisor, we have implemented a - We began by installing the `prometheus_client` library in our Python environment, enabling us to define and expose custom metrics that Prometheus can scrape. -1. **Defining Metrics in Server Script**: +2. **Defining Metrics in Server Script**: - Within our `server.py` script, we have established two key Prometheus Gauge metrics, specifically tailored for monitoring our federated learning model: `model_accuracy` and `model_loss`. These custom gauges are instrumental in capturing the most recent values of the model's accuracy and loss, which are essential metrics for evaluating the model's performance. The gauges are defined as follows: @@ -216,7 +216,7 @@ In addition to the standard metrics captured by cAdvisor, we have implemented a loss_gauge = Gauge('model_loss', 'Current loss of the global model') ``` -1. **Exposing Metrics via HTTP Endpoint**: +3. **Exposing Metrics via HTTP Endpoint**: - We leveraged the `start_http_server` function from the `prometheus_client` library to launch an HTTP server on port 8000. This server provides the `/metrics` endpoint, where the custom metrics are accessible for Prometheus scraping. The function is called at the end of the `main` method in `server.py`: @@ -224,7 +224,7 @@ In addition to the standard metrics captured by cAdvisor, we have implemented a start_http_server(8000) ``` -1. **Updating Metrics Recording Strategy**: +4. **Updating Metrics Recording Strategy**: - The core of our metrics tracking lies in the `strategy.py` file, particularly within the `aggregate_evaluate` method. This method is crucial as it's where the federated learning model's accuracy and loss values are computed after each round of training with the aggregated data from all clients. @@ -233,7 +233,7 @@ In addition to the standard metrics captured by cAdvisor, we have implemented a self.loss_gauge.set(loss_aggregated) ``` -1. **Configuring Prometheus Scraping**: +5. **Configuring Prometheus Scraping**: - In the `prometheus.yml` file, under `scrape_configs`, we configured a new job to scrape the custom metrics from the HTTP server. This setup includes the job's name, the scraping interval, and the target server's URL. diff --git a/examples/llm-flowertune/README.md b/examples/llm-flowertune/README.md index eaf6e3c1a2df..9b6fe31c437a 100644 --- a/examples/llm-flowertune/README.md +++ b/examples/llm-flowertune/README.md @@ -127,7 +127,7 @@ Please follow the steps below: ```bash flower-superlink --insecure ``` -1. Start the long-running Flower client (SuperNode) +2. Start the long-running Flower client (SuperNode) ```bash # In a new terminal window, start the first long-running Flower client: flower-client-app app:client1 --insecure @@ -136,7 +136,7 @@ Please follow the steps below: # In another new terminal window, start the second long-running Flower client: flower-client-app app:client2 --insecure ``` -1. Run the Flower App +3. Run the Flower App ```bash # With both the long-running server (SuperLink) and two clients (SuperNode) up and running, # we can now run the actual Flower App: diff --git a/examples/whisper-federated-finetuning/README.md b/examples/whisper-federated-finetuning/README.md index 1d35fc08dea3..1a79e581016f 100644 --- a/examples/whisper-federated-finetuning/README.md +++ b/examples/whisper-federated-finetuning/README.md @@ -114,9 +114,9 @@ print(len(ids)) An overview of the FL pipeline built with Flower for this example is illustrated above. 1. At the start of a round, the server communicates the classification head to a fraction of the clients. At round #0, the classification head is randomly intialised. -1. Each client, using a frozen pre-trained Whisper encoder, trains the classification head using its own data samples. -1. Once on-site training is completed, each client sends back the (now updated) classification head to the Flower server. -1. The Flower server aggregates (via FedAvg) the classification heads in order to obtain a new _global_ classification head. This head will be shared with clients in the next round. +2. Each client, using a frozen pre-trained Whisper encoder, trains the classification head using its own data samples. +3. Once on-site training is completed, each client sends back the (now updated) classification head to the Flower server. +4. The Flower server aggregates (via FedAvg) the classification heads in order to obtain a new _global_ classification head. This head will be shared with clients in the next round. Flower supports two ways of doing Federated Learning: simulated and non-simulated FL. The former, managed by the [`VirtualClientEngine`](https://flower.ai/docs/framework/how-to-run-simulations.html), allows you to run large-scale workloads in a system-aware manner, that scales with the resources available on your system (whether it is a laptop, a desktop with a single GPU, or a cluster of GPU servers). The latter is better suited for settings where clients are unique devices (e.g. a server, a smart device, etc). This example shows you how to use both. From b2fd5150691fdb67b23fcda14f021ccee9a0c3ab Mon Sep 17 00:00:00 2001 From: Charles Beauville Date: Sun, 30 Jun 2024 16:50:11 +0200 Subject: [PATCH 57/66] Remove deprecated script --- dev/build-example-docs.sh | 227 -------------------------------------- 1 file changed, 227 deletions(-) delete mode 100755 dev/build-example-docs.sh diff --git a/dev/build-example-docs.sh b/dev/build-example-docs.sh deleted file mode 100755 index aadede27a010..000000000000 --- a/dev/build-example-docs.sh +++ /dev/null @@ -1,227 +0,0 @@ -#!/bin/bash -set -e -cd "$( cd "$( dirname "${BASH_SOURCE[0]}" )" >/dev/null 2>&1 && pwd )"/../ - -ROOT=`pwd` -INDEX=$ROOT/examples/doc/source/index.rst -INSERT_LINE=6 - -table_text=$(cat <<-END -.. toctree:: - :maxdepth: 1 - :caption: Projects -END -) - -function add_table_entry () -{ - local example="$1" - local label="$2" - local table_var="$3" - - # extract lines from markdown file between --- and ---, preserving newlines and store in variable called metadata - metadata=$(awk '/^---$/{flag=1; next} flag; /^---$/{exit}' $example/README.md) - - # get text after "title:" in metadata using sed - title=$(echo "$metadata" | sed -n 's/title: //p') - - # get text after "labels:" in metadata using sed - labels=$(echo "$metadata" | sed -n 's/labels: //p' | sed 's/\[//g; s/\]//g') - - # get text after "dataset:" in metadata using sed - dataset=$(echo "$metadata" | sed -n 's/dataset: //p' | sed 's/\[//g; s/\]//g') - - framework=$(echo "$metadata" | sed -n 's/framework: //p' | sed 's/\[//g; s/\]//g') - - table_entry=" * - \`$title <$example.html>\`_ \n - $framework \n - $dataset \n - $labels\n\n" - - if [[ "$labels" == *"$label"* ]]; then - eval "$table_var+=\$table_entry" - return 0 - fi - return 1 -} - -copy_markdown_files () { - for file in $1/*.md; do - # Copy the README into the source of the Example docs as the name of the example - if [[ $(basename "$file") = "README.md" ]]; then - cp $file $ROOT/examples/doc/source/$1.md 2>&1 >/dev/null - else - # If the example contains other markdown files, copy them to the source of the Example docs - cp $file $ROOT/examples/doc/source/$(basename "$file") 2>&1 >/dev/null - fi - done -} - -add_gh_button () { - gh_text="[\"View](https://github.com/adap/flower/blob/main/examples/$1)" - readme_file="$ROOT/examples/doc/source/$1.md" - - if ! grep -Fq "$gh_text" "$readme_file"; then - awk -v text="$gh_text" ' - /^# / && !found { - print $0 "\n" text; - found=1; - next; - } - { print } - ' "$readme_file" > tmpfile && mv tmpfile "$readme_file" - fi -} - -copy_images () { - if [ -d "$1/_static" ]; then - cp $1/_static/**.{jpg,png,jpeg} $ROOT/examples/doc/source/_static/ 2>/dev/null || true - fi -} - -add_to_index () { - echo " $1" >> $INDEX -} - -add_single_entry () { - # Copy markdown files to correct folder - copy_markdown_files $1 - - # Add button linked to GitHub - add_gh_button $1 - - # Copy all images of the _static folder into the examples - # docs static folder - copy_images $1 - - # Insert the name of the example into the index file - add_to_index $1 -} - -add_all_entries () { - cd $ROOT/examples - # Iterate through each folder in examples/ - for d in $(printf '%s\n' */ | sort -V); do - # Add entry based on the name of the folder - example=${d%/} - - if [[ $example != doc ]]; then - add_single_entry $example - fi - done -} - -# Clean up before starting -rm -f $ROOT/examples/doc/source/*.md -rm -f $INDEX - -# Create empty index file -touch $INDEX - -initial_text=$(cat <<-END -Flower Examples Documentation ------------------------------ - -Welcome to Flower Examples' documentation. \`Flower \`_ is a friendly federated learning framework. - - -Join the Flower Community -------------------------- - -The Flower Community is growing quickly - we're a friendly group of researchers, engineers, students, professionals, academics, and other enthusiasts. - -.. button-link:: https://flower.ai/join-slack - :color: primary - :shadow: - - Join us on Slack - - -Quickstart Examples -------------------- - -Flower Quickstart Examples are a collection of demo project that show how you can use Flower in combination with other existing frameworks or technologies. - -END -) - -echo "$initial_text" >> $INDEX - -# Table headers -quickstart_table="\n.. list-table::\n :widths: 50 15 15 15\n :header-rows: 1\n\n * - Title\n - Framework\n - Dataset\n - Tags\n\n" -comprehensive_table="\n.. list-table::\n :widths: 50 15 15 15\n :header-rows: 1\n\n * - Title\n - Framework\n - Dataset\n - Tags\n\n" -advanced_table="\n.. list-table::\n :widths: 50 15 15 15\n :header-rows: 1\n\n * - Title\n - Framework\n - Dataset\n - Tags\n\n" -other_table="\n.. list-table::\n :widths: 50 15 15 15\n :header-rows: 1\n\n * - Title\n - Framework\n - Dataset\n - Tags\n\n" - -cd $ROOT/examples -# Iterate through each folder in examples/ -for d in $(printf '%s\n' */ | sort -V); do - # Add entry based on the name of the folder - example=${d%/} - - if [[ $example != doc ]]; then - # Copy markdown files to correct folder - copy_markdown_files $example - - # Add button linked to GitHub - add_gh_button $example - - # Copy all images of the _static folder into the examples - # docs static folder - copy_images $example - - # Add entry to the appropriate table - if ! add_table_entry $example "quickstart" quickstart_table; then - if ! add_table_entry $example "comprehensive" comprehensive_table; then - if ! add_table_entry $example "advanced" advanced_table; then - add_table_entry $example "" other_table - fi - fi - fi - fi -done - -# Add the tables to the index -echo -e "$quickstart_table" >> $INDEX - -tmp_text=$(cat <<-END -Comprehensive Examples ----------------------- - -Comprehensive example allow us to explore certain topics more in-depth and are often associated with a simpler, less detailed, example. - -END -) -echo -e "$tmp_text" >> $INDEX - -echo -e "$comprehensive_table" >> $INDEX - -tmp_text=$(cat <<-END -Advanced Examples ------------------ - -Advanced Examples are mostly for users that are both familiar with Federated Learning but also somewhat familiar with Flower\'s main features. - -END -) -echo -e "$tmp_text" >> $INDEX - -echo -e "$advanced_table" >> $INDEX - -tmp_text=$(cat <<-END -Other Examples --------------- - -Flower Examples are a collection of example projects written with Flower that explore different domains and features. You can check which examples already exist and/or contribute your own example. - -END -) -echo -e "$tmp_text" >> $INDEX - -echo -e "$other_table" >> $INDEX - -echo "" >> $INDEX -echo "$table_text" >> $INDEX -echo "" >> $INDEX - -add_all_entries - -echo "" >> $INDEX - From dd557361f59516ef9bfae5a1e98fe090772af0c9 Mon Sep 17 00:00:00 2001 From: Charles Beauville Date: Sun, 30 Jun 2024 16:55:19 +0200 Subject: [PATCH 58/66] Add copyright notice and reformat --- dev/build-example-docs.py | 26 ++++++++++++++++++++++++-- 1 file changed, 24 insertions(+), 2 deletions(-) diff --git a/dev/build-example-docs.py b/dev/build-example-docs.py index 3421b5b09c6b..e684ab8194a7 100644 --- a/dev/build-example-docs.py +++ b/dev/build-example-docs.py @@ -1,3 +1,19 @@ +# Copyright 2024 Flower Labs GmbH. All Rights Reserved. +# +# 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. +# ============================================================================== +"""Build the Flower Example docs.""" + import os import shutil import re @@ -34,7 +50,10 @@ """ -table_headers = "\n.. list-table::\n :widths: 50 15 15 15\n :header-rows: 1\n\n * - Title\n - Framework\n - Dataset\n - Tags\n\n" +table_headers = ( + "\n.. list-table::\n :widths: 50 15 15 15\n " + ":header-rows: 1\n\n * - Title\n - Framework\n - Dataset\n - Tags\n\n" +) categories = { "quickstart": {"table": table_headers, "list": ""}, @@ -83,7 +102,10 @@ def _read_metadata(example): def _add_table_entry(example, label, table_var): title, labels, dataset, framework = _read_metadata(example) example_name = Path(example).stem - table_entry = f" * - `{title} <{example_name}.html>`_ \n - {framework} \n - {dataset} \n - {labels}\n\n" + table_entry = ( + f" * - `{title} <{example_name}.html>`_ \n " + f"- {framework} \n - {dataset} \n - {labels}\n\n" + ) if label in labels: categories[table_var]["table"] += table_entry categories[table_var]["list"] += f" {example_name}\n" From 3427e22ba65868d9040fdfc07d511eba808537b3 Mon Sep 17 00:00:00 2001 From: Charles Beauville Date: Sun, 30 Jun 2024 16:57:28 +0200 Subject: [PATCH 59/66] Add error handling --- dev/build-example-docs.py | 41 ++++++++++++++++++++++++++------------- 1 file changed, 28 insertions(+), 13 deletions(-) diff --git a/dev/build-example-docs.py b/dev/build-example-docs.py index e684ab8194a7..e67747acd02c 100644 --- a/dev/build-example-docs.py +++ b/dev/build-example-docs.py @@ -79,21 +79,36 @@ def _convert_to_link(search_result): def _read_metadata(example): with open(os.path.join(example, "README.md")) as f: content = f.read() - metadata = re.search(r"^---(.*?)^---", content, re.DOTALL | re.MULTILINE).group(1) - title = re.search(r"^title:\s*(.+)$", metadata, re.MULTILINE).group(1).strip() - labels = ( - re.search(r"^labels:\s*\[(.+?)\]$", metadata, re.MULTILINE).group(1).strip() - ) - dataset = ( - re.search(r"^dataset:\s*\[(.+?)\]$", metadata, re.DOTALL | re.MULTILINE) - .group(1) - .strip() + + metadata_match = re.search(r"^---(.*?)^---", content, re.DOTALL | re.MULTILINE) + if not metadata_match: + raise ValueError("Metadata block not found") + metadata = metadata_match.group(1) + + title_match = re.search(r"^title:\s*(.+)$", metadata, re.MULTILINE) + if not title_match: + raise ValueError("Title not found in metadata") + title = title_match.group(1).strip() + + labels_match = re.search(r"^labels:\s*\[(.+?)\]$", metadata, re.MULTILINE) + if not labels_match: + raise ValueError("Labels not found in metadata") + labels = labels_match.group(1).strip() + + dataset_match = re.search( + r"^dataset:\s*\[(.+?)\]$", metadata, re.DOTALL | re.MULTILINE ) - framework = ( - re.search(r"^framework:\s*\[(.+?)\]$", metadata, re.DOTALL | re.MULTILINE) - .group(1) - .strip() + if not dataset_match: + raise ValueError("Dataset not found in metadata") + dataset = dataset_match.group(1).strip() + + framework_match = re.search( + r"^framework:\s*\[(.+?)\]$", metadata, re.DOTALL | re.MULTILINE ) + if not framework_match: + raise ValueError("Framework not found in metadata") + framework = framework_match.group(1).strip() + dataset = _convert_to_link(re.sub(r"\s+", " ", dataset).strip()) framework = _convert_to_link(re.sub(r"\s+", " ", framework).strip()) return title, labels, dataset, framework From 1206087fd4c7274dd5fb7c048eb438e45a318f6c Mon Sep 17 00:00:00 2001 From: Charles Beauville Date: Sun, 30 Jun 2024 19:05:20 +0200 Subject: [PATCH 60/66] Allow no dataset or framework --- dev/build-example-docs.py | 4 ++-- examples/app-secure-aggregation/README.md | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/dev/build-example-docs.py b/dev/build-example-docs.py index e67747acd02c..e5731b6e8073 100644 --- a/dev/build-example-docs.py +++ b/dev/build-example-docs.py @@ -96,14 +96,14 @@ def _read_metadata(example): labels = labels_match.group(1).strip() dataset_match = re.search( - r"^dataset:\s*\[(.+?)\]$", metadata, re.DOTALL | re.MULTILINE + r"^dataset:\s*\[(.*?)\]$", metadata, re.DOTALL | re.MULTILINE ) if not dataset_match: raise ValueError("Dataset not found in metadata") dataset = dataset_match.group(1).strip() framework_match = re.search( - r"^framework:\s*\[(.+?)\]$", metadata, re.DOTALL | re.MULTILINE + r"^framework:\s*\[(.*?|)\]$", metadata, re.DOTALL | re.MULTILINE ) if not framework_match: raise ValueError("Framework not found in metadata") diff --git a/examples/app-secure-aggregation/README.md b/examples/app-secure-aggregation/README.md index e97fe0ab038f..b21674b052eb 100644 --- a/examples/app-secure-aggregation/README.md +++ b/examples/app-secure-aggregation/README.md @@ -1,7 +1,7 @@ --- title: Example Flower App with Secure Aggregation labels: [basic, vision, fds] -dataset: [CIFAR-10 | https://huggingface.co/datasets/uoft-cs/cifar10] +dataset: [] framework: [numpy | https://numpy.org/] --- From 9c471b7a0fb2697270650062291ac84f457cac7f Mon Sep 17 00:00:00 2001 From: Charles Beauville Date: Sun, 30 Jun 2024 19:06:13 +0200 Subject: [PATCH 61/66] Update examples/fl-dp-sa/README.md Co-authored-by: Javier --- examples/fl-dp-sa/README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/examples/fl-dp-sa/README.md b/examples/fl-dp-sa/README.md index a551510c1d4e..7269503af57f 100644 --- a/examples/fl-dp-sa/README.md +++ b/examples/fl-dp-sa/README.md @@ -1,7 +1,7 @@ --- title: Example of Flower App with DP and SA labels: [basic, vision, fds] -dataset: [CIFAR-10 | https://huggingface.co/datasets/uoft-cs/cifar10] +dataset: [MNIST | https://huggingface.co/datasets/ylecun/mnist] framework: [torch | https://pytorch.org/, torchvision | https://pytorch.org/vision/stable/index.html] --- From c40f440c656051d0c593b99be58760645223477e Mon Sep 17 00:00:00 2001 From: Charles Beauville Date: Sun, 30 Jun 2024 19:06:27 +0200 Subject: [PATCH 62/66] Update examples/fl-tabular/README.md Co-authored-by: Javier --- examples/fl-tabular/README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/examples/fl-tabular/README.md b/examples/fl-tabular/README.md index aa1250ee00d3..2cc2a1481d60 100644 --- a/examples/fl-tabular/README.md +++ b/examples/fl-tabular/README.md @@ -2,7 +2,7 @@ title: Flower Example on Adult Census Income Tabular Dataset labels: [basic, tabular, fds] dataset: [Adult Census Income | https://www.kaggle.com/datasets/uciml/adult-census-income/data] -framework: [scikit-learn | https://scikit-learn.org/] +framework: [scikit-learn | https://scikit-learn.org/, torch | https://pytorch.org/] --- # Flower Example on Adult Census Income Tabular Dataset From d69dae40f28eb142bbf33fdacfc5d0f3f1bda56a Mon Sep 17 00:00:00 2001 From: Charles Beauville Date: Sun, 30 Jun 2024 19:06:42 +0200 Subject: [PATCH 63/66] Update examples/flower-via-docker-compose/README.md Co-authored-by: Javier --- examples/flower-via-docker-compose/README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/examples/flower-via-docker-compose/README.md b/examples/flower-via-docker-compose/README.md index 4c5e2acddce3..07bb8a2c00a3 100644 --- a/examples/flower-via-docker-compose/README.md +++ b/examples/flower-via-docker-compose/README.md @@ -2,7 +2,7 @@ title: Leveraging Flower and Docker for Device Heterogeneity Management in FL labels: [deployment, vision, tutorial] dataset: [CIFAR-10 | https://huggingface.co/datasets/uoft-cs/cifar10] -framework: [Docker | https://www.docker.com/] +framework: [Docker | https://www.docker.com/, tensorflow | https://www.tensorflow.org/] --- # Leveraging Flower and Docker for Device Heterogeneity Management in Federated Learning From e4b316f43e67a689eb0fbdb610bc85e158df6a39 Mon Sep 17 00:00:00 2001 From: Charles Beauville Date: Sun, 30 Jun 2024 19:06:51 +0200 Subject: [PATCH 64/66] Update examples/llm-flowertune/README.md Co-authored-by: Javier --- examples/llm-flowertune/README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/examples/llm-flowertune/README.md b/examples/llm-flowertune/README.md index 9b6fe31c437a..2507dd1bb546 100644 --- a/examples/llm-flowertune/README.md +++ b/examples/llm-flowertune/README.md @@ -2,7 +2,7 @@ title: Federated LLM Fine-tuning with Flower labels: [llm, nlp, LLama2] dataset: [Alpaca-GPT4 | https://huggingface.co/datasets/vicgalle/alpaca-gpt4] -framework: [PEFT | https://huggingface.co/docs/peft/index] +framework: [PEFT | https://huggingface.co/docs/peft/index, torch | https://pytorch.org/] --- # LLM FlowerTune: Federated LLM Fine-tuning with Flower From d30ffcdc37b1724893851ff4896f581288713e9c Mon Sep 17 00:00:00 2001 From: Charles Beauville Date: Sun, 30 Jun 2024 19:07:12 +0200 Subject: [PATCH 65/66] Update examples/embedded-devices/README.md Co-authored-by: Javier --- examples/embedded-devices/README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/examples/embedded-devices/README.md b/examples/embedded-devices/README.md index a48bcfe4b8bd..e98570e95c69 100644 --- a/examples/embedded-devices/README.md +++ b/examples/embedded-devices/README.md @@ -1,7 +1,7 @@ --- title: Flower Embedded Devices Example labels: [basic, vision, fds] -dataset: [CIFAR-10 | https://huggingface.co/datasets/uoft-cs/cifar10] +dataset: [CIFAR-10 | https://huggingface.co/datasets/uoft-cs/cifar10, MNIST | https://huggingface.co/datasets/ylecun/mnist] framework: [torch | https://pytorch.org/, tensorflow | https://www.tensorflow.org/] --- From 5fad5a88314698a3545abacf861eb0532ad3bac9 Mon Sep 17 00:00:00 2001 From: "Daniel J. Beutel" Date: Tue, 2 Jul 2024 01:09:48 +0200 Subject: [PATCH 66/66] Update dev/build-example-docs.py Co-authored-by: Javier --- dev/build-example-docs.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/dev/build-example-docs.py b/dev/build-example-docs.py index e5731b6e8073..204380f312ac 100644 --- a/dev/build-example-docs.py +++ b/dev/build-example-docs.py @@ -45,7 +45,7 @@ Quickstart Examples ------------------- -Flower Quickstart Examples are a collection of demo project that show how you +Flower Quickstart Examples are a collection of demo projects that show how you can use Flower in combination with other existing frameworks or technologies. """