Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
PaddlePaddle
PaddleRec
提交
801dfd34
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看板
提交
801dfd34
编写于
5月 19, 2020
作者:
T
tangwei
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
rename get_cost_op to avg_cost
上级
ba023dfb
变更
9
显示空白变更内容
内联
并排
Showing
9 changed file
with
12 addition
and
12 deletion
+12
-12
core/model.py
core/model.py
+1
-1
core/trainers/cluster_trainer.py
core/trainers/cluster_trainer.py
+2
-2
core/trainers/ctr_coding_trainer.py
core/trainers/ctr_coding_trainer.py
+1
-1
core/trainers/ctr_modul_trainer.py
core/trainers/ctr_modul_trainer.py
+2
-2
core/trainers/online_learning_trainer.py
core/trainers/online_learning_trainer.py
+1
-1
core/trainers/single_trainer.py
core/trainers/single_trainer.py
+2
-2
doc/design.md
doc/design.md
+1
-1
models/contentunderstanding/classification/model.py
models/contentunderstanding/classification/model.py
+1
-1
models/contentunderstanding/tagspace/model.py
models/contentunderstanding/tagspace/model.py
+1
-1
未找到文件。
core/model.py
浏览文件 @
801dfd34
...
@@ -47,7 +47,7 @@ class Model(object):
...
@@ -47,7 +47,7 @@ class Model(object):
def
get_infer_results
(
self
):
def
get_infer_results
(
self
):
return
self
.
_infer_results
return
self
.
_infer_results
def
get_
cost_op
(
self
):
def
get_
avg_cost
(
self
):
"""R
"""R
"""
"""
return
self
.
_cost
return
self
.
_cost
...
...
core/trainers/cluster_trainer.py
浏览文件 @
801dfd34
...
@@ -82,7 +82,7 @@ class ClusterTrainer(TranspileTrainer):
...
@@ -82,7 +82,7 @@ class ClusterTrainer(TranspileTrainer):
strategy
=
self
.
build_strategy
()
strategy
=
self
.
build_strategy
()
optimizer
=
fleet
.
distributed_optimizer
(
optimizer
,
strategy
)
optimizer
=
fleet
.
distributed_optimizer
(
optimizer
,
strategy
)
optimizer
.
minimize
(
self
.
model
.
get_
cost_op
())
optimizer
.
minimize
(
self
.
model
.
get_
avg_cost
())
if
fleet
.
is_server
():
if
fleet
.
is_server
():
context
[
'status'
]
=
'server_pass'
context
[
'status'
]
=
'server_pass'
...
@@ -114,7 +114,7 @@ class ClusterTrainer(TranspileTrainer):
...
@@ -114,7 +114,7 @@ class ClusterTrainer(TranspileTrainer):
program
=
fluid
.
compiler
.
CompiledProgram
(
program
=
fluid
.
compiler
.
CompiledProgram
(
fleet
.
main_program
).
with_data_parallel
(
fleet
.
main_program
).
with_data_parallel
(
loss_name
=
self
.
model
.
get_
cost_op
().
name
,
loss_name
=
self
.
model
.
get_
avg_cost
().
name
,
build_strategy
=
self
.
strategy
.
get_build_strategy
(),
build_strategy
=
self
.
strategy
.
get_build_strategy
(),
exec_strategy
=
self
.
strategy
.
get_execute_strategy
())
exec_strategy
=
self
.
strategy
.
get_execute_strategy
())
...
...
core/trainers/ctr_coding_trainer.py
浏览文件 @
801dfd34
...
@@ -88,7 +88,7 @@ class CtrPaddleTrainer(Trainer):
...
@@ -88,7 +88,7 @@ class CtrPaddleTrainer(Trainer):
optimizer
=
self
.
model
.
optimizer
()
optimizer
=
self
.
model
.
optimizer
()
optimizer
=
fleet
.
distributed_optimizer
(
optimizer
,
strategy
=
{
"use_cvm"
:
False
})
optimizer
=
fleet
.
distributed_optimizer
(
optimizer
,
strategy
=
{
"use_cvm"
:
False
})
optimizer
.
minimize
(
self
.
model
.
get_
cost_op
())
optimizer
.
minimize
(
self
.
model
.
get_
avg_cost
())
if
fleet
.
is_server
():
if
fleet
.
is_server
():
context
[
'status'
]
=
'server_pass'
context
[
'status'
]
=
'server_pass'
...
...
core/trainers/ctr_modul_trainer.py
浏览文件 @
801dfd34
...
@@ -129,7 +129,7 @@ class CtrPaddleTrainer(Trainer):
...
@@ -129,7 +129,7 @@ class CtrPaddleTrainer(Trainer):
model
=
self
.
_exector_context
[
executor
[
'name'
]][
'model'
]
model
=
self
.
_exector_context
[
executor
[
'name'
]][
'model'
]
self
.
_metrics
.
update
(
model
.
get_metrics
())
self
.
_metrics
.
update
(
model
.
get_metrics
())
runnnable_scope
.
append
(
scope
)
runnnable_scope
.
append
(
scope
)
runnnable_cost_op
.
append
(
model
.
get_
cost_op
())
runnnable_cost_op
.
append
(
model
.
get_
avg_cost
())
for
var
in
model
.
_data_var
:
for
var
in
model
.
_data_var
:
if
var
.
name
in
data_var_name_dict
:
if
var
.
name
in
data_var_name_dict
:
continue
continue
...
@@ -146,7 +146,7 @@ class CtrPaddleTrainer(Trainer):
...
@@ -146,7 +146,7 @@ class CtrPaddleTrainer(Trainer):
model
=
self
.
_exector_context
[
executor
[
'name'
]][
'model'
]
model
=
self
.
_exector_context
[
executor
[
'name'
]][
'model'
]
program
=
model
.
_build_param
[
'model'
][
'train_program'
]
program
=
model
.
_build_param
[
'model'
][
'train_program'
]
if
not
executor
[
'is_update_sparse'
]:
if
not
executor
[
'is_update_sparse'
]:
program
.
_fleet_opt
[
"program_configs"
][
str
(
id
(
model
.
get_
cost_op
().
block
.
program
))][
"push_sparse"
]
=
[]
program
.
_fleet_opt
[
"program_configs"
][
str
(
id
(
model
.
get_
avg_cost
().
block
.
program
))][
"push_sparse"
]
=
[]
if
'train_thread_num'
not
in
executor
:
if
'train_thread_num'
not
in
executor
:
executor
[
'train_thread_num'
]
=
self
.
global_config
[
'train_thread_num'
]
executor
[
'train_thread_num'
]
=
self
.
global_config
[
'train_thread_num'
]
with
fluid
.
scope_guard
(
scope
):
with
fluid
.
scope_guard
(
scope
):
...
...
core/trainers/online_learning_trainer.py
浏览文件 @
801dfd34
...
@@ -78,7 +78,7 @@ class ClusterTrainer(TranspileTrainer):
...
@@ -78,7 +78,7 @@ class ClusterTrainer(TranspileTrainer):
optimizer
=
self
.
model
.
optimizer
()
optimizer
=
self
.
model
.
optimizer
()
strategy
=
self
.
build_strategy
()
strategy
=
self
.
build_strategy
()
optimizer
=
fleet
.
distributed_optimizer
(
optimizer
,
strategy
)
optimizer
=
fleet
.
distributed_optimizer
(
optimizer
,
strategy
)
optimizer
.
minimize
(
self
.
model
.
get_
cost_op
())
optimizer
.
minimize
(
self
.
model
.
get_
avg_cost
())
if
fleet
.
is_server
():
if
fleet
.
is_server
():
context
[
'status'
]
=
'server_pass'
context
[
'status'
]
=
'server_pass'
...
...
core/trainers/single_trainer.py
浏览文件 @
801dfd34
...
@@ -47,7 +47,7 @@ class SingleTrainer(TranspileTrainer):
...
@@ -47,7 +47,7 @@ class SingleTrainer(TranspileTrainer):
def
init
(
self
,
context
):
def
init
(
self
,
context
):
self
.
model
.
train_net
()
self
.
model
.
train_net
()
optimizer
=
self
.
model
.
optimizer
()
optimizer
=
self
.
model
.
optimizer
()
optimizer
.
minimize
((
self
.
model
.
get_
cost_op
()))
optimizer
.
minimize
((
self
.
model
.
get_
avg_cost
()))
self
.
fetch_vars
=
[]
self
.
fetch_vars
=
[]
self
.
fetch_alias
=
[]
self
.
fetch_alias
=
[]
...
@@ -74,7 +74,7 @@ class SingleTrainer(TranspileTrainer):
...
@@ -74,7 +74,7 @@ class SingleTrainer(TranspileTrainer):
program
=
fluid
.
compiler
.
CompiledProgram
(
program
=
fluid
.
compiler
.
CompiledProgram
(
fluid
.
default_main_program
()).
with_data_parallel
(
fluid
.
default_main_program
()).
with_data_parallel
(
loss_name
=
self
.
model
.
get_
cost_op
().
name
)
loss_name
=
self
.
model
.
get_
avg_cost
().
name
)
metrics_varnames
=
[]
metrics_varnames
=
[]
metrics_format
=
[]
metrics_format
=
[]
...
...
doc/design.md
浏览文件 @
801dfd34
...
@@ -153,7 +153,7 @@ class Model(object):
...
@@ -153,7 +153,7 @@ class Model(object):
def
infer_net
(
self
):
def
infer_net
(
self
):
pass
pass
def
get_
cost_op
(
self
):
def
get_
avg_cost
(
self
):
return
self
.
_cost
return
self
.
_cost
```
```
...
...
models/contentunderstanding/classification/model.py
浏览文件 @
801dfd34
...
@@ -59,7 +59,7 @@ class Model(ModelBase):
...
@@ -59,7 +59,7 @@ class Model(ModelBase):
self
.
cost
=
avg_cost
self
.
cost
=
avg_cost
self
.
_metrics
[
"acc"
]
=
acc
self
.
_metrics
[
"acc"
]
=
acc
def
get_
cost_op
(
self
):
def
get_
avg_cost
(
self
):
return
self
.
cost
return
self
.
cost
def
get_metrics
(
self
):
def
get_metrics
(
self
):
...
...
models/contentunderstanding/tagspace/model.py
浏览文件 @
801dfd34
...
@@ -89,7 +89,7 @@ class Model(ModelBase):
...
@@ -89,7 +89,7 @@ class Model(ModelBase):
self
.
metrics
[
"correct"
]
=
correct
self
.
metrics
[
"correct"
]
=
correct
self
.
metrics
[
"cos_pos"
]
=
cos_pos
self
.
metrics
[
"cos_pos"
]
=
cos_pos
def
get_
cost_op
(
self
):
def
get_
avg_cost
(
self
):
return
self
.
cost
return
self
.
cost
def
get_metrics
(
self
):
def
get_metrics
(
self
):
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录