This is an Implementation of paper Neural Collaborate Filtering use Personal Pytorch Template.
It is inspired by Meitu DL-Project-Template
but using pytorch
instead of tensorflow
for pytorch researchers/developers.
It also used a personalized version of torchsample
which contains series of Keras API for pytorch
.
You can find it in my personal directory: Torchsample.
By H. L. Wang
git clone https://github.com/popfido/DL-Project-Template
Build and activate of virtualenv
# Through Virtualenv
virtualenv venv
source venv/bin/activate
# Or Conda
conda create -n venv
Install Python Dependecy
git clone https://github.com/popfido/torchsample
cd torchsample && python setup.py install
pip install -r requirements.txt
Noted that the requirement version of torchsample
is 0.2.0, which is a
special version maintained by myself for the reason that the official torchsample
maintainer has been out of maintain for half an year.
# use get_movielen.py to get movielen dataset for testing
python data/get_movielen.py
# See help for main script usage
python main.py help
├── bases
│ ├── BaseDataLoader.py - BaseDataLoader Class
│ ├── BaseConfig.py - BaseConfig Class
│ └── BaseModule.py - BaseModule Class
├── configs - Config Directory
│ ├── NeuralMFConfig.py - Config.py file
│ └── neuralMF_config.json - Json format config file
├── data_loaders - DataLoader Class Directory
│ ├── __init__.py
│ └── cf_dl.py - CF Dataset DataLoader
├── main.py - Main Class
├── models - Module Directory
│ ├── __init__.py
│ ├── NeuralMF.py - Neural Collaborate Matrix Factorization Module
│ ├── MultilayerPerceptron.py - Multi-Layer Perceptron Module
│ ├── GeneralizedMF.py - Generalized Matrix Factorization Module
│ └── ModuleUtils.py - Utils Module for other Module
├── requirements.txt - Dependencies
└── utils - Utils Directory
├── __init__.py
├── config_utils.py - Config Utils
├── np_utils.py - NumPy Utils
└── utils.py - Other Utils
How to:
- Create your own DataLoade with BaseDataLoader.
- Implement
get_train_data()
andget_test_data()
Methods;
How to:
- Create your own Network Module with BaseModule (also );
- Implement
__init__()
andforward()
to create the NN strucure you want;
Define all parameter during training by JSON or from commandline.