Code Monkey home page Code Monkey logo

gru4rec_tensorflow's Introduction

GRU4Rec_TensorFlow

TensorFlow implementation of GRu4Rec, which was descibed in "Session-based Recommendations With Recurrent Neural Networks". See paper: http://arxiv.org/abs/1511.06939.

Requirements

Python: 2.7

Pandas < 0.17

Numpy 1.12.1 or later

TensorFlow: 0.12.1

Usage

Train/Test file should consists of three columns:

 First column: SessionId  
 Second column: ItemId  
 Third column: Timestamps

To train a model with default parameter settings:

$ python main.py    

Other optional parameters include:   
 --layer: Number of GRU layers. Default is 1.  
 --size: Number of hidden units in GRU model. Default is 100.   
 --epoch: Runing epochs. Default is 3.   
 --lr : Initial learning rate. Default is 0.001.   
 --train: Specify whether training(1) or evaluating(0). Default is 1.   
 --hidden_act: Activation function used in GRU units. Default is tanh.   
 --final_act: Final activation function. Default is softmax.    
 --loss: Loss functions, cross-entropy, bpr or top1 loss. Default is cross-entropy.      
 --dropout: Dropout rate. Default is 0.5.

To evaluate a trained model:

$ python main.py --train 0

One optional parameter is:    
 --test: Specify which saved model to evaluate(only used when --train is 0). Default is 2.

Acknowledgement

This repository refers a lot to the original Theano implementation.

gru4rec_tensorflow's People

Contributors

songweiping avatar songwp avatar

Watchers

 avatar  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.