5.1 Getting Started
Prerequisites
Please ensure the following requirements have been prepared already:
- Understand federated learning and terminology in 2.1 Federated learning and terminology
- Install docker on your computer and know the basic concepts in 2.2 Docker tutorial for beginners
- Custom dataset that match the specification in 2.3 The input and output interfaces
- A docker image including custom training / validation code and meet the requirements in 2.3 The input and output interfaces which references
- (Optional for FL but must for FV) Custom model weights
Please follow the steps by the links to the user manual with additional hints. This is the minimal requirement for porting the custom program to our platform, that is, you can just visit the pages below without clicking other pages for the most quickest porting.
Step 1 - Edge Admin: create a project and assign it to PI
Step 2 - PI: invites Co-PIs to join the project, then Co-PI's login by the invitation
- How to invite partners to join my FL project? (PI)
- How to join a Federated Learning project as an alliance partner? (Co-PIs)
Step 3 - PI: Upload docker images and model weights to the project
Step 3A - Upload docker images
- How to upload the AI initial model? (PI) for FL or How to upload the AI validating model? (PI) for FV. (Same)
- The term "AI initial model" or "AI model docker image" means the docker image prepared by the assistance of FLaVor in the previous chapter. It involves custom training / validation code that matches the interface of our FL/FV system.
- Once you have prepared the docker image already,
- click "Build AI model image locally"
- Enter image name on local repository and image name after uploaded to cloud
- Copy the three commands at the end of the page. Paste the commands to your terminal and execute sequentially.
- Note that the docker image is at project level. You can upload several docker images for a project, then choose either one for each plan to conduct an experiment under the project.
step 3B - Upload model weights
- How to upload the AI model pretrained weights? (PI) for FL or How to upload the AI model validating weights? (PI) for FV. (Same)
- If you do not have pre-trained model weight (initialized randomly), you can skip this link.
- If your pre-trained weights are packed into the docker image (not recommended), you can skip this link.
Step 4 - PI: Create a plan under the project
- For FL only, please refer How to setup a federated learning plan? (PI)
- The path at the configuring path step will be passed to the docker container as environment variables required by FLaVor. You can just set all of them by default.
-
Code environment variables Types Explanation Aggregator Dashboard
Setting Plans InputsINPUT_PATH Directory Training dataset Datasets location LOCAL_MODEL_PATH Directory Saved weights after training AI model weights location GLOBAL_MODEL_PATH Directory Pre-trained weights and load per round AI model weights location (Optional) OUTPUT_PATH Directory Additional outputs --- (Optional) LOG_PATH Directory Additional logs Log files location - Note that the epochs in the code will be replaced as round in Aggregator Dashboard.
- (Optional) The default algorithm for aggregating the weights is FedAvg. There are several other options, refer here if you need to change.
- For FV only, please refer How to setup a federated validating plan? (PI)
- The path at the configuring path step will be passed to the docker container as environment variables required by FLaVor. You can just set all of them by default.
-
Code environment variables Types Explanation Aggregator Dashboard
Setting Plans InputsINPUT_PATH Directory Validation dataset Datasets location WEIGHT_PATH Full path Pre-trained weights AI model weights location OUTPUT_PATH Directory Saved results after validation Output files location (Optional) LOG_PATH Directory Additional logs Log files location
Step 5 - Co-PIs: upload dataset
- How to upload training datasets? (Co-PIs) for FL or How to upload validating datasets? (Co-PIs) for FV. (Same)
Step 6 - PI: start training / validation
- How to start a training plan? (PI) for FL or How to start a validating plan? (PI) for FV. (Same)
- The aggregation algorithm should match the used model
Model Aggregation Algorithms Neural network FedAvg, FedAdagrad, FedAdam XGBoost FedXGBoost SVM FedSVM
Step 7 - PI: check training / validation result
- Where could I see the training result? (PI) for FL or Where could I see the validating result? (PI) for FV. (Same)
- How to obtained the global trained models? (PI) for FL only.