|
1 |
| -# PyTorch-IRGAN |
| 1 | +# PyTorch-IRGAN |
| 2 | + |
| 3 | + |
| 4 | +## Description |
| 5 | + |
| 6 | +This project contains a pytorch version implementation about the item recommendation part of [IRGAN: A Minimax Game for Unifying Generative and Discriminative Information Retrieval Models](https://arxiv.org/abs/1705.10513). The official implementation can be found at https://github.com/geek-ai/irgan. If you have any problems on this implementation, please open an issue. |
| 7 | + |
| 8 | + |
| 9 | +## Requirements |
| 10 | + |
| 11 | +Please refer to requirements.txt |
| 12 | + |
| 13 | +## Project Structure |
| 14 | + |
| 15 | +. |
| 16 | +├── config.py (Configurations about IRGAN and BPR.) |
| 17 | +├── data (Data Files) |
| 18 | +│ ├── movielens-100k-test.txt |
| 19 | +│ └── movielens-100k-train.txt |
| 20 | +├── data_utils.py (Utilities about dataset.) |
| 21 | +├── evaluation (Evaluation metrics and tools.) |
| 22 | +│ ├── __init__.py |
| 23 | +│ ├── rank_metrics.py |
| 24 | +│ └── rec_evaluator.py |
| 25 | +├── exp_notebooks (Notebooks containing experiments for comparison. dns means using pre-trained models with dynamic negative sampling. |
| 26 | +│ │ gen means pre-training generator while dis means pre-training discriminator. SGD and Adam are optimizers adopted.) |
| 27 | +│ ├── BPR.ipynb |
| 28 | +│ ├── IRGAN-Adam-dns-gen-dis.ipynb |
| 29 | +│ ├── IRGAN-Adam-dns-gen.ipynb |
| 30 | +│ ├── IRGAN-Adam-without-pretrained-model.ipynb |
| 31 | +│ ├── IRGAN-dns-gen-Adam-G-SGD-D.ipynb |
| 32 | +│ ├── IRGAN-SGD-dns-gen-dis.ipynb |
| 33 | +│ ├── IRGAN-SGD-dns-gen-static-negative-sampling.ipynb |
| 34 | +│ ├── IRGAN-SGD-without-pretrained-model.ipynb |
| 35 | +│ ├── Pretrain-Discriminator-Dynamic-Negative-Sampling-Adam.ipynb |
| 36 | +│ ├── Pretrain-Discriminator-Dynamic-Negative-Sampling.ipynb |
| 37 | +│ └── Pretrain-Discriminator-Static-Negative-Sampling.ipynb |
| 38 | +├── IRGAN-SGD-dns-gen.ipynb(IRGAN with the SGD optimizer and a pre-trained model with dynamic negative sampling for generator.) |
| 39 | +├── model.py (Model definition.) |
| 40 | +├── pretrained_models (Pre-trained models) |
| 41 | +│ ├── pretrained_model_dns.pkl |
| 42 | +│ └── pretrained_model_sns.pkl |
| 43 | +├── readme.md |
| 44 | + |
| 45 | +## How to run |
| 46 | +1. Execute **conda create --name <env_name> --file requirements.txt** to create an virtual environment and install required packages. |
| 47 | +2. Run a jupyter notebook server by **jupyter notebook**. |
| 48 | +3. Open IRGAN-SGD-dns-gen.ipynb in a browser and run all cells. |
| 49 | + The output of loss and other evaluation metrics can be observed with tensorboard.(Other notebooks from the *exp_notebooks* directory can be moved out to its upper-level directory and run). |
0 commit comments