Skip to content

lianziqt/CFeD

Repository files navigation

Code for CFeD

Code for the paper "Continual Federated Learning Based on Knowledge Distillation"

Requirements

  • python 3.7+
  • cuda 9.0+
  • pytorch 1.7+

Datasets

In the code, we use 0~8 to denote the catagories in text classification tasks: Finance(0), Entertainment(1), Education(2), Fashion(3), Stock(4), Technology(5), Home(6), Sports(7), Social(8).

There is only the Sina2019 dataset which is generated by ourselves in the ./dataset folder.

Limited by the maximium size of uploaded files, only the subsets of the original dataset are included under the path ./dataset . To reproduce the work, you need to download the complete datasets:

To construct the required tasks, we provide some tools in construct_tasks.py.

Usage

  1. Run the code like this: python3 federated_run.py --model=TextCNN --paradigm=CFeD --scenario=class-IL ,where the parameter paradigm denotes which method is choosen and scenario.
  • positional arguments:
    • model:{TextCNN, TextCNNMultihead, CNN_Cifar10, CNN_Cifar10_multihead, CNN_Cifar100}
    • paradigme:{CFeD, dmc, lwf, ewc, multihead, normal}
    • scenario:{domain, class}
  1. Limited by the maximum size of the uploaded file, we decrease the hyper-parameters, like batch_size. To change the hyper-parameters, you can modify the specific model files under ./model, like ./model/TextCNN.py.

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages