All Projects → tensorflow → Recommenders

tensorflow / Recommenders

Licence: apache-2.0
TensorFlow Recommenders is a library for building recommender system models using TensorFlow.

Programming Languages

python
139335 projects - #7 most used programming language

Projects that are alternatives of or similar to Recommenders

Product Nets
Tensorflow implementation of Product-based Neural Networks. An extended version is at https://github.com/Atomu2014/product-nets-distributed.
Stars: ✭ 355 (-52.79%)
Mutual labels:  recommender-system
Buffalo
TOROS Buffalo: A fast and scalable production-ready open source project for recommender systems
Stars: ✭ 498 (-33.78%)
Mutual labels:  recommender-system
Moviegeek
A django website used in the book Practical Recommender Systems to illustrate how recommender algorithms can be implemented.
Stars: ✭ 608 (-19.15%)
Mutual labels:  recommender-system
Recnn
Reinforced Recommendation toolkit built around pytorch 1.7
Stars: ✭ 362 (-51.86%)
Mutual labels:  recommender-system
Neural factorization machine
TenforFlow Implementation of Neural Factorization Machine
Stars: ✭ 422 (-43.88%)
Mutual labels:  recommender-system
Neural graph collaborative filtering
Neural Graph Collaborative Filtering, SIGIR2019
Stars: ✭ 517 (-31.25%)
Mutual labels:  recommender-system
Artificio
Deep Learning Computer Vision Algorithms for Real-World Use
Stars: ✭ 326 (-56.65%)
Mutual labels:  recommender-system
Awesome Recsys Papers
The awesome and classic papers in recommendation system!!! Good luck to every RecSys-learner!
Stars: ✭ 666 (-11.44%)
Mutual labels:  recommender-system
Recsim
A Configurable Recommender Systems Simulation Platform
Stars: ✭ 461 (-38.7%)
Mutual labels:  recommender-system
Newsrecommendsystem
个性化新闻推荐系统,A news recommendation system involving collaborative filtering,content-based recommendation and hot news recommendation, can be adapted easily to be put into use in other circumstances.
Stars: ✭ 557 (-25.93%)
Mutual labels:  recommender-system
Attentional factorization machine
TensorFlow Implementation of Attentional Factorization Machine
Stars: ✭ 362 (-51.86%)
Mutual labels:  recommender-system
Openlearning4deeprecsys
Some deep learning based recsys for open learning.
Stars: ✭ 383 (-49.07%)
Mutual labels:  recommender-system
Music recommender
Music recommender using deep learning with Keras and TensorFlow
Stars: ✭ 528 (-29.79%)
Mutual labels:  recommender-system
Lightfm
A Python implementation of LightFM, a hybrid recommendation algorithm.
Stars: ✭ 3,884 (+416.49%)
Mutual labels:  recommender-system
Knowledge graph attention network
KGAT: Knowledge Graph Attention Network for Recommendation, KDD2019
Stars: ✭ 610 (-18.88%)
Mutual labels:  recommender-system
Rspapers
A Curated List of Must-read Papers on Recommender System.
Stars: ✭ 4,140 (+450.53%)
Mutual labels:  recommender-system
Rsalgorithms
Some algorithms about traditional and social recommendation.
Stars: ✭ 500 (-33.51%)
Mutual labels:  recommender-system
Yedda
YEDDA: A Lightweight Collaborative Text Span Annotation Tool. Code for ACL 2018 Best Demo Paper Nomination.
Stars: ✭ 704 (-6.38%)
Mutual labels:  recommender-system
Recommender System With Tf2.0
Recurrence the recommender paper with Tensorflow2.0
Stars: ✭ 622 (-17.29%)
Mutual labels:  recommender-system
Recommendersystems
推荐系统
Stars: ✭ 527 (-29.92%)
Mutual labels:  recommender-system

TensorFlow Recommenders

TensorFlow Recommenders logo

TensorFlow Recommenders build badge PyPI badge

TensorFlow Recommenders is a library for building recommender system models using TensorFlow.

It helps with the full workflow of building a recommender system: data preparation, model formulation, training, evaluation, and deployment.

It's built on Keras and aims to have a gentle learning curve while still giving you the flexibility to build complex models.

Installation

Make sure you have TensorFlow 2.x installed, and install from pip:

pip install tensorflow-recommenders

Documentation

Have a look at our tutorials and API reference.

Quick start

Building a factorization model for the Movielens 100K dataset is very simple (Colab):

from typing import Dict, Text

import tensorflow as tf
import tensorflow_datasets as tfds
import tensorflow_recommenders as tfrs

# Ratings data.
ratings = tfds.load('movielens/100k-ratings', split="train")
# Features of all the available movies.
movies = tfds.load('movielens/100k-movies', split="train")

# Select the basic features.
ratings = ratings.map(lambda x: {
    "movie_id": tf.strings.to_number(x["movie_id"]),
    "user_id": tf.strings.to_number(x["user_id"])
})
movies = movies.map(lambda x: tf.strings.to_number(x["movie_id"]))

# Build a model.
class Model(tfrs.Model):

  def __init__(self):
    super().__init__()

    # Set up user representation.
    self.user_model = tf.keras.layers.Embedding(
        input_dim=2000, output_dim=64)
    # Set up movie representation.
    self.item_model = tf.keras.layers.Embedding(
        input_dim=2000, output_dim=64)
    # Set up a retrieval task and evaluation metrics over the
    # entire dataset of candidates.
    self.task = tfrs.tasks.Retrieval(
        metrics=tfrs.metrics.FactorizedTopK(
            candidates=movies.batch(128).map(self.item_model)
        )
    )

  def compute_loss(self, features: Dict[Text, tf.Tensor], training=False) -> tf.Tensor:

    user_embeddings = self.user_model(features["user_id"])
    movie_embeddings = self.item_model(features["movie_id"])

    return self.task(user_embeddings, movie_embeddings)


model = Model()
model.compile(optimizer=tf.keras.optimizers.Adagrad(0.5))

# Randomly shuffle data and split between train and test.
tf.random.set_seed(42)
shuffled = ratings.shuffle(100_000, seed=42, reshuffle_each_iteration=False)

train = shuffled.take(80_000)
test = shuffled.skip(80_000).take(20_000)

# Train.
model.fit(train.batch(4096), epochs=5)

# Evaluate.
model.evaluate(test.batch(4096), return_dict=True)
Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].