Skip to content

Commit

Permalink
Fix vertical-fl example (#2655)
Browse files Browse the repository at this point in the history
Co-authored-by: Charles Beauville <[email protected]>
  • Loading branch information
jafermarq and charlesbvll authored Nov 29, 2023
1 parent b3c530a commit 02bb3ba
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 5 deletions.
6 changes: 3 additions & 3 deletions examples/vertical-fl/pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -3,14 +3,14 @@ requires = ["poetry-core>=1.4.0"]
build-backend = "poetry.core.masonry.api"

[tool.poetry]
name = "quickstart-pytorch"
name = "vertical-fl"
version = "0.1.0"
description = "PyTorch Federated Learning Quickstart with Flower"
description = "PyTorch Vertical FL with Flower"
authors = ["The Flower Authors <[email protected]>"]

[tool.poetry.dependencies]
python = ">=3.8,<3.11"
flwr = ">=1.0,<2.0"
flwr = { extras = ["simulation"], version = ">=1.0,<2.0" }
torch = "2.1.0"
matplotlib = "3.7.3"
scikit-learn = "1.3.2"
Expand Down
2 changes: 1 addition & 1 deletion examples/vertical-fl/requirements.txt
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
flwr>=1.0, <2.0
flwr[simulation]>=1.0, <2.0
torch==2.1.0
matplotlib==3.7.3
scikit-learn==1.3.2
Expand Down
5 changes: 4 additions & 1 deletion examples/vertical-fl/simulation.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@
import numpy as np
from strategy import Strategy
from client import FlowerClient
from pathlib import Path
from task import get_partitions_and_label

partitions, label = get_partitions_and_label()
Expand All @@ -19,4 +20,6 @@ def client_fn(cid):
strategy=Strategy(label),
)

np.save("_static/results/hist.npy", hist)
results_dir = Path("_static/results")
results_dir.mkdir(exist_ok=True)
np.save(str(results_dir/"hist.npy"), hist)

0 comments on commit 02bb3ba

Please sign in to comment.