-
Notifications
You must be signed in to change notification settings - Fork 36
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
b6cf292
commit 625b1f7
Showing
1 changed file
with
35 additions
and
36 deletions.
There are no files selected for viewing
71 changes: 35 additions & 36 deletions
71
examples/async-clients/README.md → examples/async-clients/README.rst
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,77 +1,76 @@ | ||
# ASYNC CLIENTS | ||
ASYNC CLIENTS | ||
------------- | ||
|
||
This example shows how to experiment with intermittent and asynchronous client workflows. | ||
|
||
## Prerequisites | ||
Prerequisites | ||
------------- | ||
|
||
- [Python 3.8, 3.9 or 3.10](https://www.python.org/downloads) | ||
- [Docker](https://docs.docker.com/get-docker) | ||
- [Docker Compose](https://docs.docker.com/compose/install) | ||
|
||
## Running the example (pseudo-distributed, single host) | ||
Running the example (pseudo-distributed, single host) | ||
----------------------------------------------------- | ||
|
||
|
||
First, make sure that FEDn is installed (we recommend using a virtual environment) | ||
|
||
Clone FEDn | ||
```sh | ||
|
||
.. code-block:: | ||
git clone https://github.com/scaleoutsystems/fedn.git | ||
``` | ||
|
||
Install FEDn and dependencies | ||
|
||
`` | ||
.. code-block:: | ||
pip install fedn | ||
``` | ||
Or from source, standing in the folder 'fedn/fedn' | ||
|
||
``` | ||
pip install . | ||
``` | ||
|
||
### Prepare the example environment, the compute package and seed model | ||
Prepare the example environment, the compute package and seed model | ||
------------------------------------------------------------------- | ||
|
||
Standing in the folder fedn/examples/async-clients | ||
``` | ||
pip install -r requirements.txt | ||
``` | ||
|
||
.. code-block:: | ||
pip install -r requirements.txt | ||
Create the compute package and seed model: | ||
``` | ||
fedn package create --path client | ||
``` | ||
|
||
``` | ||
fedn run build --path client | ||
``` | ||
.. code-block:: | ||
fedn package create --path client | ||
.. code-block:: | ||
fedn run build --path client | ||
You will now have a file 'seed.npz' in the directory. | ||
|
||
### Running a simulation | ||
Running a simulation | ||
-------------------- | ||
|
||
Deploy FEDn on localhost. Standing in the the FEDn root directory: | ||
|
||
``` | ||
docker-compose up | ||
``` | ||
.. code-block:: | ||
docker-compose up | ||
Initialize FEDn with the compute package and seed model | ||
|
||
``` | ||
python init_fedn.py | ||
``` | ||
.. code-block:: | ||
python init_fedn.py | ||
Start simulating clients | ||
``` | ||
python run_clients.py | ||
``` | ||
|
||
.. code-block:: | ||
python run_clients.py | ||
Start the experiment / training sessions: | ||
|
||
``` | ||
python run_experiment.py | ||
``` | ||
.. code-block:: | ||
python run_experiment.py | ||
Once global models start being produced, you can start analyzing results using API Client, refer to the notebook "Experiment.ipynb" for instructions. | ||
|
||
|
||
|
||