From f8562e3c4722a15eec439c944a5728060e195b59 Mon Sep 17 00:00:00 2001 From: Jan Schlicht Date: Wed, 10 Aug 2022 09:58:57 +0200 Subject: [PATCH] docs: use flwr 0.19 in example code (#30) By using this fixed version of flwr, we match the version currently used in the flwr server component and ensure that API changes to flwr don't break the examples. --- components/kubeflow-notebooks/requirements.tpl.txt | 2 +- docs/quickstart.md | 2 +- docs/uniwear-example.md | 4 ++-- 3 files changed, 4 insertions(+), 4 deletions(-) diff --git a/components/kubeflow-notebooks/requirements.tpl.txt b/components/kubeflow-notebooks/requirements.tpl.txt index 1726c01..62b0422 100644 --- a/components/kubeflow-notebooks/requirements.tpl.txt +++ b/components/kubeflow-notebooks/requirements.tpl.txt @@ -1,2 +1,2 @@ ./tmp/fl_suite-$$container-tag$$-py3-none-any.whl -flwr==0.18.0 +flwr==0.19.0 diff --git a/docs/quickstart.md b/docs/quickstart.md index 281d757..ed8805c 100644 --- a/docs/quickstart.md +++ b/docs/quickstart.md @@ -34,7 +34,7 @@ The `fl_suite.pipelines` package provides functions to describe Federated Learni Let's create a simple Federated Learning client that loads the MNIST dataset and trains a simple model. The `pipelines.fl_client` decorator indicates that this is the Federated Learning client code. ```python -@pipelines.fl_client(packages=["tensorflow", "flwr"]) +@pipelines.fl_client(packages=["tensorflow", "flwr==0.19.0"]) def mnist_client(): import flwr as fl import tensorflow as tf diff --git a/docs/uniwear-example.md b/docs/uniwear-example.md index ef11190..94739a5 100644 --- a/docs/uniwear-example.md +++ b/docs/uniwear-example.md @@ -49,7 +49,7 @@ This package builds a federated learning pipeline. Preparing authentications to Let's create a uniwear federated learning client. The client defines the model, loads the uniwear dataset from the repository address, shuffles the rows for regression, prepares test and training set, applies feature scaling, trains a nonlinear regression model, and reports Mean Absolute Percent Error (MAPE) performance per client. ```python -@pipelines.fl_client(packages=["tensorflow", "flwr", "pandas", "scikit-learn"]) +@pipelines.fl_client(packages=["tensorflow", "flwr==0.19.0", "pandas", "scikit-learn"]) def uniwear_client(): """Participating tool wear clients will use different experiments.""" import flwr as fl @@ -130,7 +130,7 @@ def uniwear_client(): def evaluate(self, parameters, config): model.set_weights(parameters) loss, mape = model.evaluate(x_test, y_test, verbose=2) - return loss, len(x_val), {"accuracy": mape} + return loss, len(x_test), {"accuracy": mape} fl.client.start_numpy_client("localhost:9080", client=UniWearClient()) ```