diff --git a/docs/img/studio_model_overview.png b/docs/img/studio_model_overview.png index 62deed68c..7645bfc1f 100644 Binary files a/docs/img/studio_model_overview.png and b/docs/img/studio_model_overview.png differ diff --git a/docs/quickstart.rst b/docs/quickstart.rst index 47ddeaa2e..c81bf9752 100644 --- a/docs/quickstart.rst +++ b/docs/quickstart.rst @@ -61,13 +61,13 @@ code used by the client to execute local training and local validation. The seed For a detailed explaination of the compute package and seed model, see this guide: :ref:`projects-label` To work through this quick start you need a local copy of the ``mnist-pytorch`` example project contained in the main FEDn Git repository. -The following command clones the entire repository but you will only use the example: +Clone the repository using the following command, if you didn't already do it in the previous step: .. code-block:: bash git clone https://github.com/scaleoutsystems/fedn.git -Locate into the ``fedn/examples/mnist-pytorch`` folder. The compute package is located in the folder ``client``. +Navigate to the ``fedn/examples/mnist-pytorch`` folder. The compute package is located in the folder ``client``. Create a compute package: @@ -94,31 +94,39 @@ Next will now upload these files to your Studio project. 3. Initialize the server-side ------------------------------ -The next step is to initialize the server side with the client code and the initial global model. -In the Studio UI, navigate to the project you created in step one and click on the "Sessions" tab. Click on the "New Session" button. Under the "Compute package" tab, select a name and upload the generated package file. Under the "Seed model" tab, upload the generated seed file: +The next step is to initialize the server side with the client code and the initial global model. In the Studio UI, + +#. Navigate to the project you created in step 1 and click on the "Sessions" tab. +#. Click on the "New Session" button. +#. Under the "Compute package" tab, select a name and upload the generated package file. +#. Under the "Seed model" tab, upload the generated seed file: .. image:: img/upload_package.png +Continue to step 4 before starting the session. The uploaded package and seed files are saved. + 4. Start clients ----------------- Now we are ready to start FEDn clients on your local machine. There are two steps involved: -1. Register a new client in your Studio project, issuing an access token. -2. Start up a client process on your local host (using the token to connect securely) +#. Register a new client in your Studio project, issuing an access token. +#. Start up a client process on your local host (using the token to connect securely) **Generate an access token for the client (in Studio)** Each local client needs an access token in order to connect securely to the FEDn server. These tokens are issued from your Studio Project. -Go to the Clients' tab and click 'Connect client'. Download a client configuration file and save it to the root of the ``examples/mnist-pytorch folder``. -Rename the file to 'client.yaml'. + +#. Go to the 'Clients' tab and click 'Connect client'. +#. Download a client configuration file and save it to the root of the ``examples/mnist-pytorch`` folder. +#. Rename the file to 'client.yaml'. **Start the client (on your local machine)** The default training and test data for this particular example (mnist-pytorch) is for convenience downloaded and split automatically by the client when it starts up. The number of splits and which split to use by a client can be controlled via the environment variables ``FEDN_NUM_DATA_SPLITS`` and ``FEDN_DATA_PATH``. -Start a client (using a 10-split and the first partition) by running the following commands: +Start a client (using a 10-split and the 1st partition) by running the following commands: .. tabs:: @@ -139,7 +147,7 @@ Start a client (using a 10-split and the first partition) by running the followi fedn run client -in client.yaml --secure=True --force-ssl Repeat these two steps (generate an access token and start a local client) for the number of clients you want to use. -A normal laptop should be able to handle several clients for this example. Remember to use different partitions for each client. +A normal laptop should be able to handle several clients for this example. Remember to use different partitions for each client, by changing the number in the ``FEDN_DATA_PATH`` variable. 5. Train the global model ----------------------------- @@ -147,12 +155,17 @@ A normal laptop should be able to handle several clients for this example. Remem With clients connected, we are now ready to train the global model. This can be done using either the Studio dashboard or the Python API. In FEDn, training is organised in Sessions. One training session consists of a configurable number of training rounds (local model updates and aggregation). -In Studio click on the "Sessions" link, then the "New session" button in the upper right corner. Click the "Start session" tab and enter your desirable settings (the default settings are good for this example) and hit the "Start run" button. +In Studio, + +#. Click on the "Sessions" link, then the "New session" button in the upper right corner. +#. Click the "Start session" tab and enter your desirable settings (the default settings are good for this example). +#. Hit the "Start run" button. + In the terminal where your are running your client you should now see some activity. When a round is completed, you can see the results on the "Models" page. **Watch real-time updates of training progress** -Once a training session is started, you can monitor the progress by clicking the drop-down button for the active Sessions and the clicking on the "View session" button. The session page will show +Once a training session is started, you can monitor the progress by clicking the drop-down button for the active Sessions and then clicking on the "View session" button. The session page will show metrics related to the training progress (accuracy, loss etc), as well as performance data such as total round times and individual client training times. A list of models in the session is updated as soon as new models are generated. To get more information about a particular model, navigate to the model page by clicking the model name. From the model page you can download the model weights and get validation metrics. @@ -173,19 +186,19 @@ be useful as you progress in your federated learning journey. With you first FEDn federated project set up, we suggest that you take a closer look at how a FEDn project is structured to learn how to develop your own FEDn projects: -- :ref:`projects-label` +:ref:`projects-label` In this tutorial we relied on the UI for running training sessions and retrieving models and results. The Python APIClient provides a flexible alternative, with additional functionality exposed, including the use of different aggregators. Learn how to use the APIClient here: -- :ref:`apiclient-label` +:ref:`apiclient-label` Study the architecture overview to learn more about how FEDn is designed and works under the hood: -- :ref:`architecture-label` +:ref:`architecture-label` For developers looking to customize FEDn and develop own aggregators, check out the local development guide to learn how to set up an all-in-one development environment using Docker and docker-compose: -- :ref:`developer-label` +:ref:`developer-label`