FedDCSR
š¬ [SDM'24] This is the source code and baselines of our paper FedDCSR: Federated Cross-domain Sequential Recommendation via Disentangled Representation Learning.
Install / Use
/learn @orion-orion/FedDCSRREADME
FedDCSR: Federated Cross-domain Sequential Recommendation via Disentangled Representation Learning
Hongyu Zhang, Dongyi Zheng, Xu Yang, Jiyuan Feng, Qing Liao*
</div>1 Introduction
This is the source code and baselines of our SDM'24 paper FedDCSR: Federated Cross-domain Sequential Recommendation via Disentangled Representation Learning. In this paper, we propose FedDCSR, a novel federated cross-domain sequential recommendation framework via disentangled representation learning.
2 Dependencies
Run the following command to install dependencies:
pip install -r requirements.txt
Note that my Python version is 3.8.13. In addition, it is especially important to note that the Pytorch version needs to be <=1.7.1, otherwise the autograd engine of Pytorch will report an error.
3 Dataset
As used in many cross-domain recommendation methods, we utilize the publicly available datasets from Amazon (an e-commerce platform) to construct the federated CSR scenarios. We select ten domains to generate three cross-domain scenarios: Food-Kitchen-Cloth-Beauty (FKCB), Movie-Book-Game (MBG), and Sports-Garden-Home (SGH).
The preprocessed CSR datasets can be downloaded from Google Drive. You can download them and place them in the ./data path of this project.
4 Code Structure
FedDCSR
āāā LICENSE LICENSE file
āāā README.md README file
āāā checkpoint Model checkpoints saving directory
ā āāā ...
āāā data Data directory
ā āāā ...
āāā log Log directory
ā āāā ...
āāā models Local model packages
ā āāā __init__.py Package initialization file
ā āāā cl4srec CL4SRec package
ā ā āāā __init__.py Package initialization
ā ā āāā cl4srec_model.py Model architecture
ā ā āāā config.py Model configuration file
ā ā āāā modules.py Backbone modules (such as self-attention)
ā āāā ...
āāā pic Picture directory
ā āāā FedDCSR-Framework.png Model framework diagram
āāā utils Tools such as data reading, IO functions, training strategies, etc.
ā āāā __init__.py Package initialization file
ā āāā data_utils.py Data reading
ā āāā io_utils.py IO functions
ā āāā train_utils.py Training strategies
āāā client.py Client architecture
āāā dataloader.py Customized dataloader
āāā dataset.py Customized dataset
āāā fl.py The overall process of federated learning
āāā local_graph.py Local graph data structure
āāā losses.py Loss functions
āāā main.py Main function, including the complete data pipeline
āāā requirements.txt Dependencies installation
āāā server.py Server-side model parameters and user representations aggregation
āāā trainer.py Training and test methods of FedDCSR and other baselines
āāā .gitignore .gitignore file
5 Train & Eval
5.1 Our method
To train FedDCSR (ours), you can run the following command:
python -u main.py \
--epochs 40 \
--local_epoch 3 \
--eval_interval 1 \
--frac 1.0 \
--batch_size 256 \
--log_dir log \
--method FedDCSR \
--anneal_cap 1.0 \
--lr 0.001 \
--seed 42 \
Food Kitchen Clothing Beauty
There are a few points to note:
-
the positional arguments
Food Kitchen Clothing Beautyindicates training FedDCSR in FKCB scenario. If you want to choose another scenario, you can change it toMove Book Game(MBG) orSports Garden Home(SGH). -
The argument
--anneal_capis used to control KL annealing for variantional method (including ours). For FKCB,1.0is the best; for MBG and SGH,0.01is the best. -
If you restart training the model in a certain scenario, you can add the parameter
--load_prepto load the dataset preprocessed in the previous training to avoid repeated data preprocessing
To test FedDCSR, you can run the following command:
python -u main.py \
--log_dir log \
--method FedDCSR \
--do_eval \
--seed 42 \
Food Kitchen Clothing Beauty
5.2 Baselines
To train other baselines (FedSASRec, FedVSAN, FedContrastVAE, FedCL4SRec, FedDuoRec), you can run the following command:
python -u main.py \
--epochs 40 \
--local_epoch 3 \
--eval_interval 1 \
--frac 1.0 \
--batch_size 256 \
--log_dir log \
--method FedContrastVAE \
--anneal_cap 1.0 \
--lr 0.001 \
--seed 42 \
Food Kitchen Clothing Beauty
For the local version without federated aggregation, you can run the following command:
python -u main.py \
--epochs 40 \
--local_epoch 3 \
--eval_interval 1 \
--frac 1.0 \
--batch_size 256 \
--log_dir log \
--method LocalContrastVAE \
--anneal_cap 1.0 \
--lr 0.001 \
--seed 42 \
Food Kitchen Clothing Beauty
6 Citation
If you find this work useful for your research, please kindly cite FedDCSR by:
@inbook{Zhang_2024,
title={FedDCSR: Federated Cross-domain Sequential Recommendation via Disentangled Representation Learning},
ISBN={9781611978032},
url={http://dx.doi.org/10.1137/1.9781611978032.62},
DOI={10.1137/1.9781611978032.62},
booktitle={Proceedings of the 2024 SIAM International Conference on Data Mining (SDM)},
publisher={Society for Industrial and Applied Mathematics},
author={Zhang, Hongyu and Zheng, Dongyi and Yang, Xu and Feng, Jiyuan and Liao, Qing},
year={2024},
month=jan, pages={535ā543} }
Related Skills
proje
Interactive vocabulary learning platform with smart flashcards and spaced repetition for effective language acquisition.
YC-Killer
2.7kA library of enterprise-grade AI agents designed to democratize artificial intelligence and provide free, open-source alternatives to overvalued Y Combinator startups. If you are excited about democratizing AI access & AI agents, please star āļø this repository and use the link in the readme to join our open source AI research team.
best-practices-researcher
The most comprehensive Claude Code skills registry | Web Search: https://skills-registry-web.vercel.app
flutter-tutor
Flutter Learning Tutor Guide You are a friendly computer science tutor specializing in Flutter development. Your role is to guide the student through learning Flutter step by step, not to provide d
