Skip to content

Commit

Permalink
rename package to fedmind and use flat structure
Browse files Browse the repository at this point in the history
  • Loading branch information
Xiao-Chenguang committed Oct 21, 2024
1 parent 7884320 commit 71d07c2
Show file tree
Hide file tree
Showing 13 changed files with 15 additions and 15 deletions.
File renamed without changes.
File renamed without changes.
4 changes: 2 additions & 2 deletions src/flair/algs/fedavg.py → fedmind/algs/fedavg.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,8 @@
from torch.nn.modules.loss import _Loss
from torch.utils.data import DataLoader

from flair.server import FedAlg
from flair.utils import EasyDict
from fedmind.server import FedAlg
from fedmind.utils import EasyDict


class FedAvg(FedAlg):
Expand Down
2 changes: 1 addition & 1 deletion src/flair/client.py → fedmind/client.py
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@
from torch.optim.optimizer import Optimizer
from torch.utils.data import DataLoader

from flair.utils import StateDict
from fedmind.utils import StateDict


def train(
Expand Down
2 changes: 1 addition & 1 deletion src/flair/config.py → fedmind/config.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

import yaml

from flair.utils import EasyDict
from fedmind.utils import EasyDict


def dotodict(k: str, value):
Expand Down
File renamed without changes.
6 changes: 3 additions & 3 deletions src/flair/server.py → fedmind/server.py
Original file line number Diff line number Diff line change
Expand Up @@ -10,8 +10,8 @@
from torch.optim import SGD
from torch.utils.data import DataLoader

from flair.client import test, train, train_process
from flair.utils import EasyDict, StateDict
from fedmind.client import test, train, train_process
from fedmind.utils import EasyDict, StateDict


class FedAlg:
Expand Down Expand Up @@ -48,7 +48,7 @@ def __init__(

self.wb_run = wandb.init(
mode="offline",
project=args.get("WB_PROJECT", "flair"),
project=args.get("WB_PROJECT", "fedmind"),
entity=args.get("WB_ENTITY", "wandb"),
config=self.args.to_dict(),
settings=wandb.Settings(_disable_stats=True, _disable_machine_info=True),
Expand Down
File renamed without changes.
2 changes: 1 addition & 1 deletion hello.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
def main():
print("Hello from flair!")
print("Hello from fedmind!")


if __name__ == "__main__":
Expand Down
4 changes: 2 additions & 2 deletions pyproject.toml
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
[project]
name = "flair"
name = "fedmind"
version = "0.1.0"
description = "Add your description here"
readme = "README.md"
Expand All @@ -13,7 +13,7 @@ dependencies = [
]

[project.scripts]
new = "flair:main"
new = "fedmind:main"

[build-system]
requires = ["hatchling"]
Expand Down
2 changes: 1 addition & 1 deletion test/test_config.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
from flair.config import get_config
from fedmind.config import get_config
import yaml


Expand Down
6 changes: 3 additions & 3 deletions test/test_fedavg.py
Original file line number Diff line number Diff line change
Expand Up @@ -6,9 +6,9 @@
from torchvision.datasets import MNIST
from torchvision.transforms import ToTensor

from flair.algs.fedavg import FedAvg
from flair.data import ClientDataset
from flair.config import get_config
from fedmind.algs.fedavg import FedAvg
from fedmind.data import ClientDataset
from fedmind.config import get_config


def test_fedavg():
Expand Down
2 changes: 1 addition & 1 deletion uv.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

0 comments on commit 71d07c2

Please sign in to comment.