RecNN:围绕pytorch 1.7构建的增强推荐工具包

  • W9_157785
    了解作者
  • 2MB
    文件大小
  • zip
    文件格式
  • 0
    收藏次数
  • VIP专享
    资源类型
  • 0
    下载次数
  • 2022-06-15 04:34
    上传日期
这是我的学校项目。 它侧重于强化学习以进行个性化新闻推荐。 主要区别在于,它试图通过动态生成的项目嵌入来解决在线非政策学习。 我想使用SOTA算法创建一个库,以加强学习建议,并提供您喜欢的抽象级别。 :bar_chart: 这些功能可以总结为 根据您的决定进行抽象:您可以导入整个算法(例如DDPG)并将其告诉ddpg.learn(batch),可以分别导入网络和学习功能,为任务创建自定义加载程序,也可以自己定义所有内容。 示例不包含任何垃圾代码或变通办法:纯模型定义和算法本身在一个文件中。 我写了几篇文章解释其功能。 学习围绕支持ML20M等的顺序或框架环境构建。 Seq和Frame确定顺序数据的长度类型,seq是完全顺序动态大小(WIP),而帧只是静态帧。 状态表示模块具有多种方法。 对于顺序状态表示,可以使用LSTM / RNN / GRU(WIP) 使用Modin(Dask / Ray)并行数据加载和缓存 Pytorch 1.7支持Tensorboard可视化。 将来会添加新的数据集。 :books: 中篇文章 回购协议由两部分组成:库(./recnn)和游乐场(.
RecNN-master.zip
内容介绍
<p align="center"> </p> <p align="center"> <a href='https://recnn.readthedocs.io/en/latest/?badge=latest' rel='nofollow' onclick='return false;'> <img src='https://readthedocs.org/projects/recnn/badge/?version=latest' alt='Documentation Status' /> </a> <a href='https://circleci.com/gh/awarebayes/RecNN' rel='nofollow' onclick='return false;'> <img src='https://circleci.com/gh/awarebayes/RecNN.svg?style=svg' alt='Documentation Status' /> </a> <a href="https://codeclimate.com/github/awarebayes/RecNN/maintainability" rel='nofollow' onclick='return false;'> <img src="https://api.codeclimate.com/v1/badges/d3a06ffe45906969239d/maintainability" /> </a> <a href="https://github.com/awarebayes/RecNN" rel='nofollow' onclick='return false;'> <img src="https://img.shields.io/github/stars/awarebayes/RecNN?style=social" /> </a> <a href="https://colab.research.google.com/github/awarebayes/RecNN/" rel='nofollow' onclick='return false;'> <img src="https://colab.research.google.com/assets/colab-badge.svg" /> </a> <a href="https://github.com/psf/black" rel='nofollow' onclick='return false;'> <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" rel='nofollow' onclick='return false;'>recnn.readthedocs.io</a> </p> ### 📊 The features can be summed up to - Abstract as you decide: you can import the entire algorithm (say DDPG) and tell it to ddpg.learn(batch), you can import networks and the learning function separately, create a custom loader for your task, or can define everything by yourself. - Examples do not contain any of the junk code or workarounds: pure model definition and the algorithm itself in one file. I wrote a couple of articles explaining how it functions. - The learning is built around sequential or frame environment that supports ML20M and like. Seq and Frame determine the length type of sequential data, seq is fully sequential dynamic size (WIP), while the frame is just a static frame. - State Representation module with various methods. For sequential state representation, you can use LSTM/RNN/GRU (WIP) - Parallel data loading with Modin (Dask / Ray) and caching - Pytorch 1.7 support with Tensorboard visualization. - New datasets will be added in the future. ## 📚 Medium Articles The repo consists of two parts: the library (./recnn), and the playground (./examples) where I explain how to work with certain things. - Pretty much what you need to get started with this library if you know recommenders but don't know much about reinforcement learning: <p align="center"> <a href="https://towardsdatascience.com/reinforcement-learning-ddpg-and-td3-for-news-recommendation-d3cddec26011" rel='nofollow' onclick='return false;'> </a> </p> - Top-K Off-Policy Correction for a REINFORCE Recommender System: <p align="center"> <a href="https://towardsdatascience.com/top-k-off-policy-correction-for-a-reinforce-recommender-system-e34381dceef8" rel='nofollow' onclick='return false;'> </a> </p> ## Algorithms that are/will be added <p align="center"> | Algorithm | Paper | Code | |---------------------------------------|----------------------------------|----------------------------| | Deep Q Learning (PoC) | https://arxiv.org/abs/1312.5602 | examples/0. Embeddings/ 1.DQN | | Deep Deterministic Policy Gradients | https://arxiv.org/abs/1509.02971 | examples/1.Vanilla RL/DDPG | | Twin Delayed DDPG (TD3) | https://arxiv.org/abs/1802.09477 | examples/1.Vanilla RL/TD3 | | Soft Actor-Critic | https://arxiv.org/abs/1801.01290 | examples/1.Vanilla RL/SAC | | Batch Constrained Q-Learning | https://arxiv.org/abs/1812.02900 | examples/99.To be released/BCQ | | REINFORCE Top-K Off-Policy Correction | https://arxiv.org/abs/1812.02353 | examples/2. REINFORCE TopK | </p> ### ‍Repos I used code from - Sfujim's [BCQ](https://github.com/sfujim/BCQ) (not implemented yet) - Higgsfield's [RL Adventure 2](https://github.com/higgsfield/RL-Adventure-2) (great inspiration) ### 🤔 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" rel='nofollow' onclick='return false;'><img src="https://i.postimg.cc/mDzKRc1K/code.png"></a> </p> <p align="center"> <a href="https://colab.research.google.com/drive/1xWX4JQvlcx3mizwL4gB0THEyxw6LsXTL" rel='nofollow' onclick='return false;'><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" rel='nofollow' onclick='return false;'> <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" rel='nofollow' onclick='return false;'>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](https://www.streamlit.io/) 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](https://github.com/awarebayes/recnn-demo) ## 📁 Downloads - [MovieLens 20M](https://grouplens.org/datasets/movielens/20m/) - [Movie Embeddings](https://drive.google.com/open?id=1EQ_zXBR3DKpmJR3jBgLvt-xoOvArGMsL) - [Misc Data](https://drive.google.com/open?id=1TclEmCnZN_Xkl3TfUXL5ivPYmLnIjQSu) - [Parsed (omdb,tmdb)](https://drive.google.com/open?id=1t0LNCbqLjiLkAMFwtP8OIYU-zPUCNAjK) ## 📁 [Download the Models](https://drive.google.com/file/d/1goGa15XZmDAp2msZvRi2v_1h9xfmnhz7/view?usp=sharing) ## 📄 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}}, } ```
评论
    相关推荐
    • GRU.py.zip
      时间序列预测,利用GRU模型预测客流、车流时间序列
    • GRU.rar
      使用GRU网络预测时间序列数据,结合石油测井数据进行曲线预测
    • residual_gru.rar
      Gru network based on residual input realizes image compression
    • batch normalization 和 layer normalization 在RNN(LSTM、GRU)上的Tensor
      batch normalization 和 layer normalization 在RNN(LSTM、GRU)上的TensorFlow实现;运行无误,示例为mnist手写体识别
    • DACON_Class_of_Motion:[DACON]운동분류AI경진대회
      DACON_Classification_of_Motion 분류AI분류 모델 文件명 설명 日志损失값 ... 4月GRU층+提前停止기능가(deepGRU_es_submission.csv) 1.8980 提前停止이것보다나은성능 [21.02.11] [4] DeepLSTM_E
    • PyTorch-Batch-Attention-Seq2seq-master.zip
      PyTorch中的快速批处理Bi-RNN(GRU)编码器和注意解码器实现 这段代码是用PyTorch 0.2编写的。 在PyTorch发行其1.0版本时,已经有很多基于PyTorch构建的出色的seq2seq学习包,例如OpenNMT,AllenNLP等。您可以从其源...
    • GRU4REC-pytorch:使用PyTorch的GRU4REC的另一种实现
      GRU4REC-PyTorch GRU4REC模型的PyTorch实现。 原始论文: 对原始论文的扩展: 这个代码是基于由Younghun宋(YHS-968),并实现 此版本支持TOP1,BPR,TOP1-max,BPR-max和交叉熵损失。 要求 PyTorch 0.4.1 的...
    • GenotypeImputationGRU
      基因型输入 火车示例 python train.py --root-dir data/org_data/ --model-config-dir model/config/ --epochs 10 --batch-size 4 --region 1
    • AIS 量化:轴突初始段 (AIS) 的定量测量-matlab开发
      ais.m 量化了适当免疫染色的神经元组织中轴突初始段 (AIS) 位置和长度的... ais_auto.m(由 Dennis Kruijssen 编写)允许在标签非常干净时对 AIS 长度进行半自动测量,并且可以与 batch_ais_auto.m 结合到批量分析中。
    • GRU神经网络 Python代码
      基于Keras的GRU神经网络实现 Python编写 可以直接运行得到结果