Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix vertical-fl example #2655

Merged
merged 2 commits into from
Nov 29, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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)