Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
PaddlePaddle
PaddleRec
提交
aa581082
P
PaddleRec
项目概览
PaddlePaddle
/
PaddleRec
通知
68
Star
12
Fork
5
代码
文件
提交
分支
Tags
贡献者
分支图
Diff
Issue
27
列表
看板
标记
里程碑
合并请求
10
Wiki
1
Wiki
分析
仓库
DevOps
项目成员
Pages
P
PaddleRec
项目概览
项目概览
详情
发布
仓库
仓库
文件
提交
分支
标签
贡献者
分支图
比较
Issue
27
Issue
27
列表
看板
标记
里程碑
合并请求
10
合并请求
10
Pages
分析
分析
仓库分析
DevOps
Wiki
1
Wiki
成员
成员
收起侧边栏
关闭侧边栏
动态
分支图
创建新Issue
提交
Issue看板
提交
aa581082
编写于
8月 27, 2019
作者:
X
xiexionghang
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
fix code style
上级
b380a55f
变更
12
显示空白变更内容
内联
并排
Showing
12 changed file
with
14 addition
and
10 deletion
+14
-10
paddle/fluid/train/custom_trainer/feed/scripts/create_programs.py
...luid/train/custom_trainer/feed/scripts/create_programs.py
+9
-3
paddle/fluid/train/custom_trainer/feed/scripts/example.py
paddle/fluid/train/custom_trainer/feed/scripts/example.py
+1
-1
paddle/fluid/train/custom_trainer/feed/scripts/join.py
paddle/fluid/train/custom_trainer/feed/scripts/join.py
+1
-1
paddle/fluid/train/custom_trainer/feed/scripts/model/join/main_program
...train/custom_trainer/feed/scripts/model/join/main_program
+0
-0
paddle/fluid/train/custom_trainer/feed/scripts/model/join/model.yaml
...d/train/custom_trainer/feed/scripts/model/join/model.yaml
+1
-2
paddle/fluid/train/custom_trainer/feed/scripts/model/join/startup_program
...in/custom_trainer/feed/scripts/model/join/startup_program
+0
-0
paddle/fluid/train/custom_trainer/feed/scripts/model/join/test_program
...train/custom_trainer/feed/scripts/model/join/test_program
+0
-0
paddle/fluid/train/custom_trainer/feed/scripts/model/update/main_program
...ain/custom_trainer/feed/scripts/model/update/main_program
+0
-0
paddle/fluid/train/custom_trainer/feed/scripts/model/update/model.yaml
...train/custom_trainer/feed/scripts/model/update/model.yaml
+1
-2
paddle/fluid/train/custom_trainer/feed/scripts/model/update/startup_program
.../custom_trainer/feed/scripts/model/update/startup_program
+0
-0
paddle/fluid/train/custom_trainer/feed/scripts/model/update/test_program
...ain/custom_trainer/feed/scripts/model/update/test_program
+0
-0
paddle/fluid/train/custom_trainer/feed/scripts/update.py
paddle/fluid/train/custom_trainer/feed/scripts/update.py
+1
-1
未找到文件。
paddle/fluid/train/custom_trainer/feed/scripts/create_programs.py
浏览文件 @
aa581082
...
...
@@ -95,8 +95,14 @@ class ModelBuilder:
main_program
=
fluid
.
Program
()
startup_program
=
fluid
.
Program
()
with
fluid
.
program_guard
(
main_program
,
startup_program
):
#TODO return dict maybe better ?
input_accessor
,
sparses
,
inputs
,
outputs
,
monitors
=
self
.
_inference
()
#input_accessor, sparses, inputs, outputs, monitors
inference_info
=
self
.
_inference
()
inputs
=
inference_info
[
'inputs'
]
outputs
=
inference_info
[
'outputs'
]
sparses
=
inference_info
[
'sparses'
]
monitors
=
inference_info
[
'monitors'
]
input_accessor
=
inference_info
[
'accessors'
]
test_program
=
main_program
.
clone
(
for_test
=
True
)
loss
,
labels
=
self
.
_loss_function
(
*
outputs
)
...
...
@@ -149,7 +155,7 @@ class ModelBuilder:
'loss'
:
loss
.
name
,
'input_accessor'
:
input_accessor
,
'monitor'
:
monitors
,
'aa_Attention'
:
'Do Not Modify This File Manually, Unless You Really Know It'
'aa_Attention'
:
'Do Not Modify This File Manually, Unless You Really Know It'
}
with
open
(
model_desc_path
,
'w'
)
as
f
:
...
...
paddle/fluid/train/custom_trainer/feed/scripts/example.py
浏览文件 @
aa581082
...
...
@@ -32,7 +32,7 @@ def inference():
net
=
fluid
.
layers
.
fc
(
net
,
128
,
act
=
'relu'
,
name
=
'fc_7'
)
ctr_output
=
fluid
.
layers
.
fc
(
net
,
1
,
act
=
'sigmoid'
,
name
=
'ctr'
)
return
[],
[],
[
cvm_input
],
[
ctr_output
],
monitors
return
{
'accessors'
:
[],
'monitors'
:
[],
'sparses'
:
[],
'inputs'
:
[
cvm_input
],
'outputs'
:
[
ctr_output
]}
def
loss_function
(
ctr_output
):
"""
...
...
paddle/fluid/train/custom_trainer/feed/scripts/join.py
浏览文件 @
aa581082
...
...
@@ -50,7 +50,7 @@ def inference():
{
"name"
:
"epoch_auc"
,
"class"
:
"AucMonitor"
,
"target"
:
ctr_output
,
"compute_interval"
:
600
},
{
"name"
:
"day_auc"
,
"class"
:
"AucMonitor"
,
"target"
:
ctr_output
,
"compute_interval"
:
86400
}
]
return
accessors
,
[
sparse_cvm
],
[
cvm_input
],
[
ctr_output
],
monitors
return
{
'accessors'
:
accessors
,
'monitors'
:
monitors
,
'sparses'
:
[
sparse_cvm
],
'inputs'
:
[
cvm_input
],
'outputs'
:
[
ctr_output
]}
def
loss_function
(
ctr_output
):
"""
...
...
paddle/fluid/train/custom_trainer/feed/scripts/model/join/main_program
浏览文件 @
aa581082
无法预览此类型文件
paddle/fluid/train/custom_trainer/feed/scripts/model/join/model.yaml
浏览文件 @
aa581082
...
...
@@ -100,8 +100,7 @@ labels:
shape
:
[
-1
,
1
]
loss
:
loss_ctr
monitor
:
-
{
class
:
AucMonitor
,
compute_interval
:
3600
,
name
:
epoch_auc
,
target
:
ctr.tmp_2
,
target_idx
:
0
}
-
{
class
:
AucMonitor
,
compute_interval
:
600
,
name
:
epoch_auc
,
target
:
ctr.tmp_2
,
target_idx
:
0
}
-
{
class
:
AucMonitor
,
compute_interval
:
86400
,
name
:
day_auc
,
target
:
ctr.tmp_2
,
target_idx
:
0
}
outputs
:
-
name
:
ctr.tmp_2
...
...
paddle/fluid/train/custom_trainer/feed/scripts/model/join/startup_program
浏览文件 @
aa581082
无法预览此类型文件
paddle/fluid/train/custom_trainer/feed/scripts/model/join/test_program
浏览文件 @
aa581082
无法预览此类型文件
paddle/fluid/train/custom_trainer/feed/scripts/model/update/main_program
浏览文件 @
aa581082
无法预览此类型文件
paddle/fluid/train/custom_trainer/feed/scripts/model/update/model.yaml
浏览文件 @
aa581082
...
...
@@ -81,8 +81,7 @@ labels:
shape
:
[
-1
,
1
]
loss
:
loss_ctr
monitor
:
-
{
class
:
AucMonitor
,
compute_interval
:
3600
,
name
:
epoch_auc
,
target
:
ctr.tmp_2
,
target_idx
:
0
}
-
{
class
:
AucMonitor
,
compute_interval
:
600
,
name
:
epoch_auc
,
target
:
ctr.tmp_2
,
target_idx
:
0
}
-
{
class
:
AucMonitor
,
compute_interval
:
86400
,
name
:
day_auc
,
target
:
ctr.tmp_2
,
target_idx
:
0
}
outputs
:
-
name
:
ctr.tmp_2
...
...
paddle/fluid/train/custom_trainer/feed/scripts/model/update/startup_program
浏览文件 @
aa581082
无法预览此类型文件
paddle/fluid/train/custom_trainer/feed/scripts/model/update/test_program
浏览文件 @
aa581082
无法预览此类型文件
paddle/fluid/train/custom_trainer/feed/scripts/update.py
浏览文件 @
aa581082
...
...
@@ -43,7 +43,7 @@ def inference():
{
"name"
:
"day_auc"
,
"class"
:
"AucMonitor"
,
"target"
:
ctr_output
,
"compute_interval"
:
86400
}
]
return
accessors
,
[
sparse_cvm
],
[
cvm_input
],
[
ctr_output
],
monitors
return
{
'accessors'
:
accessors
,
'monitors'
:
monitors
,
'sparses'
:
[
sparse_cvm
],
'inputs'
:
[
cvm_input
],
'outputs'
:
[
ctr_output
]}
def
loss_function
(
ctr_output
):
"""
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录