MLearning.ai
Published in

MLearning.ai

Azure Machine learning Federated learning

Federated learning sampling introduction

This sample is to show how to run federated learning in azure machine learning from existing sample from documentation. AT the time of this tutorial, Federated learning is in public preview.

Prerequisites

Federated learning Steps

  • Create a workspace
  • Create a compute instance
  • or local workstation is also fine
  • there is bicep code to create the workspace and compute instance

Code

  • Login into Azure CLI
az login --tenant <tenant-id>
az account set --name <subscription name>
  • create a reource group
az group create --name fltest --location eastus
  • now create the resource
  • Change the name fldemo to something else
az deployment group create --template-file ./mlops/bicep/open_sandbox_setup.bicep --resource-group fltest --parameters demoBaseName="fldemo22"
  • wait until the deployment is complete
  • now run the python code to setup the environment
python -m pip install -r ./examples/pipelines/fl_cross_silo_literal/requirements.txt
  • now update the config.json
{
"subscription_id": "<subscription-id>",
"resource_group": "<resource-group>",
"workspace_name": "<workspace-name>"
}
  • now run the training code
python ./examples/pipelines/fl_cross_silo_literal/submit.py --example MNIST --submit
  • wait for the training to complete
  • Metric view
  • Steps review

Original article — Samples2022/FLintro.md at main · balakreshnan/Samples2022 (github.com)

--

--

Get the Medium app

A button that says 'Download on the App Store', and if clicked it will lead you to the iOS App store
A button that says 'Get it on, Google Play', and if clicked it will lead you to the Google Play store