Giter VIP home page Giter VIP logo

fed_chim's Introduction

MNIST Example (PyTorch version)

This classic example of hand-written text recognition is well suited both as a lightweight test when learning FEDn and developing on FEDn in psedo-distributed mode. A normal high-end laptop or a workstation should be able to sustain a few clients.

Table of Contents

Prerequisites

Running the example (pseudo-distributed)

Start by initializing a virtual enviroment with all of the required dependencies.

bin/init_venv.sh

Then, to get the data you can run the following script.

bin/get_data

The next command splits the data in 2 parts for the clients.

bin/split_data

Note: run with --n_splits=N to split in N parts.

Now we are ready to start the pseudo-distributed deployment with docker-compose.

docker-compose -f ../../docker-compose.yaml -f docker-compose.override.yaml up -d

Note: run with --scale client=N to start N clients.

Now navigate to https://localhost:8090 to see the reducer UI. You will be asked to upload a compute package and a seed model that you can generate by running the following script.

bin/build.sh

The files location will be package/package.tgz and seed.npz.

Finally, you can start the experiment from the "control" tab.

Clean up

You can clean up by running docker-compose down.

Connecting to a distributed deployment

To start and remotely connect a client with the required dependencies for this example, start by downloading the client.yaml file. You can either navigate the reducer UI or run the following command.

curl -k https://<reducer-fqdn>:<reducer-port>/config/download > client.yaml

Note make sure to replace <reducer-fqdn> and <reducer-port> with appropriate values.

Now you are ready to start the client via Docker by running the following command.

docker run -d \
  -v $PWD/client.yaml:/app/client.yaml \
  -v $PWD/data:/var/data \
  -e ENTRYPOINT_OPTS=--data_path=/var/data/mnist.npz \
  ghcr.io/scaleoutsystems/fedn/fedn:develop-mnist-pytorch run client -in client.yaml

Note If reducer and combiner host names, as specfied in the configuration files, are not resolvable in the client host network you need to use the docker option --add-hosts to make them resolvable. Please refer to the Docker documentation for more detail.

fed_chim's People

Contributors

saadiabadi avatar mattiasakesson avatar

Watchers

 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.