Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
BaiXuePrincess
PaddleRec
提交
af164aa2
P
PaddleRec
项目概览
BaiXuePrincess
/
PaddleRec
与 Fork 源项目一致
Fork自
PaddlePaddle / PaddleRec
通知
1
Star
0
Fork
0
代码
文件
提交
分支
Tags
贡献者
分支图
Diff
Issue
0
列表
看板
标记
里程碑
合并请求
0
Wiki
0
Wiki
分析
仓库
DevOps
项目成员
Pages
P
PaddleRec
项目概览
项目概览
详情
发布
仓库
仓库
文件
提交
分支
标签
贡献者
分支图
比较
Issue
0
Issue
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
Pages
分析
分析
仓库分析
DevOps
Wiki
0
Wiki
成员
成员
收起侧边栏
关闭侧边栏
动态
分支图
创建新Issue
提交
Issue看板
提交
af164aa2
编写于
5月 19, 2020
作者:
X
xujiaqi01
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
fix
上级
3e50521c
变更
7
显示空白变更内容
内联
并排
Showing
7 changed file
with
10 addition
and
2 deletion
+10
-2
core/model.py
core/model.py
+0
-1
core/trainers/transpiler_trainer.py
core/trainers/transpiler_trainer.py
+0
-1
models/rank/dcn/model.py
models/rank/dcn/model.py
+2
-0
models/rank/deepfm/model.py
models/rank/deepfm/model.py
+2
-0
models/rank/dnn/model.py
models/rank/dnn/model.py
+2
-0
models/rank/wide_deep/model.py
models/rank/wide_deep/model.py
+2
-0
models/rank/xdeepfm/model.py
models/rank/xdeepfm/model.py
+2
-0
未找到文件。
core/model.py
浏览文件 @
af164aa2
...
@@ -37,7 +37,6 @@ class Model(object):
...
@@ -37,7 +37,6 @@ class Model(object):
self
.
_fetch_interval
=
20
self
.
_fetch_interval
=
20
self
.
_namespace
=
"train.model"
self
.
_namespace
=
"train.model"
self
.
_platform
=
envs
.
get_platform
()
self
.
_platform
=
envs
.
get_platform
()
self
.
_init_slots
()
def
_init_slots
(
self
):
def
_init_slots
(
self
):
sparse_slots
=
envs
.
get_global_env
(
"sparse_slots"
,
None
,
"train.reader"
)
sparse_slots
=
envs
.
get_global_env
(
"sparse_slots"
,
None
,
"train.reader"
)
...
...
core/trainers/transpiler_trainer.py
浏览文件 @
af164aa2
...
@@ -234,7 +234,6 @@ class TranspileTrainer(Trainer):
...
@@ -234,7 +234,6 @@ class TranspileTrainer(Trainer):
startup_program
=
fluid
.
Program
()
startup_program
=
fluid
.
Program
()
with
fluid
.
unique_name
.
guard
():
with
fluid
.
unique_name
.
guard
():
with
fluid
.
program_guard
(
infer_program
,
startup_program
):
with
fluid
.
program_guard
(
infer_program
,
startup_program
):
self
.
model
.
_init_slots
()
self
.
model
.
infer_net
()
self
.
model
.
infer_net
()
if
self
.
model
.
_infer_data_loader
is
None
:
if
self
.
model
.
_infer_data_loader
is
None
:
...
...
models/rank/dcn/model.py
浏览文件 @
af164aa2
...
@@ -112,6 +112,7 @@ class Model(ModelBase):
...
@@ -112,6 +112,7 @@ class Model(ModelBase):
return
fluid
.
layers
.
reduce_sum
(
fluid
.
layers
.
square
(
w
))
return
fluid
.
layers
.
reduce_sum
(
fluid
.
layers
.
square
(
w
))
def
train_net
(
self
):
def
train_net
(
self
):
self
.
model
.
_init_slots
()
self
.
init_network
()
self
.
init_network
()
self
.
net_input
=
self
.
_create_embedding_input
()
self
.
net_input
=
self
.
_create_embedding_input
()
...
@@ -149,4 +150,5 @@ class Model(ModelBase):
...
@@ -149,4 +150,5 @@ class Model(ModelBase):
return
optimizer
return
optimizer
def
infer_net
(
self
,
parameter_list
):
def
infer_net
(
self
,
parameter_list
):
self
.
model
.
_init_slots
()
self
.
deepfm_net
()
self
.
deepfm_net
()
models/rank/deepfm/model.py
浏览文件 @
af164aa2
...
@@ -124,6 +124,7 @@ class Model(ModelBase):
...
@@ -124,6 +124,7 @@ class Model(ModelBase):
self
.
predict
=
fluid
.
layers
.
sigmoid
(
y_first_order
+
y_second_order
+
y_dnn
)
self
.
predict
=
fluid
.
layers
.
sigmoid
(
y_first_order
+
y_second_order
+
y_dnn
)
def
train_net
(
self
):
def
train_net
(
self
):
self
.
model
.
_init_slots
()
self
.
deepfm_net
()
self
.
deepfm_net
()
# ------------------------- Cost(logloss) --------------------------
# ------------------------- Cost(logloss) --------------------------
...
@@ -149,4 +150,5 @@ class Model(ModelBase):
...
@@ -149,4 +150,5 @@ class Model(ModelBase):
return
optimizer
return
optimizer
def
infer_net
(
self
,
parameter_list
):
def
infer_net
(
self
,
parameter_list
):
self
.
model
.
_init_slots
()
self
.
deepfm_net
()
self
.
deepfm_net
()
models/rank/dnn/model.py
浏览文件 @
af164aa2
...
@@ -88,6 +88,7 @@ class Model(ModelBase):
...
@@ -88,6 +88,7 @@ class Model(ModelBase):
self
.
_metrics
[
"BATCH_AUC"
]
=
batch_auc
self
.
_metrics
[
"BATCH_AUC"
]
=
batch_auc
def
train_net
(
self
):
def
train_net
(
self
):
self
.
model
.
_init_slots
()
self
.
input
()
self
.
input
()
self
.
net
()
self
.
net
()
self
.
avg_loss
()
self
.
avg_loss
()
...
@@ -99,5 +100,6 @@ class Model(ModelBase):
...
@@ -99,5 +100,6 @@ class Model(ModelBase):
return
optimizer
return
optimizer
def
infer_net
(
self
):
def
infer_net
(
self
):
self
.
model
.
_init_slots
()
self
.
input
()
self
.
input
()
self
.
net
()
self
.
net
()
models/rank/wide_deep/model.py
浏览文件 @
af164aa2
...
@@ -57,6 +57,7 @@ class Model(ModelBase):
...
@@ -57,6 +57,7 @@ class Model(ModelBase):
return
l3
return
l3
def
train_net
(
self
):
def
train_net
(
self
):
self
.
model
.
_init_slots
()
wide_input
=
self
.
_dense_data_var
[
0
]
wide_input
=
self
.
_dense_data_var
[
0
]
deep_input
=
self
.
_dense_data_var
[
1
]
deep_input
=
self
.
_dense_data_var
[
1
]
label
=
self
.
_sparse_data_var
[
0
]
label
=
self
.
_sparse_data_var
[
0
]
...
@@ -102,4 +103,5 @@ class Model(ModelBase):
...
@@ -102,4 +103,5 @@ class Model(ModelBase):
return
optimizer
return
optimizer
def
infer_net
(
self
,
parameter_list
):
def
infer_net
(
self
,
parameter_list
):
self
.
model
.
_init_slots
()
self
.
deepfm_net
()
self
.
deepfm_net
()
models/rank/xdeepfm/model.py
浏览文件 @
af164aa2
...
@@ -145,6 +145,7 @@ class Model(ModelBase):
...
@@ -145,6 +145,7 @@ class Model(ModelBase):
self
.
predict
=
fluid
.
layers
.
sigmoid
(
y_linear
+
y_cin
+
y_dnn
)
self
.
predict
=
fluid
.
layers
.
sigmoid
(
y_linear
+
y_cin
+
y_dnn
)
def
train_net
(
self
):
def
train_net
(
self
):
self
.
model
.
_init_slots
()
self
.
xdeepfm_net
()
self
.
xdeepfm_net
()
cost
=
fluid
.
layers
.
log_loss
(
input
=
self
.
predict
,
label
=
fluid
.
layers
.
cast
(
self
.
label
,
"float32"
),
epsilon
=
0.0000001
)
cost
=
fluid
.
layers
.
log_loss
(
input
=
self
.
predict
,
label
=
fluid
.
layers
.
cast
(
self
.
label
,
"float32"
),
epsilon
=
0.0000001
)
...
@@ -166,4 +167,5 @@ class Model(ModelBase):
...
@@ -166,4 +167,5 @@ class Model(ModelBase):
return
optimizer
return
optimizer
def
infer_net
(
self
,
parameter_list
):
def
infer_net
(
self
,
parameter_list
):
self
.
model
.
_init_slots
()
self
.
xdeepfm_net
()
self
.
xdeepfm_net
()
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录