Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
PaddlePaddle
PaddleDetection
提交
03889bab
P
PaddleDetection
项目概览
PaddlePaddle
/
PaddleDetection
大约 1 年 前同步成功
通知
694
Star
11112
Fork
2696
代码
文件
提交
分支
Tags
贡献者
分支图
Diff
Issue
184
列表
看板
标记
里程碑
合并请求
40
Wiki
0
Wiki
分析
仓库
DevOps
项目成员
Pages
P
PaddleDetection
项目概览
项目概览
详情
发布
仓库
仓库
文件
提交
分支
标签
贡献者
分支图
比较
Issue
184
Issue
184
列表
看板
标记
里程碑
合并请求
40
合并请求
40
Pages
分析
分析
仓库分析
DevOps
Wiki
0
Wiki
成员
成员
收起侧边栏
关闭侧边栏
动态
分支图
创建新Issue
提交
Issue看板
体验新版 GitCode,发现更多精彩内容 >>
提交
03889bab
编写于
3月 13, 2017
作者:
P
Peng Li
浏览文件
操作
浏览文件
下载
差异文件
Merge branch 'develop' into fix-crf-weight-and-coeff-bug
上级
bf838034
b07be67e
变更
2
隐藏空白更改
内联
并排
Showing
2 changed file
with
39 addition
and
62 deletion
+39
-62
cmake/external/protobuf.cmake
cmake/external/protobuf.cmake
+8
-0
python/paddle/trainer/config_parser.py
python/paddle/trainer/config_parser.py
+31
-62
未找到文件。
cmake/external/protobuf.cmake
浏览文件 @
03889bab
...
@@ -16,6 +16,14 @@ INCLUDE(ExternalProject)
...
@@ -16,6 +16,14 @@ INCLUDE(ExternalProject)
FIND_PACKAGE
(
Protobuf 3.1
)
FIND_PACKAGE
(
Protobuf 3.1
)
IF
(
PROTOBUF_FOUND
)
EXEC_PROGRAM
(
${
PROTOBUF_PROTOC_EXECUTABLE
}
ARGS --version OUTPUT_VARIABLE PROTOBUF_VERSION
)
STRING
(
REGEX MATCH
"[0-9]+.[0-9]+"
PROTOBUF_VERSION
"
${
PROTOBUF_VERSION
}
"
)
IF
(
${
PROTOBUF_VERSION
}
VERSION_LESS
"3.1.0"
)
SET
(
PROTOBUF_FOUND OFF
)
ENDIF
()
ENDIF
(
PROTOBUF_FOUND
)
IF
(
NOT PROTOBUF_FOUND
)
IF
(
NOT PROTOBUF_FOUND
)
SET
(
PROTOBUF_SOURCES_DIR
${
THIRD_PARTY_PATH
}
/protobuf
)
SET
(
PROTOBUF_SOURCES_DIR
${
THIRD_PARTY_PATH
}
/protobuf
)
SET
(
PROTOBUF_INSTALL_DIR
${
THIRD_PARTY_PATH
}
/install/protobuf
)
SET
(
PROTOBUF_INSTALL_DIR
${
THIRD_PARTY_PATH
}
/install/protobuf
)
...
...
python/paddle/trainer/config_parser.py
浏览文件 @
03889bab
...
@@ -2301,14 +2301,9 @@ def Generator(
...
@@ -2301,14 +2301,9 @@ def Generator(
@
config_layer
(
'expand'
)
@
config_layer
(
'expand'
)
class
ExpandLayer
(
LayerBase
):
class
ExpandLayer
(
LayerBase
):
def
__init__
(
self
,
def
__init__
(
self
,
name
,
inputs
,
trans_type
=
'non-seq'
,
bias
=
False
,
**
xargs
):
name
,
inputs
,
trans_type
=
'non-seq'
,
device
=
None
,
bias
=
False
):
super
(
ExpandLayer
,
self
).
__init__
(
super
(
ExpandLayer
,
self
).
__init__
(
name
,
'expand'
,
0
,
inputs
=
inputs
,
device
=
device
)
name
,
'expand'
,
0
,
inputs
=
inputs
,
**
xargs
)
config_assert
(
config_assert
(
len
(
self
.
inputs
)
==
2
,
'ExpandLayer takes 2 and only 2 inputs'
)
len
(
self
.
inputs
)
==
2
,
'ExpandLayer takes 2 and only 2 inputs'
)
self
.
config
.
trans_type
=
trans_type
self
.
config
.
trans_type
=
trans_type
...
@@ -2339,11 +2334,10 @@ class MaxLayer(LayerBase):
...
@@ -2339,11 +2334,10 @@ class MaxLayer(LayerBase):
inputs
,
inputs
,
trans_type
=
'non-seq'
,
trans_type
=
'non-seq'
,
active_type
=
'linear'
,
active_type
=
'linear'
,
device
=
None
,
bias
=
False
,
bias
=
False
,
output_max_index
=
None
):
output_max_index
=
None
,
super
(
MaxLayer
,
self
).
__init__
(
**
xargs
):
name
,
'max'
,
0
,
inputs
=
inputs
,
device
=
device
)
super
(
MaxLayer
,
self
).
__init__
(
name
,
'max'
,
0
,
inputs
=
inputs
,
**
xargs
)
config_assert
(
len
(
self
.
inputs
)
==
1
,
'MaxLayer must have 1 input'
)
config_assert
(
len
(
self
.
inputs
)
==
1
,
'MaxLayer must have 1 input'
)
self
.
config
.
trans_type
=
trans_type
self
.
config
.
trans_type
=
trans_type
self
.
config
.
active_type
=
active_type
self
.
config
.
active_type
=
active_type
...
@@ -2390,15 +2384,15 @@ class SequenceLastInstanceLayer(LayerBase):
...
@@ -2390,15 +2384,15 @@ class SequenceLastInstanceLayer(LayerBase):
inputs
,
inputs
,
active_type
=
'linear'
,
active_type
=
'linear'
,
trans_type
=
'non-seq'
,
trans_type
=
'non-seq'
,
device
=
Non
e
,
bias
=
Fals
e
,
bias
=
False
):
**
xargs
):
super
(
SequenceLastInstanceLayer
,
self
).
__init__
(
super
(
SequenceLastInstanceLayer
,
self
).
__init__
(
name
,
name
,
'seqlastins'
,
'seqlastins'
,
0
,
0
,
inputs
=
inputs
,
inputs
=
inputs
,
device
=
devic
e
,
active_type
=
active_typ
e
,
active_type
=
active_type
)
**
xargs
)
config_assert
(
config_assert
(
len
(
inputs
)
==
1
,
'SequenceLastInstanceLayer must have 1 input'
)
len
(
inputs
)
==
1
,
'SequenceLastInstanceLayer must have 1 input'
)
self
.
config
.
trans_type
=
trans_type
self
.
config
.
trans_type
=
trans_type
...
@@ -2410,39 +2404,29 @@ class SequenceLastInstanceLayer(LayerBase):
...
@@ -2410,39 +2404,29 @@ class SequenceLastInstanceLayer(LayerBase):
@
config_layer
(
'seqfirstins'
)
@
config_layer
(
'seqfirstins'
)
class
SequenceFirstInstanceLayer
(
SequenceLastInstanceLayer
):
class
SequenceFirstInstanceLayer
(
SequenceLastInstanceLayer
):
def
__init__
(
def
__init__
(
self
,
self
,
name
,
name
,
inputs
,
inputs
,
active_type
=
'linear'
,
active_type
=
'linear'
,
trans_type
=
'non-seq'
,
trans_type
=
'non-seq'
,
bias
=
False
,
device
=
None
,
**
xargs
):
bias
=
False
,
):
super
(
SequenceFirstInstanceLayer
,
self
).
__init__
(
super
(
SequenceFirstInstanceLayer
,
self
).
__init__
(
name
,
name
,
inputs
=
inputs
,
active_type
=
active_type
,
bias
=
bias
,
**
xargs
)
inputs
=
inputs
,
active_type
=
active_type
,
device
=
device
,
bias
=
bias
)
self
.
config
.
trans_type
=
trans_type
self
.
config
.
trans_type
=
trans_type
self
.
config
.
select_first
=
True
self
.
config
.
select_first
=
True
@
config_layer
(
'seqconcat'
)
@
config_layer
(
'seqconcat'
)
class
SequenceConcatLayer
(
LayerBase
):
class
SequenceConcatLayer
(
LayerBase
):
def
__init__
(
self
,
def
__init__
(
self
,
name
,
inputs
,
active_type
=
'linear'
,
bias
=
False
,
**
xargs
):
name
,
inputs
,
active_type
=
'linear'
,
device
=
None
,
bias
=
False
):
super
(
SequenceConcatLayer
,
self
).
__init__
(
super
(
SequenceConcatLayer
,
self
).
__init__
(
name
,
name
,
'seqconcat'
,
'seqconcat'
,
0
,
0
,
inputs
=
inputs
,
inputs
=
inputs
,
device
=
devic
e
,
active_type
=
active_typ
e
,
active_type
=
active_type
)
**
xargs
)
config_assert
(
config_assert
(
len
(
inputs
)
==
2
,
'SequenceConcatLayer must have 2 inputs'
)
len
(
inputs
)
==
2
,
'SequenceConcatLayer must have 2 inputs'
)
for
input_index
in
xrange
(
len
(
self
.
inputs
)):
for
input_index
in
xrange
(
len
(
self
.
inputs
)):
...
@@ -2458,15 +2442,15 @@ class SequenceReshapeLayer(LayerBase):
...
@@ -2458,15 +2442,15 @@ class SequenceReshapeLayer(LayerBase):
size
,
size
,
inputs
,
inputs
,
active_type
=
'linear'
,
active_type
=
'linear'
,
device
=
Non
e
,
bias
=
Fals
e
,
bias
=
False
):
**
xargs
):
super
(
SequenceReshapeLayer
,
self
).
__init__
(
super
(
SequenceReshapeLayer
,
self
).
__init__
(
name
,
name
,
'seqreshape'
,
'seqreshape'
,
size
,
size
,
inputs
=
inputs
,
inputs
=
inputs
,
device
=
devic
e
,
active_type
=
active_typ
e
,
active_type
=
active_type
)
**
xargs
)
config_assert
(
config_assert
(
len
(
inputs
)
==
1
,
'SequenceReshapeLayer must have 1 inputs'
)
len
(
inputs
)
==
1
,
'SequenceReshapeLayer must have 1 inputs'
)
self
.
set_layer_size
(
size
)
self
.
set_layer_size
(
size
)
...
@@ -2475,19 +2459,9 @@ class SequenceReshapeLayer(LayerBase):
...
@@ -2475,19 +2459,9 @@ class SequenceReshapeLayer(LayerBase):
@
config_layer
(
'subseq'
)
@
config_layer
(
'subseq'
)
class
SubSequenceLayer
(
LayerBase
):
class
SubSequenceLayer
(
LayerBase
):
def
__init__
(
self
,
def
__init__
(
self
,
name
,
inputs
,
active_type
=
'linear'
,
bias
=
False
,
**
xargs
):
name
,
inputs
,
active_type
=
'linear'
,
device
=
None
,
bias
=
False
):
super
(
SubSequenceLayer
,
self
).
__init__
(
super
(
SubSequenceLayer
,
self
).
__init__
(
name
,
name
,
'subseq'
,
0
,
inputs
=
inputs
,
active_type
=
active_type
,
**
xargs
)
'subseq'
,
0
,
inputs
=
inputs
,
device
=
device
,
active_type
=
active_type
)
config_assert
(
len
(
inputs
)
==
3
,
'SubSequenceLayer must have 3 inputs'
)
config_assert
(
len
(
inputs
)
==
3
,
'SubSequenceLayer must have 3 inputs'
)
input_layer0
=
self
.
get_input_layer
(
0
)
input_layer0
=
self
.
get_input_layer
(
0
)
size
=
input_layer0
.
size
size
=
input_layer0
.
size
...
@@ -2644,15 +2618,10 @@ class AverageLayer(LayerBase):
...
@@ -2644,15 +2618,10 @@ class AverageLayer(LayerBase):
average_strategy
=
'average'
,
average_strategy
=
'average'
,
trans_type
=
'non-seq'
,
trans_type
=
'non-seq'
,
active_type
=
'linear'
,
active_type
=
'linear'
,
device
=
Non
e
,
bias
=
Fals
e
,
bias
=
False
):
**
xargs
):
super
(
AverageLayer
,
self
).
__init__
(
super
(
AverageLayer
,
self
).
__init__
(
name
,
name
,
'average'
,
0
,
inputs
=
inputs
,
active_type
=
active_type
,
**
xargs
)
'average'
,
0
,
inputs
=
inputs
,
device
=
device
,
active_type
=
active_type
)
self
.
config
.
average_strategy
=
average_strategy
self
.
config
.
average_strategy
=
average_strategy
self
.
config
.
trans_type
=
trans_type
self
.
config
.
trans_type
=
trans_type
config_assert
(
len
(
inputs
)
==
1
,
'AverageLayer must have 1 input'
)
config_assert
(
len
(
inputs
)
==
1
,
'AverageLayer must have 1 input'
)
...
@@ -2676,9 +2645,9 @@ class CosSimLayer(LayerBase):
...
@@ -2676,9 +2645,9 @@ class CosSimLayer(LayerBase):
@
config_layer
(
'tensor'
)
@
config_layer
(
'tensor'
)
class
TensorLayer
(
LayerBase
):
class
TensorLayer
(
LayerBase
):
def
__init__
(
self
,
name
,
size
,
inputs
,
device
=
None
,
bias
=
True
,
**
xargs
):
def
__init__
(
self
,
name
,
size
,
inputs
,
bias
=
True
,
**
xargs
):
super
(
TensorLayer
,
self
).
__init__
(
super
(
TensorLayer
,
self
).
__init__
(
name
,
'tensor'
,
size
,
inputs
=
inputs
,
device
=
device
,
**
xargs
)
name
,
'tensor'
,
size
,
inputs
=
inputs
,
**
xargs
)
config_assert
(
len
(
self
.
inputs
)
==
2
,
'TensorLayer must have 2 inputs'
)
config_assert
(
len
(
self
.
inputs
)
==
2
,
'TensorLayer must have 2 inputs'
)
config_assert
(
size
>
0
,
'size must be positive'
)
config_assert
(
size
>
0
,
'size must be positive'
)
config_assert
(
inputs
[
1
].
parameter_name
==
None
,
config_assert
(
inputs
[
1
].
parameter_name
==
None
,
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录