Skip to content

Commit

Permalink
Merge pull request #2 from kathrynle20/fedstatic
Browse files Browse the repository at this point in the history
Fedstatic server download dataset
  • Loading branch information
kathrynle20 authored Dec 5, 2024
2 parents 0ed3c87 + 668bb42 commit e854c6e
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 12 deletions.
20 changes: 10 additions & 10 deletions src/configs/algo_config_test.py
Original file line number Diff line number Diff line change
@@ -1,16 +1,16 @@
from utils.types import ConfigType

# fedstatic: ConfigType = {
# # Collaboration setup
# "algo": "fedstatic",
# "topology": {"name": "watts_strogatz", "k": 3, "p": 0.2}, # type: ignore
# "rounds": 1,
fedstatic: ConfigType = {
# Collaboration setup
"algo": "fedstatic",
"topology": {"name": "watts_strogatz", "k": 3, "p": 0.2}, # type: ignore
"rounds": 1,

# # Model parameters
# "model": "resnet10",
# "model_lr": 3e-4,
# "batch_size": 256,
# }
# Model parameters
"model": "resnet10",
"model_lr": 3e-4,
"batch_size": 256,
}

traditional_fl: ConfigType = {
# Collaboration setup
Expand Down
5 changes: 3 additions & 2 deletions src/configs/sys_config_test.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,8 @@
from utils.types import ConfigType

from .algo_config_test import (
traditional_fl
traditional_fl,
fedstatic
)

def get_device_ids(num_users: int, gpus_available: List[int | Literal["cpu"]]) -> Dict[str, List[int | Literal["cpu"]]]:
Expand Down Expand Up @@ -112,7 +113,7 @@ def get_algo_configs(
"seed": 2,
"device_ids": get_device_ids(num_users, gpu_ids),
# "algos": get_algo_configs(num_users=num_users, algo_configs=default_config_list), # type: ignore
"algos": get_algo_configs(num_users=num_users, algo_configs=[traditional_fl]), # type: ignore
"algos": get_algo_configs(num_users=num_users, algo_configs=[fedstatic]), # type: ignore
# "samples_per_user": 50000 // num_users, # distributed equally
"samples_per_user": 100,
"train_label_distribution": "non_iid",
Expand Down

0 comments on commit e854c6e

Please sign in to comment.