Home

Awesome

Code for CFeD

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

Requirements

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.
  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.