MLearning.ai
Published in

MLearning.ai

Azure Machine learning Federated learning

Federated learning sampling introduction

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

--

--

Data Scientists must think like an artist when finding a solution when creating a piece of code. ⚪️ Artists enjoy working on interesting problems, even if there is no obvious answer ⚪️ linktr.ee/mlearning 🔵 Follow to join our 28K+ Unique DAILY Readers 🟠

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