Git Product home page Git Product logo

neuralmf-pytorch's Introduction

NeuralMF-Pytorch

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

Usage

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

Directory Structure

├── 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

Main Component

DataLoader

How to:

  1. Create your own DataLoade with BaseDataLoader.
  2. Implement get_train_data() and get_test_data() Methods;

Module

How to:

  1. Create your own Network Module with BaseModule (also );
  2. Implement __init__() and forward() to create the NN strucure you want;

Config

Define all parameter during training by JSON or from commandline.

neuralmf-pytorch's People

Contributors

popfido avatar

Stargazers

 avatar  avatar  avatar

Watchers

 avatar  avatar

Forkers

zeroows

neuralmf-pytorch's Issues

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.