Code Monkey home page Code Monkey logo

nishantsharma / lambdaranktf Goto Github PK

View Code? Open in Web Editor NEW
9.0 2.0 1.0 31 KB

This module implements LambdaRank as a tensorflow OP in C++. As an example application, we use this OP as a loss function in our keras based deep ranking/recommendation engine. The ranking application embeds slide objects into d-dimensional space(slide2vec), such that we obtain best LambdaRank scores.

CMake 1.43% C++ 33.49% Python 64.45% Shell 0.62%
tensorflow lambdarank learning-to-rank c-plus-plus ndcg deep-learning

lambdaranktf's Introduction

This module implements LambdaRank as a tensorflow OP in C++. As an example application, we use this OP as a loss function in our keras based deep ranking/recommendation engine. The ranking application embeds slide objects into d-dimensional space(slide2vec), such that we obtain best LambdaRank scores.

Building the OP module: Following commands were issued to build the module.

TF_LFLAGS=( $(python -c 'import tensorflow as tf; print(" ".join(tf.sysconfig.get_link_flags()))') )

TF_CFLAGS=( $(python -c 'import tensorflow as tf; print(" ".join(tf.sysconfig.get_compile_flags()))') )

g++ -std=c++11 -shared lambdarank.cc -o liblambdarank.so -fPIC ${TF_CFLAGS[@]} ${TF_LFLAGS[@]} -O2

NOTES: Make sure that you always use batch_size as same as sample size. The underlying reason for that is all rows belonging to the same query must go into LambdaRankOp together. Example, when using TensorBoard with my keras model, I had to set the batch_size as INFINITY, because otherwise, I was risking incorrect computation.

lambdaranktf's People

Contributors

nishantsharma avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar

Forkers

useric

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.