Git Product home page Git Product logo

deep_rec's Introduction

本库用于存放推荐相关算法代码和文档

tfrecords/

存放tfrecords文件的生成和使用代码 利用spark读取数据保存成tfrecods这里提供两个思路。
1.如果集群上已经安装了tensorflow,可以用本文件下的代码进行处理。
2.对于没有安装tensorflow的集群,可以参考:spark-tensorflow-connector 来将数据转换成tfrecords。这个更快。

wd_model/

使用Dataset,Feature_columns ,Estimator这三个tensorflow API可以快速搭建99%的CTR预估模型。

但是离线测试发现 Feature_columns存在很大rt问题,差不多消耗了整个前向过程的1/3。对于小企业来说,serving性能没有做到最优,只能从模型端减少性能上的消耗。

所以这里我自己实现了一个wide&deep模型。支持连续特征,类别特征,embedding特征,特征交叉等常见操作,也支持list特征以及各种数据类型。能很方便的将生成的模型export,以及支持分布式训练。
修改模型的核心代码可以很方便的扩展到其他DNN模型,现在暂时只支持Wide,DNN,WD三类。

运行方式
  • 配置config/inputs.json,配置好输入的字段,以及需要做的操作,以及相对应的操作
  • 配置好对应的路径
  • 运行train_wd_model.py即可。
config/

存放模型配置文件

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.