{"id":19733994,"url":"https://github.com/scaleoutsystems/fedn-client-cifar10-pytorch","last_synced_at":"2025-10-04T19:21:55.613Z","repository":{"id":104982117,"uuid":"337966273","full_name":"scaleoutsystems/FEDn-client-cifar10-pytorch","owner":"scaleoutsystems","description":"Client, compute_package and seed model for FEDn training of a variant of VGG16 on cifar10","archived":false,"fork":false,"pushed_at":"2021-02-17T11:55:18.000Z","size":53174,"stargazers_count":1,"open_issues_count":0,"forks_count":1,"subscribers_count":3,"default_branch":"main","last_synced_at":"2025-01-10T18:23:50.110Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":"","language":"Python","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/scaleoutsystems.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2021-02-11T08:10:41.000Z","updated_at":"2021-06-05T14:55:09.000Z","dependencies_parsed_at":"2023-05-07T11:30:53.627Z","dependency_job_id":null,"html_url":"https://github.com/scaleoutsystems/FEDn-client-cifar10-pytorch","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/scaleoutsystems%2FFEDn-client-cifar10-pytorch","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/scaleoutsystems%2FFEDn-client-cifar10-pytorch/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/scaleoutsystems%2FFEDn-client-cifar10-pytorch/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/scaleoutsystems%2FFEDn-client-cifar10-pytorch/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/scaleoutsystems","download_url":"https://codeload.github.com/scaleoutsystems/FEDn-client-cifar10-pytorch/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":241059018,"owners_count":19902296,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":[],"created_at":"2024-11-12T00:34:53.048Z","updated_at":"2025-10-04T19:21:50.560Z","avatar_url":"https://github.com/scaleoutsystems.png","language":"Python","funding_links":[],"categories":[],"sub_categories":[],"readme":"# FEDn-client-cifar10-pytorch\nThis repository contains an example client (and compute package and seed file) for FEDn training of a PyTorch VGG16 model, without the top layer (last 3 fully connected layers). We have applied batch normalization between each Convolution and between each ReLU activation layer. \n\nThe CIFAR-10 dataset is evenly divided (IID) into 10 clients (but this can be easily modified). The clients train the model locally one epoch in every round with a batch size of 32, using the Adam optimizer with learning rate 0.001 and usign pre-processed image augmentation -- random crop with padding 4 and horizontal flip.\n\n## Prepare the client configuration\n\nTo attach to a FEDn network, first edit 'fedn-network.yaml' to set the endpoint for the controller/reducer. Then edit 'extra-hosts.yaml' to provice dns resolution for each combiner in the FEDn network (cpu version).\n\nIf you first need to deploy a FEDn network, follow the instructions here: https://github.com/scaleoutsystems/fedn \n\n## Configure and start a client using cpu device\n\nThe following shell script will configure and start a client on a blank Ubuntu 20.04 LTS VM:    \n\n```bash\n#!/bin/bash\n\n# Install Docker and docker-compose\nsudo apt-get update\nsudo apt-get install docker -y\nsudo apt-get install docker-compose -y\nsudo apt-get install git-lfs -y\nsudo systemctl enable docker\nsudo systemctl start docker\nsudo usermod -G docker ubuntu\n\ngit clone https://github.com/scaleoutsystems/FEDn-client-cifar10-pytorch.git\npushd FEDn-client-cifar10-pytorch\n\n# Download data and create split in 10 IID chunks\nsudo apt install python3-pip -y\npip3 install -r requirements.txt\npython3 load_datasets.py \n\n# Make sure you have edited extra-hosts.yaml to provide hostname mappings for combiners\n# INDEX in 0...9 to select dataslice for this client.\nsudo INDEX=1 docker-compose -f docker-compose.yaml -f extra-hosts.yaml up \n```\n\n## Start a client on an Nvidia enabled host\nMake sure that you have appropriate Nvidia drivers installed on the host. \n\nThe follwing shell script will configure and start a client on a Ubuntu 20.04 LTS VM:\n\n```bash\n#!/bin/bash\n\ngit clone https://github.com/scaleoutsystems/FEDn-client-cifar10-pytorch.git\npushd FEDn-client-cifar10-pytorch\n\n# Download the dataset and split in 10 IID chunks. \nsudo apt install python3-pip -y\npip3 install -r requirements.txt\npython3 load_datasets.py \n\n# Build docker image\nsudo docker build -f Dockerfile.gpu . -t cifar-client:latest\n\n# Modify below as needed for setup and data slice to use, set combiner extra host, then start client\ndocker run --gpus all --add-host=combiner-aws-stockholm:13.53.197.49 -v /home/ubuntu/FEDn-client-cifar10-pytorch/data/10clients/client1:/app/data cifar-client /bin/bash -c \"fedn run client -in fedn-network.yaml\"\n```\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fscaleoutsystems%2Ffedn-client-cifar10-pytorch","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fscaleoutsystems%2Ffedn-client-cifar10-pytorch","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fscaleoutsystems%2Ffedn-client-cifar10-pytorch/lists"}