Coder Social home page Coder Social logo

infobpr's Introduction

InfoBPR

Simple Yet Powerful Ranking Loss

We provide InfoBPR API for both TensorFlow and PyTorch.

Paper: MGDCF: Distance Learning via Markov Graph Diffusion for Neural Collaborative Filtering

Homepage and Paper

Performance

MF (Matrix Factorization) can beat state-of-the-art GNN-based CF approaches with our InfoBPR Loss (MF-InfoBPR).

NDCG@20 of different approaches on Yelp2018

InfoBPR also can improve the optimization of CF models.

Installation

pip install info_bpr

Note that the installed info_bpr library support both TensorFlow and PyTorch.

Usage

For PyTorch users:

# coding=utf-8
import os
import torch
from info_bpr.losses import th_info_bpr as info_bpr

os.environ["CUDA_VISIBLE_DEVICES"] = "0"

num_users = 5
num_items = 5
embedding_size = 64
user_embeddings = torch.randn(num_users, embedding_size).cuda()
item_embeddings = torch.randn(num_items, embedding_size).cuda()
user_item_edges = [
    [0, 1],
    [0, 2],
    [2, 4],
    [3, 4]
]

ranking_loss = info_bpr(user_embeddings, item_embeddings, user_item_edges, num_negs=300)
print("InfoBPR Loss: ", ranking_loss)

DEMO

Matrix Factorization with InfoBPR Loss (MF-InfoBPR)

Cite

If you use InfoBPR in a scientific publication, we would appreciate citations to the following paper:

@misc{https://doi.org/10.48550/arxiv.2204.02338, doi = {10.48550/ARXIV.2204.02338},

url = {https://arxiv.org/abs/2204.02338},

author = {Hu, Jun and Qian, Shengsheng and Fang, Quan and Xu, Changsheng},

keywords = {Social and Information Networks (cs.SI), Machine Learning (cs.LG), FOS: Computer and information sciences, FOS: Computer and information sciences},

title = {MGDCF: Distance Learning via Markov Graph Diffusion for Neural Collaborative Filtering},

publisher = {arXiv},

year = {2022},

copyright = {arXiv.org perpetual, non-exclusive license} }

infobpr's People

Contributors

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