Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
PaddlePaddle
Paddle
提交
0c70f34c
P
Paddle
项目概览
PaddlePaddle
/
Paddle
大约 1 年 前同步成功
通知
2298
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看板
提交
0c70f34c
编写于
6月 30, 2017
作者:
D
dangqingqing
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
Fix bug for flowers dataset and row_conv.
上级
c5dc0b73
变更
3
隐藏空白更改
内联
并排
Showing
3 changed file
with
14 addition
and
9 deletion
+14
-9
python/paddle/trainer/config_parser.py
python/paddle/trainer/config_parser.py
+2
-2
python/paddle/trainer_config_helpers/tests/configs/protostr/test_row_conv.protostr
...fig_helpers/tests/configs/protostr/test_row_conv.protostr
+1
-1
python/paddle/v2/dataset/flowers.py
python/paddle/v2/dataset/flowers.py
+11
-6
未找到文件。
python/paddle/trainer/config_parser.py
浏览文件 @
0c70f34c
...
...
@@ -2082,10 +2082,10 @@ class MaxOutLayer(LayerBase):
class
RowConvLayer
(
LayerBase
):
def
__init__
(
self
,
name
,
inputs
,
context_length
,
**
xargs
):
super
(
RowConvLayer
,
self
).
__init__
(
name
,
'
maxout
'
,
0
,
inputs
=
inputs
,
**
xargs
)
name
,
'
row_conv
'
,
0
,
inputs
=
inputs
,
**
xargs
)
config_assert
(
len
(
self
.
inputs
)
==
1
,
'
TransLayer must have one and only one input
'
)
'
row convolution layer must have one and only one input.
'
)
input_layer
=
self
.
get_input_layer
(
0
)
row_conv_conf
=
self
.
config
.
inputs
[
0
].
row_conv_conf
row_conv_conf
.
context_length
=
context_length
...
...
python/paddle/trainer_config_helpers/tests/configs/protostr/test_row_conv.protostr
浏览文件 @
0c70f34c
...
...
@@ -7,7 +7,7 @@ layers {
}
layers {
name: "__row_conv_layer_0__"
type: "
maxout
"
type: "
row_conv
"
size: 2560
active_type: "relu"
inputs {
...
...
python/paddle/v2/dataset/flowers.py
浏览文件 @
0c70f34c
...
...
@@ -30,6 +30,7 @@ http://www.robots.ox.ac.uk/~vgg/publications/papers/nilsback08.{pdf,ps.gz}.
"""
import
cPickle
import
itertools
import
functools
from
common
import
download
import
tarfile
import
scipy.io
as
scio
...
...
@@ -54,21 +55,25 @@ TEST_FLAG = 'trnid'
VALID_FLAG
=
'valid'
def
default_mapper
(
sample
):
def
default_mapper
(
is_train
,
sample
):
'''
map image bytes data to type needed by model input layer
'''
img
,
label
=
sample
img
=
load_image_bytes
(
img
)
img
=
simple_transform
(
img
,
256
,
224
,
True
)
img
=
simple_transform
(
img
,
256
,
224
,
is_train
)
return
img
.
flatten
().
astype
(
'float32'
),
label
train_mapper
=
functools
.
partial
(
default_mapper
,
True
)
test_mapper
=
functools
.
partial
(
default_mapper
,
False
)
def
reader_creator
(
data_file
,
label_file
,
setid_file
,
dataset_name
,
mapper
=
default_mapper
,
mapper
,
buffered_size
=
1024
,
use_xmap
=
True
):
'''
...
...
@@ -118,7 +123,7 @@ def reader_creator(data_file,
return
map_readers
(
mapper
,
reader
)
def
train
(
mapper
=
default
_mapper
,
buffered_size
=
1024
,
use_xmap
=
True
):
def
train
(
mapper
=
train
_mapper
,
buffered_size
=
1024
,
use_xmap
=
True
):
'''
Create flowers training set reader.
It returns a reader, each sample in the reader is
...
...
@@ -141,7 +146,7 @@ def train(mapper=default_mapper, buffered_size=1024, use_xmap=True):
buffered_size
,
use_xmap
)
def
test
(
mapper
=
defaul
t_mapper
,
buffered_size
=
1024
,
use_xmap
=
True
):
def
test
(
mapper
=
tes
t_mapper
,
buffered_size
=
1024
,
use_xmap
=
True
):
'''
Create flowers test set reader.
It returns a reader, each sample in the reader is
...
...
@@ -164,7 +169,7 @@ def test(mapper=default_mapper, buffered_size=1024, use_xmap=True):
buffered_size
,
use_xmap
)
def
valid
(
mapper
=
defaul
t_mapper
,
buffered_size
=
1024
,
use_xmap
=
True
):
def
valid
(
mapper
=
tes
t_mapper
,
buffered_size
=
1024
,
use_xmap
=
True
):
'''
Create flowers validation set reader.
It returns a reader, each sample in the reader is
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录