资源简介
deepFM推荐模型,基于深度学习,内含测试数据和详细代码,可参考
代码片段和文件信息
“““
Tensorflow implementation of DeepFM [1]
Reference:
[1] DeepFM: A Factorization-Machine based Neural Network for CTR Prediction
Huifeng Guo Ruiming Tang Yunming Yey Zhenguo Li Xiuqiang He.
“““
import numpy as np
import tensorflow as tf
from sklearn.base import baseEstimator TransformerMixin
from sklearn.metrics import roc_auc_score
from time import time
from tensorflow.contrib.layers.python.layers import batch_norm as batch_norm
from yellowfin import YFOptimizer
class DeepFM(baseEstimator TransformerMixin):
def __init__(self feature_size field_size
embedding_size=8 dropout_fm=[1.0 1.0]
deep_layers=[32 32] dropout_deep=[0.5 0.5 0.5]
deep_layers_activation=tf.nn.relu
epoch=10 batch_size=256
learning_rate=0.001 optimizer_type=“adam“
batch_norm=0 batch_norm_decay=0.995
verbose=False random_seed=2016
use_fm=True use_deep=True
loss_type=“logloss“ eval_metric=roc_auc_score
l2_reg=0.0 greater_is_better=True):
assert (use_fm or use_deep)
assert loss_type in [“logloss“ “mse“] \
“loss_type can be either ‘logloss‘ for classification task or ‘mse‘ for regression task“
self.feature_size = feature_size # denote as M size of the feature dictionary
self.field_size = field_size # denote as F size of the feature fields
self.embedding_size = embedding_size # denote as K size of the feature embedding
self.dropout_fm = dropout_fm
self.deep_layers = deep_layers
self.dropout_deep = dropout_deep
self.deep_layers_activation = deep_layers_activation
self.use_fm = use_fm
self.use_deep = use_deep
self.l2_reg = l2_reg
self.epoch = epoch
self.batch_size = batch_size
self.learning_rate = learning_rate
self.optimizer_type = optimizer_type
self.batch_norm = batch_norm
self.batch_norm_decay = batch_norm_decay
self.verbose = verbose
self.random_seed = random_seed
self.loss_type = loss_type
self.eval_metric = eval_metric
self.greater_is_better = greater_is_better
self.train_result self.valid_result = [] []
self._init_graph()
def _init_graph(self):
self.graph = tf.Graph()
with self.graph.as_default():
tf.set_random_seed(self.random_seed)
self.feat_index = tf.placeholder(tf.int32 shape=[None None]
name=“feat_index“) # None * F
self.feat_value = tf.placeholder(tf.float32 shape=[None None]
name=“feat_value“) # None * F
self.label = tf.placeholder(tf.float32 shape=[None 1] name=“label“) # None * 1
self.dropout_keep_fm = tf.placeholder(tf.floa
属性 大小 日期 时间 名称
----------- --------- ---------- ----- ----
目录 0 2019-04-15 16:11 tensorflow-DeepFM-master\
目录 0 2019-04-15 16:19 tensorflow-DeepFM-master\.idea\
文件 138 2019-04-15 16:06 tensorflow-DeepFM-master\.idea\encodings.xm
文件 321 2019-04-15 16:18 tensorflow-DeepFM-master\.idea\misc.xm
文件 307 2019-04-15 16:06 tensorflow-DeepFM-master\.idea\modules.xm
文件 538 2019-04-15 16:18 tensorflow-DeepFM-master\.idea\tensorflow-DeepFM-master.iml
文件 188 2019-04-15 16:18 tensorflow-DeepFM-master\.idea\vcs.xm
文件 4917 2019-04-15 16:19 tensorflow-DeepFM-master\.idea\workspace.xm
文件 18787 2018-06-10 19:09 tensorflow-DeepFM-master\DeepFM.py
文件 4246 2018-06-10 19:09 tensorflow-DeepFM-master\README.md
目录 0 2019-04-15 14:20 tensorflow-DeepFM-master\example\
文件 3348 2018-06-10 19:09 tensorflow-DeepFM-master\example\DataReader.py
文件 171 2018-06-10 19:09 tensorflow-DeepFM-master\example\README.md
文件 0 2018-06-10 19:09 tensorflow-DeepFM-master\example\__init__.py
文件 1398 2018-06-10 19:09 tensorflow-DeepFM-master\example\config.py
目录 0 2019-04-15 14:28 tensorflow-DeepFM-master\example\data\
文件 138 2018-06-10 19:09 tensorflow-DeepFM-master\example\data\README.md
文件 12725557 2017-08-22 04:53 tensorflow-DeepFM-master\example\data\sample_submission.csv
文件 172006681 2017-08-22 04:53 tensorflow-DeepFM-master\example\data\test.csv
文件 115852544 2017-08-22 04:53 tensorflow-DeepFM-master\example\data\train.csv
目录 0 2019-04-15 14:20 tensorflow-DeepFM-master\example\fig\
文件 56504 2018-06-10 19:09 tensorflow-DeepFM-master\example\fig\DNN.png
文件 38926 2018-06-10 19:09 tensorflow-DeepFM-master\example\fig\DeepFM.png
文件 47512 2018-06-10 19:09 tensorflow-DeepFM-master\example\fig\FM.png
文件 5718 2018-06-10 19:09 tensorflow-DeepFM-master\example\main.py
文件 462 2018-06-10 19:09 tensorflow-DeepFM-master\example\metrics.py
目录 0 2019-04-15 14:20 tensorflow-DeepFM-master\example\output\
文件 29 2018-06-10 19:09 tensorflow-DeepFM-master\example\output\README.md
目录 0 2019-04-15 16:17 tensorflow-DeepFM-master\venv\
目录 0 2019-04-16 10:42 tensorflow-DeepFM-master\venv\Include\
目录 0 2019-04-15 16:11 tensorflow-DeepFM-master\venv\Lib\
............此处省略1135个文件信息
相关资源
- 深度学习花卉图片集--17分类
- 基于余数系统的sm2白盒数字签名
- 基于深度学习的人脸表情识别Tensorf
- MATALAB在智能算法30个案例分析和源代
- 《PyTorch深度学习实战侯宜军 著》&《
- 数学建模算法与应用第二版含程序.
- 算法笔记上机训练实战指南(高清完
- 机器视觉算法与应用高清双语版且含
- 魏秀参:解析卷积神经网络
- 多目标智能优化算法及其应用-雷德明
- 算法导论中文版_原书第3版(带目录)
- 算法与数据结构考研试题精析第三版
- 算法导论第三版 中文
- 机器视觉算法与应用_双语版高清完整
- 推荐系统 [ Recommender systems:An introduc
- 深度学习框架PyTorch:入门与实践.陈云
- MIT算法导论中文版
- STM32 LMS算法
- 算法概论 中文版.pdf
- 去雾算法 dehazing 最新顶级会议和期刊
- 统计学习基础中文版&英文版
- noip所有算法详解(非常全面)
- 吴恩达老师深度学习第四课卷积神经
- 深度学习框架Pytorch 入门与实践高清
- MIT深度神经网络硬件架构设计教程
- 数据挖掘:理论与算法自主模式-清华
- 算法竞赛入门经典(第二版)pdf源码
- 中科大-算法分析与设计课-课程ppt/考
- 《编程之美》PDF含源码,详细书签
- 变频调速SVPWM技术的原理、算法与应用
评论
共有 条评论