Giter Site home page Giter Site logo

af-fcl's Introduction

Accurate Forgetting for Heterogeneous Federated Continual Learning

The implementation of AF-FCL.

Requirements

The needed libraries are in requirements.txt.

Dataset preparation:

All datasets can be automatically downloaded with torchvision.datasets

Experiments

To run on EMNIST-Letters, excute:

  python main.py --dataset EMNIST-Letters --data_split_file data_split/EMNIST_letters_split_cn8_tn6_cet2_cs2_s2571.pkl --num_glob_iters 60 --local_epochs 100 --lr 1e-4 --flow_lr 1e-4 --k_loss_flow 0.5 --k_flow_lastflow 0.4 --flow_explore_theta 0

To run on EMNIST-shuffle, excute:

  python main.py --dataset EMNIST-Letters-shuffle --data_split_file data_split/EMNIST_letters_shuffle_split_cn8_tn6_cet2_cs2_s2571.pkl --num_glob_iters 60 --local_epochs 100 --lr 1e-4 --flow_lr 1e-3 --k_loss_flow 0.05 --k_flow_lastflow 0.02 --flow_explore_theta 0.5

To run on EMNIST-noisy with M noisy clients, excute:

  python main.py --dataset EMNIST-Letters-malicious --data_split_file data_split/EMNIST_letters_split_cn8_tn6_cet2_cs2_s2571.pkl --num_glob_iters 60 --local_epochs 100  --lr 1e-4 --flow_lr 1e-3 --k_loss_flow 0.5 --k_flow_lastflow 0.1 --flow_explore_theta 0.5 --malicious_client_num $M

To run on MNIST-SVHN-FASHION, excute:

  python main.py --dataset MNIST-SVHN-FASHION --data_split_file data_split/EMNIST_letters_split_cn8_tn6_cet2_cs2_s2571.pkl --num_glob_iters 60 --local_epochs 100 --lr 1e-4 --flow_lr 1e-3 --k_loss_flow 0.1 --k_flow_lastflow 0 --flow_explore_theta 0 --fedprox_k 0.001

To run on CIFAR100, excute:

  python main.py --dataset CIFAR100 --data_split_file data_split/CIFAR100_split_cn10_tn4_cet20_s2571.pkl --num_glob_iters 40 --local_epochs 400 --lr 1e-3 --flow_lr 5e-3 --k_loss_flow 0.5 --k_flow_lastflow 0.1 --flow_explore_theta 0.1 --fedprox_k 0.001

Reference

The code structure is based on the code in FedCIL.

The normalizaing flow code refers to nflows.

af-fcl's People

Contributors

zaocan666 avatar

Stargazers

lilijian avatar  avatar 任达 avatar  avatar Jiahao Tan avatar Cola avatar 水上由岐 avatar 王颖璨 avatar  avatar

Watchers

 avatar

Forkers

rah-man qi-smile

af-fcl's Issues

同学你好,我在复现EMNIST-Letters数据集时出现了一些问题

运行的是:python main.py --dataset EMNIST-Letters --data_split_file ./data_split/EMNIST_letters_split_cn8_tn6_cet2_cs2_s2571.pkl --num_glob_iters 10 --local_epochs 15 --lr 1e-4 --flow_lr 1e-4 --k_loss_flow 0.5 --k_flow_lastflow 0.4 --flow_explore_theta 0
报错为:
Traceback (most recent call last):
File "main.py", line 99, in
main(args)
File "main.py", line 30, in main
run_job(args, args.seed)
File "main.py", line 25, in run_job
server = create_server_n_user(args, seed)
File "main.py", line 16, in create_server_n_user
server=FedPrecise(args, model, i)
File "/home/aiswjtu/yzy/AF-FCL/FLAlgorithms/servers/serverPreciseFCL.py", line 19, in init
self.data = get_dataset(args, args.dataset, args.datadir, args.data_split_file)
File "/home/aiswjtu/yzy/AF-FCL/utils/dataset.py", line 121, in get_dataset
testify_client_y_list(train_y_list, split_data['train_inds'], split_data['client_y_list'])
File "/home/aiswjtu/yzy/AF-FCL/utils/dataset.py", line 16, in testify_client_y_list
assert y_c_t_set==set(client_y_list[c_i][t_i])
AssertionError

image

AF-FCL复现的bug:不存在.pkl文件

同学你好,我在AF-FCL中运行python main.py --dataset EMNIST-Letters --data_split_file data_split/EMNIST_letters_split_cn8_tn6_cet2_cs2_s2571.pkl --num_glob_iters 60 --local_epochs 100 --lr 1e-4 --flow_lr 1e-4 --k_loss_flow 0.5 --k_flow_lastflow 0.4 --flow_explore_theta 0命令时,出现了报错

Traceback (most recent call last): File "main.py", line 98, in <module> main(args) File "main.py", line 30, in main run_job(args, args.seed) File "main.py", line 25, in run_job server = create_server_n_user(args, seed) File "main.py", line 16, in create_server_n_user server=FedPrecise(args, model, i) File "/home/wyc/AF-FCL/FLAlgorithms/servers/serverPreciseFCL.py", line 19, in __init__ self.data = get_dataset(args, args.dataset, args.datadir, args.data_split_file) File "/home/wyc/AF-FCL/utils/dataset.py", line 118, in get_dataset with open(os.path.join(datadir, data_split_file), 'rb') as f: FileNotFoundError: [Errno 2] No such file or directory: 'datasets/PreciseFCL/data_split/EMNIST_letters_split_cn8_tn6_cet2_cs2_s2571.pkl'

在get_dataset函数读取.pkl文件时,找不到文件,请问这个文件时怎么生成的呢

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.