keras-recommendation

Using Keras to implement recommender systems

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.

Main metrics

Overview
Name With Ownersonyisme/keras-recommendation
Primary LanguagePython
Program languagePython (Language Count: 1)
Platform
License:
所有者活动
Created At2016-12-09 23:07:20
Pushed At2016-12-19 23:16:03
Last Commit At2016-12-19 15:15:51
Release Count0
用户参与
Stargazers Count326
Watchers Count24
Fork Count96
Commits Count5
Has Issues Enabled
Issues Count3
Issue Open Count2
Pull Requests Count0
Pull Requests Open Count0
Pull Requests Close Count0
项目设置
Has Wiki Enabled
Is Archived
Is Fork
Is Locked
Is Mirror
Is Private