-
Notifications
You must be signed in to change notification settings - Fork 354
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[ModelZoo] Support Co_Action Network #344
Open
aiden-law-tian
wants to merge
8
commits into
DeepRec-AI:main
Choose a base branch
from
aiden-law-tian:aiden
base: main
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Open
Changes from all commits
Commits
Show all changes
8 commits
Select commit
Hold shift + click to select a range
32ce9e7
[ModelZoo] Support Co_Action Network
aiden-law-tian d6d5be5
[ModelZoo] Support Co_Action Network
aiden-law-tian b438c64
[ModelZoo] Support Co_Action Net
aiden-law-tian c5df688
[ModelZoo] Support FNN
aiden-law-tian 4e4b400
[ModelZoo] Support Co_Action Network
aiden-law-tian b613472
[ModelZoo] Support FNN
aiden-law-tian 0cc1389
[ModelZoo] Support FwFM
aiden-law-tian 6421ff4
[ModelZoo] Support PNN
aiden-law-tian File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,85 @@ | ||
# Co-Action Network | ||
|
||
The following is a brief directory structure and description for this example: | ||
|
||
|
||
|
||
``` | ||
├── data # Data set directory | ||
│ ├── prepare_data.sh # Shell script to download and process dataset | ||
│ └── README.md # Documentation describing how to prepare dataset | ||
│ └── script # Directory contains scripts to process dataset | ||
│ ├── data_iterator.py | ||
│ ├── generate_voc.py # Create a list of features | ||
│ ├── local_aggretor.py # Generate sample data | ||
│ ├── shuffle.py | ||
│ ├──process_data.py # Parse raw json data | ||
│ └── split_by_user.py # Divide the dataset | ||
├── script # Directory contains scripts to CAN model | ||
│ ├── Dice.py | ||
│ ├── model.py | ||
│ ├── model_avazu.py | ||
│ ├── rnn.py | ||
│ └── utils.py | ||
├── README.md # Documentation | ||
└── train.py # Training script | ||
``` | ||
|
||
|
||
|
||
## Content | ||
|
||
[TOC] | ||
|
||
|
||
|
||
## Model Structure | ||
|
||
Implementation of paper "CAN: Revisiting Feature Co-Action for Click Through Rate Prediction". | ||
|
||
paper: [arxiv (to be released)]() | ||
|
||
|
||
|
||
## Usage | ||
|
||
### Stand-alone Training | ||
|
||
1. Please prepare the data set and DeepRec env. | ||
|
||
1. Manually | ||
|
||
- Follow [dataset preparation](https://github.com/alibaba/DeepRec/tree/main/modelzoo/DIEN#prepare) to prepare data set. | ||
- Download code by `git clone https://github.com/alibaba/DeepRec` | ||
- Follow [How to Build](https://github.com/alibaba/DeepRec#how-to-build) to build DeepRec whl package and install by `pip install $DEEPREC_WHL`. | ||
|
||
2. Docker(Recommended) | ||
|
||
``` | ||
docker pull alideeprec/deeprec-release-modelzoo:latest | ||
docker run -it alideeprec/deeprec-release-modelzoo:latest /bin/bash | ||
|
||
# In docker container | ||
cd /root/modelzoo/CAN | ||
``` | ||
|
||
2.train. | ||
|
||
``` | ||
python train.py | ||
``` | ||
|
||
| ||
|
||
|
||
|
||
## Dataset | ||
|
||
Amazon Dataset Books dataset is used as benchmark dataset. | ||
|
||
### Prepare | ||
|
||
For details of Data download, see `./data` | ||
|
||
|
||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,14 @@ | ||
# Dataset | ||
|
||
## Prepare dataset | ||
|
||
Prepare data of DIEN first; | ||
|
||
Run `prepare_data.sh` to download and process data: | ||
|
||
``` | ||
sh prepare_data.sh | ||
``` | ||
|
||
Put data into this folder. | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,10 @@ | ||
export PATH="~/anaconda4/bin:$PATH" | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. 移除本地开发变量 |
||
wget http://snap.stanford.edu/data/amazon/productGraph/categoryFiles/reviews_Books.json.gz | ||
wget http://snap.stanford.edu/data/amazon/productGraph/categoryFiles/meta_Books.json.gz | ||
gunzip reviews_Books.json.gz | ||
gunzip meta_Books.json.gz | ||
python script/process_data.py meta_Books.json reviews_Books.json | ||
python script/local_aggretor.py | ||
python script/split_by_user.py | ||
python script/generate_voc.py | ||
|
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
CAN