Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
六月暴雪飞梨花
Paddle
提交
22aacbfd
P
Paddle
项目概览
六月暴雪飞梨花
/
Paddle
与 Fork 源项目一致
Fork自
PaddlePaddle / Paddle
通知
1
Star
0
Fork
0
代码
文件
提交
分支
Tags
贡献者
分支图
Diff
Issue
0
列表
看板
标记
里程碑
合并请求
0
Wiki
0
Wiki
分析
仓库
DevOps
项目成员
Pages
P
Paddle
项目概览
项目概览
详情
发布
仓库
仓库
文件
提交
分支
标签
贡献者
分支图
比较
Issue
0
Issue
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
Pages
分析
分析
仓库分析
DevOps
Wiki
0
Wiki
成员
成员
收起侧边栏
关闭侧边栏
动态
分支图
创建新Issue
提交
Issue看板
体验新版 GitCode,发现更多精彩内容 >>
提交
22aacbfd
编写于
12月 21, 2016
作者:
Y
Yu Yang
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
Add const to GradientMachine::eval
上级
2965df51
变更
9
显示空白变更内容
内联
并排
Showing
9 changed file
with
9 addition
and
9 deletion
+9
-9
paddle/gserver/gradientmachines/GradientMachine.h
paddle/gserver/gradientmachines/GradientMachine.h
+1
-1
paddle/gserver/gradientmachines/MultiGradientMachine.cpp
paddle/gserver/gradientmachines/MultiGradientMachine.cpp
+1
-1
paddle/gserver/gradientmachines/MultiGradientMachine.h
paddle/gserver/gradientmachines/MultiGradientMachine.h
+1
-1
paddle/gserver/gradientmachines/MultiNetwork.cpp
paddle/gserver/gradientmachines/MultiNetwork.cpp
+1
-1
paddle/gserver/gradientmachines/MultiNetwork.h
paddle/gserver/gradientmachines/MultiNetwork.h
+1
-1
paddle/gserver/gradientmachines/NeuralNetwork.cpp
paddle/gserver/gradientmachines/NeuralNetwork.cpp
+1
-1
paddle/gserver/gradientmachines/NeuralNetwork.h
paddle/gserver/gradientmachines/NeuralNetwork.h
+1
-1
paddle/gserver/gradientmachines/RecurrentGradientMachine.cpp
paddle/gserver/gradientmachines/RecurrentGradientMachine.cpp
+1
-1
paddle/gserver/gradientmachines/RecurrentGradientMachine.h
paddle/gserver/gradientmachines/RecurrentGradientMachine.h
+1
-1
未找到文件。
paddle/gserver/gradientmachines/GradientMachine.h
浏览文件 @
22aacbfd
...
@@ -186,7 +186,7 @@ public:
...
@@ -186,7 +186,7 @@ public:
/**
/**
* evaluate using the given evaluator
* evaluate using the given evaluator
*/
*/
virtual
void
eval
(
Evaluator
*
evaluator
)
=
0
;
virtual
void
eval
(
Evaluator
*
evaluator
)
const
=
0
;
std
::
vector
<
ParameterPtr
>&
getParameters
()
{
return
parameters_
;
}
std
::
vector
<
ParameterPtr
>&
getParameters
()
{
return
parameters_
;
}
...
...
paddle/gserver/gradientmachines/MultiGradientMachine.cpp
浏览文件 @
22aacbfd
...
@@ -331,7 +331,7 @@ Evaluator* MultiGradientMachine::makeEvaluator() {
...
@@ -331,7 +331,7 @@ Evaluator* MultiGradientMachine::makeEvaluator() {
return
threads_
[
0
]
->
getGradientMachine
()
->
makeEvaluator
();
return
threads_
[
0
]
->
getGradientMachine
()
->
makeEvaluator
();
}
}
void
MultiGradientMachine
::
eval
(
Evaluator
*
evaluator
)
{
void
MultiGradientMachine
::
eval
(
Evaluator
*
evaluator
)
const
{
for
(
auto
&
thread
:
threads_
)
{
for
(
auto
&
thread
:
threads_
)
{
SetDevice
device
(
thread
->
getDeviceId
());
SetDevice
device
(
thread
->
getDeviceId
());
thread
->
getGradientMachine
()
->
eval
(
evaluator
);
thread
->
getGradientMachine
()
->
eval
(
evaluator
);
...
...
paddle/gserver/gradientmachines/MultiGradientMachine.h
浏览文件 @
22aacbfd
...
@@ -195,7 +195,7 @@ public:
...
@@ -195,7 +195,7 @@ public:
virtual
Evaluator
*
makeEvaluator
();
virtual
Evaluator
*
makeEvaluator
();
virtual
void
eval
(
Evaluator
*
evaluator
);
virtual
void
eval
(
Evaluator
*
evaluator
)
const
;
bool
useGpu
()
const
{
return
useGpu_
;
}
bool
useGpu
()
const
{
return
useGpu_
;
}
...
...
paddle/gserver/gradientmachines/MultiNetwork.cpp
浏览文件 @
22aacbfd
...
@@ -181,6 +181,6 @@ Evaluator* MultiNetwork::makeEvaluator() {
...
@@ -181,6 +181,6 @@ Evaluator* MultiNetwork::makeEvaluator() {
return
multiCombinedEvaluator
;
return
multiCombinedEvaluator
;
}
}
void
MultiNetwork
::
eval
(
Evaluator
*
evaluator
)
{
evaluator
->
eval
(
*
this
);
}
void
MultiNetwork
::
eval
(
Evaluator
*
evaluator
)
const
{
evaluator
->
eval
(
*
this
);
}
}
// namespace paddle
}
// namespace paddle
paddle/gserver/gradientmachines/MultiNetwork.h
浏览文件 @
22aacbfd
...
@@ -48,7 +48,7 @@ public:
...
@@ -48,7 +48,7 @@ public:
virtual
Evaluator
*
makeEvaluator
();
virtual
Evaluator
*
makeEvaluator
();
virtual
void
eval
(
Evaluator
*
evaluator
);
virtual
void
eval
(
Evaluator
*
evaluator
)
const
;
const
std
::
vector
<
std
::
unique_ptr
<
NeuralNetwork
>>&
getSubNetworks
()
const
{
const
std
::
vector
<
std
::
unique_ptr
<
NeuralNetwork
>>&
getSubNetworks
()
const
{
return
subNetworks_
;
return
subNetworks_
;
...
...
paddle/gserver/gradientmachines/NeuralNetwork.cpp
浏览文件 @
22aacbfd
...
@@ -383,7 +383,7 @@ Evaluator* NeuralNetwork::makeEvaluator() {
...
@@ -383,7 +383,7 @@ Evaluator* NeuralNetwork::makeEvaluator() {
return
combinedEvaluator
;
return
combinedEvaluator
;
}
}
void
NeuralNetwork
::
eval
(
Evaluator
*
evaluator
)
{
evaluator
->
eval
(
*
this
);
}
void
NeuralNetwork
::
eval
(
Evaluator
*
evaluator
)
const
{
evaluator
->
eval
(
*
this
);
}
void
NeuralNetwork
::
setOutputGrad
(
const
std
::
vector
<
Argument
>&
args
)
{
void
NeuralNetwork
::
setOutputGrad
(
const
std
::
vector
<
Argument
>&
args
)
{
CHECK_GE
(
outputLayers_
.
size
(),
args
.
size
());
CHECK_GE
(
outputLayers_
.
size
(),
args
.
size
());
...
...
paddle/gserver/gradientmachines/NeuralNetwork.h
浏览文件 @
22aacbfd
...
@@ -98,7 +98,7 @@ public:
...
@@ -98,7 +98,7 @@ public:
virtual
Evaluator
*
makeEvaluator
();
virtual
Evaluator
*
makeEvaluator
();
virtual
void
eval
(
Evaluator
*
evaluator
);
virtual
void
eval
(
Evaluator
*
evaluator
)
const
;
virtual
void
resetState
();
virtual
void
resetState
();
virtual
void
setOutputGrad
(
const
std
::
vector
<
Argument
>&
args
);
virtual
void
setOutputGrad
(
const
std
::
vector
<
Argument
>&
args
);
...
...
paddle/gserver/gradientmachines/RecurrentGradientMachine.cpp
浏览文件 @
22aacbfd
...
@@ -593,7 +593,7 @@ void RecurrentGradientMachine::forwardBackward(
...
@@ -593,7 +593,7 @@ void RecurrentGradientMachine::forwardBackward(
LOG
(
FATAL
)
<<
"should not use this function"
;
LOG
(
FATAL
)
<<
"should not use this function"
;
}
}
void
RecurrentGradientMachine
::
eval
(
Evaluator
*
evaluator
)
{
void
RecurrentGradientMachine
::
eval
(
Evaluator
*
evaluator
)
const
{
// call printers frame by frame
// call printers frame by frame
for
(
int
i
=
0
;
i
<
maxSequenceLength_
;
++
i
)
{
for
(
int
i
=
0
;
i
<
maxSequenceLength_
;
++
i
)
{
LOG
(
INFO
)
<<
"Recurrent Layer Group eval frame "
<<
i
<<
" begin"
;
LOG
(
INFO
)
<<
"Recurrent Layer Group eval frame "
<<
i
<<
" begin"
;
...
...
paddle/gserver/gradientmachines/RecurrentGradientMachine.h
浏览文件 @
22aacbfd
...
@@ -63,7 +63,7 @@ public:
...
@@ -63,7 +63,7 @@ public:
const
UpdateCallback
&
callback
);
const
UpdateCallback
&
callback
);
virtual
void
resetState
()
{}
virtual
void
resetState
()
{}
virtual
void
eval
(
Evaluator
*
evaluator
);
virtual
void
eval
(
Evaluator
*
evaluator
)
const
;
const
std
::
vector
<
int
>&
getParameterIds
()
{
return
parameterIds_
;
}
const
std
::
vector
<
int
>&
getParameterIds
()
{
return
parameterIds_
;
}
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录