Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
PaddlePaddle
Paddle
提交
ba8a5c15
P
Paddle
项目概览
PaddlePaddle
/
Paddle
大约 1 年 前同步成功
通知
2299
Star
20931
Fork
5422
代码
文件
提交
分支
Tags
贡献者
分支图
Diff
Issue
1423
列表
看板
标记
里程碑
合并请求
543
Wiki
0
Wiki
分析
仓库
DevOps
项目成员
Pages
P
Paddle
项目概览
项目概览
详情
发布
仓库
仓库
文件
提交
分支
标签
贡献者
分支图
比较
Issue
1,423
Issue
1,423
列表
看板
标记
里程碑
合并请求
543
合并请求
543
Pages
分析
分析
仓库分析
DevOps
Wiki
0
Wiki
成员
成员
收起侧边栏
关闭侧边栏
动态
分支图
创建新Issue
提交
Issue看板
提交
ba8a5c15
编写于
9月 11, 2017
作者:
W
wanghaoshuang
浏览文件
操作
浏览文件
下载
差异文件
Merge branch 'develop' of
https://github.com/PaddlePaddle/Paddle
into pad_op
上级
e1da6c06
4fbc03d3
变更
9
显示空白变更内容
内联
并排
Showing
9 changed file
with
34 addition
and
28 deletion
+34
-28
paddle/gserver/layers/DetectionOutputLayer.cpp
paddle/gserver/layers/DetectionOutputLayer.cpp
+7
-1
paddle/gserver/layers/DetectionUtil.cpp
paddle/gserver/layers/DetectionUtil.cpp
+1
-1
paddle/gserver/layers/DetectionUtil.h
paddle/gserver/layers/DetectionUtil.h
+1
-1
paddle/platform/enforce.h
paddle/platform/enforce.h
+1
-18
paddle/scripts/docker/build.sh
paddle/scripts/docker/build.sh
+4
-0
python/paddle/trainer/config_parser.py
python/paddle/trainer/config_parser.py
+2
-2
python/paddle/trainer_config_helpers/layers.py
python/paddle/trainer_config_helpers/layers.py
+3
-1
python/paddle/v2/event.py
python/paddle/v2/event.py
+8
-2
python/paddle/v2/trainer.py
python/paddle/v2/trainer.py
+7
-2
未找到文件。
paddle/gserver/layers/DetectionOutputLayer.cpp
浏览文件 @
ba8a5c15
...
@@ -139,7 +139,13 @@ void DetectionOutputLayer::forward(PassType passType) {
...
@@ -139,7 +139,13 @@ void DetectionOutputLayer::forward(PassType passType) {
allDecodedBBoxes
,
allDecodedBBoxes
,
&
allIndices
);
&
allIndices
);
if
(
numKept
>
0
)
{
resetOutput
(
numKept
,
7
);
resetOutput
(
numKept
,
7
);
}
else
{
MatrixPtr
outV
=
getOutputValue
();
outV
=
NULL
;
return
;
}
MatrixPtr
outV
=
getOutputValue
();
MatrixPtr
outV
=
getOutputValue
();
getDetectionOutput
(
confBuffer_
->
getData
(),
getDetectionOutput
(
confBuffer_
->
getData
(),
numKept
,
numKept
,
...
...
paddle/gserver/layers/DetectionUtil.cpp
浏览文件 @
ba8a5c15
...
@@ -469,7 +469,7 @@ size_t getDetectionIndices(
...
@@ -469,7 +469,7 @@ size_t getDetectionIndices(
const
size_t
numClasses
,
const
size_t
numClasses
,
const
size_t
backgroundId
,
const
size_t
backgroundId
,
const
size_t
batchSize
,
const
size_t
batchSize
,
const
size_t
confThreshold
,
const
real
confThreshold
,
const
size_t
nmsTopK
,
const
size_t
nmsTopK
,
const
real
nmsThreshold
,
const
real
nmsThreshold
,
const
size_t
keepTopK
,
const
size_t
keepTopK
,
...
...
paddle/gserver/layers/DetectionUtil.h
浏览文件 @
ba8a5c15
...
@@ -275,7 +275,7 @@ size_t getDetectionIndices(
...
@@ -275,7 +275,7 @@ size_t getDetectionIndices(
const
size_t
numClasses
,
const
size_t
numClasses
,
const
size_t
backgroundId
,
const
size_t
backgroundId
,
const
size_t
batchSize
,
const
size_t
batchSize
,
const
size_t
confThreshold
,
const
real
confThreshold
,
const
size_t
nmsTopK
,
const
size_t
nmsTopK
,
const
real
nmsThreshold
,
const
real
nmsThreshold
,
const
size_t
keepTopK
,
const
size_t
keepTopK
,
...
...
paddle/platform/enforce.h
浏览文件 @
ba8a5c15
...
@@ -25,10 +25,6 @@ limitations under the License. */
...
@@ -25,10 +25,6 @@ limitations under the License. */
#include "paddle/string/printf.h"
#include "paddle/string/printf.h"
#include "paddle/string/to_string.h"
#include "paddle/string/to_string.h"
#ifdef __GNUC__
#include <cxxabi.h> // for __cxa_demangle
#endif
#ifndef PADDLE_ONLY_CPU
#ifndef PADDLE_ONLY_CPU
#include "paddle/platform/dynload/cublas.h"
#include "paddle/platform/dynload/cublas.h"
...
@@ -46,19 +42,6 @@ limitations under the License. */
...
@@ -46,19 +42,6 @@ limitations under the License. */
namespace
paddle
{
namespace
paddle
{
namespace
platform
{
namespace
platform
{
namespace
{
#ifdef __GNUC__
inline
std
::
string
demangle
(
std
::
string
name
)
{
int
status
=
-
4
;
// some arbitrary value to eliminate the compiler warning
std
::
unique_ptr
<
char
,
void
(
*
)(
void
*
)
>
res
{
abi
::
__cxa_demangle
(
name
.
c_str
(),
NULL
,
NULL
,
&
status
),
std
::
free
};
return
(
status
==
0
)
?
res
.
get
()
:
name
;
}
#else
inline
std
::
string
demangle
(
std
::
string
name
)
{
return
name
;
}
#endif
}
struct
EnforceNotMet
:
public
std
::
exception
{
struct
EnforceNotMet
:
public
std
::
exception
{
std
::
exception_ptr
exp_
;
std
::
exception_ptr
exp_
;
std
::
string
err_str_
;
std
::
string
err_str_
;
...
@@ -79,7 +62,7 @@ struct EnforceNotMet : public std::exception {
...
@@ -79,7 +62,7 @@ struct EnforceNotMet : public std::exception {
Dl_info
info
;
Dl_info
info
;
for
(
int
i
=
0
;
i
<
size
;
++
i
)
{
for
(
int
i
=
0
;
i
<
size
;
++
i
)
{
if
(
dladdr
(
call_stack
[
i
],
&
info
))
{
if
(
dladdr
(
call_stack
[
i
],
&
info
))
{
auto
demangled
=
demangle
(
info
.
dli_sname
)
;
auto
demangled
=
info
.
dli_sname
;
auto
addr_offset
=
static_cast
<
char
*>
(
call_stack
[
i
])
-
auto
addr_offset
=
static_cast
<
char
*>
(
call_stack
[
i
])
-
static_cast
<
char
*>
(
info
.
dli_saddr
);
static_cast
<
char
*>
(
info
.
dli_saddr
);
sout
<<
string
::
Sprintf
(
"%-3d %*0p %s + %zd
\n
"
,
i
,
sout
<<
string
::
Sprintf
(
"%-3d %*0p %s + %zd
\n
"
,
i
,
...
...
paddle/scripts/docker/build.sh
浏览文件 @
ba8a5c15
...
@@ -30,6 +30,8 @@ Configuring cmake in /paddle/build ...
...
@@ -30,6 +30,8 @@ Configuring cmake in /paddle/build ...
-DCMAKE_BUILD_TYPE=Release
-DCMAKE_BUILD_TYPE=Release
-DWITH_DOC=OFF
-DWITH_DOC=OFF
-DWITH_GPU=
${
WITH_GPU
:-
OFF
}
-DWITH_GPU=
${
WITH_GPU
:-
OFF
}
-DWITH_MKLDNN=
${
WITH_MKLDNN
:-
ON
}
-DWITH_MKLML=
${
WITH_MKLML
:-
ON
}
-DWITH_AVX=
${
WITH_AVX
:-
OFF
}
-DWITH_AVX=
${
WITH_AVX
:-
OFF
}
-DWITH_GOLANG=
${
WITH_GOLANG
:-
ON
}
-DWITH_GOLANG=
${
WITH_GOLANG
:-
ON
}
-DWITH_SWIG_PY=ON
-DWITH_SWIG_PY=ON
...
@@ -50,6 +52,8 @@ cmake .. \
...
@@ -50,6 +52,8 @@ cmake .. \
-DCMAKE_BUILD_TYPE
=
Release
\
-DCMAKE_BUILD_TYPE
=
Release
\
-DWITH_DOC
=
OFF
\
-DWITH_DOC
=
OFF
\
-DWITH_GPU
=
${
WITH_GPU
:-
OFF
}
\
-DWITH_GPU
=
${
WITH_GPU
:-
OFF
}
\
-DWITH_MKLDNN
=
${
WITH_MKLDNN
:-
ON
}
\
-DWITH_MKLML
=
${
WITH_MKLML
:-
ON
}
\
-DWITH_AVX
=
${
WITH_AVX
:-
OFF
}
\
-DWITH_AVX
=
${
WITH_AVX
:-
OFF
}
\
-DWITH_GOLANG
=
${
WITH_GOLANG
:-
ON
}
\
-DWITH_GOLANG
=
${
WITH_GOLANG
:-
ON
}
\
-DWITH_SWIG_PY
=
${
WITH_SWIG_PY
:-
ON
}
\
-DWITH_SWIG_PY
=
${
WITH_SWIG_PY
:-
ON
}
\
...
...
python/paddle/trainer/config_parser.py
浏览文件 @
ba8a5c15
...
@@ -3748,8 +3748,8 @@ class SwitchOrderLayer(LayerBase):
...
@@ -3748,8 +3748,8 @@ class SwitchOrderLayer(LayerBase):
def
__init__
(
self
,
name
,
inputs
,
reshape
,
**
xargs
):
def
__init__
(
self
,
name
,
inputs
,
reshape
,
**
xargs
):
super
(
SwitchOrderLayer
,
self
).
__init__
(
super
(
SwitchOrderLayer
,
self
).
__init__
(
name
,
'switch_order'
,
0
,
inputs
=
inputs
,
**
xargs
)
name
,
'switch_order'
,
0
,
inputs
=
inputs
,
**
xargs
)
self
.
config
.
reshape_conf
.
height
A
xis
.
extend
(
reshape
[
'height'
])
self
.
config
.
reshape_conf
.
height
_a
xis
.
extend
(
reshape
[
'height'
])
self
.
config
.
reshape_conf
.
width
A
xis
.
extend
(
reshape
[
'width'
])
self
.
config
.
reshape_conf
.
width
_a
xis
.
extend
(
reshape
[
'width'
])
# Deprecated, use a new layer specific class instead
# Deprecated, use a new layer specific class instead
...
...
python/paddle/trainer_config_helpers/layers.py
浏览文件 @
ba8a5c15
...
@@ -1223,7 +1223,8 @@ def detection_output_layer(input_loc,
...
@@ -1223,7 +1223,8 @@ def detection_output_layer(input_loc,
name
=
None
):
name
=
None
):
"""
"""
Apply the NMS to the output of network and compute the predict bounding
Apply the NMS to the output of network and compute the predict bounding
box location.
box location. The output of this layer could be None if there is no valid
bounding box.
:param name: The Layer Name.
:param name: The Layer Name.
:type name: basestring
:type name: basestring
...
@@ -6460,6 +6461,7 @@ def switch_order_layer(input,
...
@@ -6460,6 +6461,7 @@ def switch_order_layer(input,
return
LayerOutput
(
return
LayerOutput
(
name
=
name
,
name
=
name
,
layer_type
=
LayerType
.
SWITCH_ORDER_LAYER
,
layer_type
=
LayerType
.
SWITCH_ORDER_LAYER
,
activation
=
act
,
parents
=
input
,
parents
=
input
,
size
=
l
.
config
.
size
)
size
=
l
.
config
.
size
)
...
...
python/paddle/v2/event.py
浏览文件 @
ba8a5c15
...
@@ -53,10 +53,13 @@ class BeginPass(object):
...
@@ -53,10 +53,13 @@ class BeginPass(object):
class
EndPass
(
WithMetric
):
class
EndPass
(
WithMetric
):
"""
"""
Event On One Pass Training Complete.
Event On One Pass Training Complete.
To get the output of a specific layer, add "event.gm.getLayerOutputs('predict_layer')"
in your event_handler call back
"""
"""
def
__init__
(
self
,
pass_id
,
evaluator
):
def
__init__
(
self
,
pass_id
,
evaluator
,
gm
):
self
.
pass_id
=
pass_id
self
.
pass_id
=
pass_id
self
.
gm
=
gm
WithMetric
.
__init__
(
self
,
evaluator
)
WithMetric
.
__init__
(
self
,
evaluator
)
...
@@ -73,10 +76,13 @@ class BeginIteration(object):
...
@@ -73,10 +76,13 @@ class BeginIteration(object):
class
EndIteration
(
WithMetric
):
class
EndIteration
(
WithMetric
):
"""
"""
Event On One Batch Training Complete.
Event On One Batch Training Complete.
To get the output of a specific layer, add "event.gm.getLayerOutputs('predict_layer')"
in your event_handler call back
"""
"""
def
__init__
(
self
,
pass_id
,
batch_id
,
cost
,
evaluator
):
def
__init__
(
self
,
pass_id
,
batch_id
,
cost
,
evaluator
,
gm
):
self
.
pass_id
=
pass_id
self
.
pass_id
=
pass_id
self
.
batch_id
=
batch_id
self
.
batch_id
=
batch_id
self
.
cost
=
cost
self
.
cost
=
cost
self
.
gm
=
gm
WithMetric
.
__init__
(
self
,
evaluator
)
WithMetric
.
__init__
(
self
,
evaluator
)
python/paddle/v2/trainer.py
浏览文件 @
ba8a5c15
...
@@ -174,13 +174,18 @@ class SGD(object):
...
@@ -174,13 +174,18 @@ class SGD(object):
pass_id
=
pass_id
,
pass_id
=
pass_id
,
batch_id
=
batch_id
,
batch_id
=
batch_id
,
cost
=
cost
,
cost
=
cost
,
evaluator
=
batch_evaluator
))
evaluator
=
batch_evaluator
,
gm
=
self
.
__gradient_machine__
))
self
.
__parameter_updater__
.
finishBatch
(
cost
)
self
.
__parameter_updater__
.
finishBatch
(
cost
)
batch_evaluator
.
finish
()
batch_evaluator
.
finish
()
self
.
__parameter_updater__
.
finishPass
()
self
.
__parameter_updater__
.
finishPass
()
pass_evaluator
.
finish
()
pass_evaluator
.
finish
()
event_handler
(
v2_event
.
EndPass
(
pass_id
,
evaluator
=
pass_evaluator
))
event_handler
(
v2_event
.
EndPass
(
pass_id
,
evaluator
=
pass_evaluator
,
gm
=
self
.
__gradient_machine__
))
self
.
__gradient_machine__
.
finish
()
self
.
__gradient_machine__
.
finish
()
def
test
(
self
,
reader
,
feeding
=
None
):
def
test
(
self
,
reader
,
feeding
=
None
):
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录