Home

Awesome

<p align="center"> <img src="./res/logo big.png"> </p> <p align="center"> <a href='https://recnn.readthedocs.io/en/latest/?badge=latest'> <img src='https://readthedocs.org/projects/recnn/badge/?version=latest' alt='Documentation Status' /> </a> <a href='https://circleci.com/gh/awarebayes/RecNN'> <img src='https://circleci.com/gh/awarebayes/RecNN.svg?style=svg' alt='Documentation Status' /> </a> <a href="https://codeclimate.com/github/awarebayes/RecNN/maintainability"> <img src="https://api.codeclimate.com/v1/badges/d3a06ffe45906969239d/maintainability" /> </a> <a href="https://github.com/awarebayes/RecNN"> <img src="https://img.shields.io/github/stars/awarebayes/RecNN?style=social" /> </a> <a href="https://colab.research.google.com/github/awarebayes/RecNN/"> <img src="https://colab.research.google.com/assets/colab-badge.svg" /> </a> <a href="https://github.com/psf/black"> <img alt="Code style: black" src="https://img.shields.io/badge/code%20style-black-000000.svg"> </a> </p> <p align="center"> This is my school project. It focuses on Reinforcement Learning for personalized news recommendation. The main distinction is that it tries to solve online off-policy learning with dynamically generated item embeddings. I want to create a library with SOTA algorithms for reinforcement learning recommendation, providing the level of abstraction you like. </p> <p align="center"> <a href="https://recnn.readthedocs.io">recnn.readthedocs.io</a> </p>

πŸ“Š The features can be summed up to

πŸ“š Medium Articles

The repo consists of two parts: the library (./recnn), and the playground (./examples) where I explain how to work with certain things.

<p align="center"> <a href="https://towardsdatascience.com/reinforcement-learning-ddpg-and-td3-for-news-recommendation-d3cddec26011"> <img src="./res/article_1.png" width="70%"> </a> </p> <p align="center"> <a href="https://towardsdatascience.com/top-k-off-policy-correction-for-a-reinforce-recommender-system-e34381dceef8"> <img src="./res/article_2.png" width="70%"> </a> </p>

Algorithms that are/will be added

<p align="center">
AlgorithmPaperCode
Deep Q Learning (PoC)https://arxiv.org/abs/1312.5602examples/0. Embeddings/ 1.DQN
Deep Deterministic Policy Gradientshttps://arxiv.org/abs/1509.02971examples/1.Vanilla RL/DDPG
Twin Delayed DDPG (TD3)https://arxiv.org/abs/1802.09477examples/1.Vanilla RL/TD3
Soft Actor-Critichttps://arxiv.org/abs/1801.01290examples/1.Vanilla RL/SAC
Batch Constrained Q-Learninghttps://arxiv.org/abs/1812.02900examples/99.To be released/BCQ
REINFORCE Top-K Off-Policy Correctionhttps://arxiv.org/abs/1812.02353examples/2. REINFORCE TopK
</p>

‍Repos I used code from

πŸ€” What is this

<p align="center"> This is my school project. It focuses on Reinforcement Learning for personalized news recommendation. The main distinction is that it tries to solve online off-policy learning with dynamically generated item embeddings. Also, there is no exploration, since we are working with a dataset. In the example section, I use Google's BERT on the ML20M dataset to extract contextual information from the movie description to form the latent vector representations. Later, you can use the same transformation on new, previously unseen items (hence, the embeddings are dynamically generated). If you don't want to bother with embeddings pipeline, I have a DQN embeddings generator as a proof of concept. </p>

βœ‹ Getting Started

<p align="center"> <a href="https://colab.research.google.com/drive/1xWX4JQvlcx3mizwL4gB0THEyxw6LsXTL"><img src="https://i.postimg.cc/mDzKRc1K/code.png"></a> </p> <p align="center"> <a href="https://colab.research.google.com/drive/1xWX4JQvlcx3mizwL4gB0THEyxw6LsXTL"><img src="https://i.postimg.cc/D0Qjy1vp/get-started.png"></a> </p>

p.s. Image is clickable. here is direct link: <a href="https://colab.research.google.com/drive/1xWX4JQvlcx3mizwL4gB0THEyxw6LsXTL"> <img src="https://colab.research.google.com/assets/colab-badge.svg" /> </a>

To learn more about recnn, read the docs: <a href="https://recnn.readthedocs.io">recnn.readthedocs.io</a>

βš™οΈ Installing

pip install git+git://github.com/awarebayes/RecNN.git

PyPi is on its way...

πŸš€ Try demo

I built a Streamlit demo to showcase its features. It has 'recommend me a movie' feature! Note how the score changes when you rate the movies. When you start and the movies aren't rated (5/10 by default) the score is about ~40 (euc), but as you rate them it drops to <10, indicating more personalized and precise predictions. You can also test diversity, check out the correlation of recommendations, pairwise distances, and pinpoint accuracy.

Run it:

git clone git@github.com:awarebayes/RecNN.git 
cd RecNN && streamlit run examples/streamlit_demo.py

Docker image is available here

πŸ“ Downloads

πŸ“ Download the Models

πŸ“„ Citing

If you find RecNN useful for an academic publication, then please use the following BibTeX to cite it:

@misc{RecNN,
  author = {M Scherbina},
  title = {RecNN: RL Recommendation with PyTorch},
  year = {2019},
  publisher = {GitHub},
  journal = {GitHub repository},
  howpublished = {\url{https://github.com/awarebayes/RecNN}},
}