Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
Crayon鑫
Paddle
提交
4e342208
P
Paddle
项目概览
Crayon鑫
/
Paddle
与 Fork 源项目一致
Fork自
PaddlePaddle / Paddle
通知
1
Star
1
Fork
0
代码
文件
提交
分支
Tags
贡献者
分支图
Diff
Issue
1
列表
看板
标记
里程碑
合并请求
0
Wiki
0
Wiki
分析
仓库
DevOps
项目成员
Pages
P
Paddle
项目概览
项目概览
详情
发布
仓库
仓库
文件
提交
分支
标签
贡献者
分支图
比较
Issue
1
Issue
1
列表
看板
标记
里程碑
合并请求
0
合并请求
0
Pages
分析
分析
仓库分析
DevOps
Wiki
0
Wiki
成员
成员
收起侧边栏
关闭侧边栏
动态
分支图
创建新Issue
提交
Issue看板
提交
4e342208
编写于
12月 20, 2016
作者:
Y
Yu Yang
提交者:
GitHub
12月 20, 2016
浏览文件
操作
浏览文件
下载
差异文件
Merge pull request
#970
from reyoung/feature/clean_parameter_updater_finish_pass
Remove unused cost parameter in ParameterUpdater
上级
06ea2bf7
71a316ea
变更
7
隐藏空白更改
内联
并排
Showing
7 changed file
with
14 addition
and
14 deletion
+14
-14
paddle/parameter/ParameterUpdaterBase.h
paddle/parameter/ParameterUpdaterBase.h
+3
-3
paddle/trainer/ParameterUpdater.h
paddle/trainer/ParameterUpdater.h
+4
-4
paddle/trainer/RemoteParameterUpdater.cpp
paddle/trainer/RemoteParameterUpdater.cpp
+2
-2
paddle/trainer/RemoteParameterUpdater.h
paddle/trainer/RemoteParameterUpdater.h
+2
-2
paddle/trainer/ThreadParameterUpdater.cpp
paddle/trainer/ThreadParameterUpdater.cpp
+1
-1
paddle/trainer/ThreadParameterUpdater.h
paddle/trainer/ThreadParameterUpdater.h
+1
-1
paddle/trainer/Trainer.cpp
paddle/trainer/Trainer.cpp
+1
-1
未找到文件。
paddle/parameter/ParameterUpdaterBase.h
浏览文件 @
4e342208
...
@@ -38,7 +38,7 @@ public:
...
@@ -38,7 +38,7 @@ public:
virtual
void
startPass
()
{}
virtual
void
startPass
()
{}
// called by Trainer then finishing a pass, ruturn true if pass accepted
// called by Trainer then finishing a pass, ruturn true if pass accepted
virtual
bool
finishPass
(
real
cost
=
0
)
{
return
true
;
}
virtual
bool
finishPass
()
{
return
true
;
}
// called by Trainer before backward() of a batch
// called by Trainer before backward() of a batch
// Return the type of pass it needs. This pass type will be passed
// Return the type of pass it needs. This pass type will be passed
...
@@ -112,9 +112,9 @@ public:
...
@@ -112,9 +112,9 @@ public:
[
&
](
int
tid
,
size_t
numThreads
)
{
updaters_
[
tid
]
->
startPass
();
});
[
&
](
int
tid
,
size_t
numThreads
)
{
updaters_
[
tid
]
->
startPass
();
});
}
}
virtual
bool
finishPass
(
real
cost
=
0
)
{
virtual
bool
finishPass
()
{
syncThreadPool_
->
execPlusOwner
(
syncThreadPool_
->
execPlusOwner
(
[
&
](
int
tid
,
size_t
numThreads
)
{
updaters_
[
tid
]
->
finishPass
(
cost
);
});
[
&
](
int
tid
,
size_t
numThreads
)
{
updaters_
[
tid
]
->
finishPass
();
});
return
true
;
return
true
;
}
}
...
...
paddle/trainer/ParameterUpdater.h
浏览文件 @
4e342208
...
@@ -102,9 +102,9 @@ public:
...
@@ -102,9 +102,9 @@ public:
* @param cost sum cost during one pass.
* @param cost sum cost during one pass.
* @return true if accept (used for owlqn).
* @return true if accept (used for owlqn).
*/
*/
virtual
bool
finishPass
(
real
cost
)
{
virtual
bool
finishPass
()
{
optimizer_
->
finishPass
();
optimizer_
->
finishPass
();
return
ParameterUpdater
::
finishPass
(
cost
);
return
ParameterUpdater
::
finishPass
();
}
}
/**
/**
...
@@ -220,9 +220,9 @@ public:
...
@@ -220,9 +220,9 @@ public:
averager_
->
startPass
();
averager_
->
startPass
();
SgdLocalUpdater
::
startPass
();
SgdLocalUpdater
::
startPass
();
}
}
virtual
bool
finishPass
(
real
cost
)
{
virtual
bool
finishPass
()
{
averager_
->
finishPass
();
averager_
->
finishPass
();
return
SgdLocalUpdater
::
finishPass
(
cost
);
return
SgdLocalUpdater
::
finishPass
();
}
}
/// apply the averaged parameter to PARAMETER_VALUE
/// apply the averaged parameter to PARAMETER_VALUE
...
...
paddle/trainer/RemoteParameterUpdater.cpp
浏览文件 @
4e342208
...
@@ -309,7 +309,7 @@ void RemoteParameterUpdater::startPass() {
...
@@ -309,7 +309,7 @@ void RemoteParameterUpdater::startPass() {
}
}
}
}
bool
RemoteParameterUpdater
::
finishPass
(
real
cost
)
{
bool
RemoteParameterUpdater
::
finishPass
()
{
if
(
localUpdater_
)
{
if
(
localUpdater_
)
{
localUpdater_
->
finishPass
();
localUpdater_
->
finishPass
();
}
}
...
@@ -712,7 +712,7 @@ void SparseRemoteParameterUpdater::startPass() {
...
@@ -712,7 +712,7 @@ void SparseRemoteParameterUpdater::startPass() {
}
}
}
}
bool
SparseRemoteParameterUpdater
::
finishPass
(
real
cost
)
{
bool
SparseRemoteParameterUpdater
::
finishPass
()
{
if
(
config_
.
algorithm
()
==
TrainAlgorithm
::
SGD
)
{
if
(
config_
.
algorithm
()
==
TrainAlgorithm
::
SGD
)
{
parameterClient_
->
waitPassFinish
();
parameterClient_
->
waitPassFinish
();
}
else
{
}
else
{
...
...
paddle/trainer/RemoteParameterUpdater.h
浏览文件 @
4e342208
...
@@ -90,7 +90,7 @@ public:
...
@@ -90,7 +90,7 @@ public:
*/
*/
virtual
void
finishBatch
(
real
cost
);
virtual
void
finishBatch
(
real
cost
);
virtual
void
startPass
();
virtual
void
startPass
();
virtual
bool
finishPass
(
real
cost
);
virtual
bool
finishPass
();
#ifndef PADDLE_DISABLE_TIMER
#ifndef PADDLE_DISABLE_TIMER
virtual
void
setForwardbackwardTime
(
uint64_t
delta
)
{
virtual
void
setForwardbackwardTime
(
uint64_t
delta
)
{
...
@@ -281,7 +281,7 @@ public:
...
@@ -281,7 +281,7 @@ public:
/// send all sparse related parameters to all pservers
/// send all sparse related parameters to all pservers
virtual
void
finishBatch
(
real
cost
);
virtual
void
finishBatch
(
real
cost
);
virtual
void
startPass
();
virtual
void
startPass
();
virtual
bool
finishPass
(
real
cost
);
virtual
bool
finishPass
();
virtual
void
apply
();
virtual
void
apply
();
virtual
void
restore
();
virtual
void
restore
();
...
...
paddle/trainer/ThreadParameterUpdater.cpp
浏览文件 @
4e342208
...
@@ -70,7 +70,7 @@ void SgdThreadUpdater::startPass() {
...
@@ -70,7 +70,7 @@ void SgdThreadUpdater::startPass() {
}
}
}
}
bool
SgdThreadUpdater
::
finishPass
(
real
cost
)
{
bool
SgdThreadUpdater
::
finishPass
()
{
catchUpWith
();
catchUpWith
();
for
(
auto
&
para
:
parameters_
)
{
for
(
auto
&
para
:
parameters_
)
{
...
...
paddle/trainer/ThreadParameterUpdater.h
浏览文件 @
4e342208
...
@@ -47,7 +47,7 @@ public:
...
@@ -47,7 +47,7 @@ public:
virtual
void
startPass
();
virtual
void
startPass
();
// Use the finishPass() function of the base optimizer.
// Use the finishPass() function of the base optimizer.
virtual
bool
finishPass
(
real
cost
);
virtual
bool
finishPass
();
virtual
void
init
(
const
std
::
vector
<
ParameterPtr
>&
parameters
);
virtual
void
init
(
const
std
::
vector
<
ParameterPtr
>&
parameters
);
virtual
PassType
startBatch
(
int64_t
batchSize
);
virtual
PassType
startBatch
(
int64_t
batchSize
);
...
...
paddle/trainer/Trainer.cpp
浏览文件 @
4e342208
...
@@ -537,7 +537,7 @@ void Trainer::trainOnePassBatch(int passId) {
...
@@ -537,7 +537,7 @@ void Trainer::trainOnePassBatch(int passId) {
trainerInternal_
.
getGradientMachine
()
->
onPassEnd
();
trainerInternal_
.
getGradientMachine
()
->
onPassEnd
();
bool
accepted
=
trainerInternal_
.
getParameterUpdater
()
->
finishPass
(
cost
);
bool
accepted
=
trainerInternal_
.
getParameterUpdater
()
->
finishPass
();
globalStat
.
setThreadInfo
(
true
);
globalStat
.
setThreadInfo
(
true
);
globalStat
.
printAllStatus
();
globalStat
.
printAllStatus
();
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录