From ba8e04a3ffdcbbfd792bc536272bfe94d678589c Mon Sep 17 00:00:00 2001 From: Jonas Date: Mon, 13 May 2024 13:49:57 +0200 Subject: [PATCH] updating readme instructions --- examples/FedSimSiam/README.rst | 55 ++++++++++++++++++++++++++++++++-- 1 file changed, 52 insertions(+), 3 deletions(-) diff --git a/examples/FedSimSiam/README.rst b/examples/FedSimSiam/README.rst index 7f2253e85..0e12be750 100644 --- a/examples/FedSimSiam/README.rst +++ b/examples/FedSimSiam/README.rst @@ -46,8 +46,8 @@ Next, generate a seed model (the first model in a global model trail): This will create a seed model called 'seed.npz' in the root of the project. This step will take a few minutes, depending on hardware and internet connection (builds a virtualenv). -FEDn Studio ------------ +Using FEDn Studio +----------------- Follow the instructions to register for FEDN Studio and start a project (https://fedn.readthedocs.io/en/stable/studio.html). @@ -73,4 +73,53 @@ FedSimSiam's encoder, and evaluated on the feature embeddings of the test images This is a common method to track FedSimSiam's training progress, as FedSimSiam aims to minimize the distance between the embeddings of similar images. A high accuracy implies that the feature embeddings for images within the same class are indeed close to each other in the -embedding space, i.e., FedSimSiam learned useful feature embeddings. \ No newline at end of file +embedding space, i.e., FedSimSiam learned useful feature embeddings. + + +Running FEDn in local development mode: +--------------------------------------- + +Follow the steps above to install FEDn, generate 'package.tgz' and 'seed.tgz'. + +Start a pseudo-distributed FEDn network using docker-compose: +.. code-block:: + + docker compose \ + -f ../../docker-compose.yaml \ + -f docker-compose.override.yaml \ + up + +This starts up local services for MongoDB, Minio, the API Server, one Combiner and two clients. +You can verify the deployment using these urls: + +- API Server: http://localhost:8092/get_controller_status +- Minio: http://localhost:9000 +- Mongo Express: http://localhost:8081 + +Upload the package and seed model to FEDn controller using the APIClient: + +.. code-block:: + + from fedn import APIClient + client = APIClient(host="localhost", port=8092) + client.set_active_package("package.tgz", helper="numpyhelper") + client.set_active_model("seed.npz") + + +You can now start a training session with 100 rounds using the API client: + +.. code-block:: + + client.start_session(rounds=100) + +Clean up +-------- + +You can clean up by running + +.. code-block:: + + docker-compose \ + -f ../../docker-compose.yaml \ + -f docker-compose.override.yaml \ + down -v