Skip to content
This repository has been archived by the owner on Jul 20, 2023. It is now read-only.

Commit

Permalink
docs: use flwr 0.19 in example code (#30)
Browse files Browse the repository at this point in the history
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.
  • Loading branch information
nfnt authored Aug 10, 2022
1 parent 2fe0ac3 commit f8562e3
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 4 deletions.
2 changes: 1 addition & 1 deletion components/kubeflow-notebooks/requirements.tpl.txt
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
./tmp/fl_suite-$$container-tag$$-py3-none-any.whl
flwr==0.18.0
flwr==0.19.0
2 changes: 1 addition & 1 deletion docs/quickstart.md
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
4 changes: 2 additions & 2 deletions docs/uniwear-example.md
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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())
```
Expand Down

0 comments on commit f8562e3

Please sign in to comment.