Giter VIP home page Giter VIP logo

keras-recommendation's Introduction

Keras Implementation of Recommender Systems

This library contains a modified version of Keras (mostly in the layers/core.py) to implement various recommender systems, including the Deep Structured Semantic Model (DSSM), Multi-View DSSM (MV-DSSM), Temporal DSSM (TDSSM) and matrix factorization (MF).

The examples can be found in the examples/ folder.

Contact: Yang Song (sonyisme AT google dot com)

Homepage: http://sonyis.me

Examples

Temporal DSSM

staticmodel=Sequential()
staticmodel.add(Dense(300,300))
staticmodel.add(Activation('tanh'))
tempmodel=Sequential()
tempmodel.add(LSTM(tempFea,300))
model=Sequential()
model.add(Merge([staticmodel, tempmodel],mode='concat'))
model.add(Dense(300+300,300))
model.add(Activation('tanh'))

DSSM and Multi-view DSSM

userModel = Sequential()
userModel.add(Dense(3883, 300))
userModel.add(Activation('tanh'))
userModel.add(Dropout(0.4))
userModel.add(Dense(300, 300))
userModel.add(Activation('tanh'))

itemModel = Sequential()
itemModel.add(TimeDistributedDense(6039, 300))
itemModel.add(Activation('tanh'))
itemModel.add(Dropout(0.4))
itemModel.add(TimeDistributedDense(300, 300))
itemModel.add(Activation('tanh'))

model=Sequential()
model.add(Cosine([userModel,itemModel])) #should output 2 values
model.add(Reshape(2))

Matrix Factorization on MovieLens

serModel = Sequential()
userModel.add(Dense(1682, 500))
userModel.add(Activation('tanh'))
userModel.add(Dropout(0.4))
userModel.add(Dense(500, 500))
userModel.add(Activation('tanh'))

itemModel = Sequential()
itemModel.add(TimeDistributedDense(943, 500))
itemModel.add(Activation('tanh'))
itemModel.add(Dropout(0.4))
itemModel.add(TimeDistributedDense(500, 500))
itemModel.add(Activation('tanh'))
model=Sequential()
model.add(ElementMul([userModel,itemModel])) #should output 2 values
model.add(TimeDistributedDense(500, 1))
model.add(Reshape(2))
y_score= model.get_output(train=False)
x_test=model.get_input(train=False)
model.add(Activation('softmax'))

References

[1] Yang Song, Ali Elkahky, and Xiaodong He, Multi-Rate Deep Learning for Temporal Recommendation, in SIGIR 2016.

[2] Ali Mamdouh Elkahky, Yang Song, and Xiaodong He, A Multi-View Deep Learning Approach for User Modeling in Recommendation Systems, in WWW 2015.

[3] Po-Sen Huang, Xiaodong He, Jianfeng Gao, Li Deng, Alex Acero and Larry Heck, Learning Deep Structured Semantic Models for Web Search using Clickthrough Data, in CIKM 2013.

keras-recommendation's People

Watchers

James Cloos avatar

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.