NVIDIA FLARE has several examples to help you get started with federated learning and to explore certain features in the examples directory.
The following quickstart guides walk you through some of these examples:
Hello Scatter and Gather - Example using the Scatter And Gather (SAG) workflow with a Numpy trainer
Hello Cross-Site Validation - Example using the Cross Site Model Eval workflow with a Numpy trainer
Hello PyTorch - Example image classifier using FedAvg and PyTorch as the deep learning training framework
Hello PyTorch with TensorBoard - Example building on Hello PyTorch with TensorBoard streaming from clients to server
Hello TensorFlow - Example image classifier using FedAvg and TensorFlow as the deep learning training frameworks
Hello Cyclic Weight Transfer (GitHub) - Example using the CyclicController workflow to implement Cyclic Weight Transfer with TensorFlow as the deep learning training framework
Federated Analysis (GitHub) - Example of gathering local data summary statistics to compute global dataset statistics
Federated Learning with CIFAR-10 (GitHub) - Includes examples of using FedAvg, FedProx, FedOpt, SCAFFOLD, homomorphic encryption, and streaming of TensorBoard metrics to the server during training
Hello MONAI (GitHub) - Example medical image analysis using FedAvg and MONAI
Differential Privacy for BraTS18 segmentation (GitHub) - Illustrates the use of differential privacy for training brain tumor segmentation models using federated learning
Prostate Segmentation from Multi-source Data (GitHub) - Example of training a multi-institutional prostate segmentation model using FedAvg, FedProx, and Ditto
For the complete collection of example applications, see https://github.com/NVIDIA/NVFlare/tree/main/examples.
Custom Code in Example Apps¶
There are several ways to make custom code available to clients when using NVIDIA FLARE. Most hello-* examples use a custom folder within the FL application. Note that using a custom folder in the app needs to be allowed when using secure provisioning. By default, this option is disabled in the secure mode. POC mode, however, will work with custom code by default.
In contrast, the CIFAR-10,
and BraTS18 segmentation examples assume that the
learner code is already installed on the client’s system and available in the PYTHONPATH.
Hence, the app folders do not include the custom code there.
The PYTHONPATH is set in the
run_secure.sh scripts of the example.
Running these scripts as described in the README will make the learner code available to the clients.