Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
PaddlePaddle
Paddle
提交
904a43b0
P
Paddle
项目概览
PaddlePaddle
/
Paddle
1 年多 前同步成功
通知
2302
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看板
提交
904a43b0
编写于
11月 11, 2016
作者:
Q
QiJune
提交者:
GitHub
11月 11, 2016
浏览文件
操作
浏览文件
下载
差异文件
Merge pull request #440 from reyoung/feature/fix_pydataprovider_multiple_obj_bugs
Feature/fix pydataprovider multiple obj bugs
上级
3fc338ad
4607d517
变更
5
隐藏空白更改
内联
并排
Showing
5 changed file
with
101 addition
and
2 deletion
+101
-2
python/paddle/trainer_config_helpers/data_sources.py
python/paddle/trainer_config_helpers/data_sources.py
+1
-1
python/paddle/trainer_config_helpers/tests/configs/generate_protostr.sh
...trainer_config_helpers/tests/configs/generate_protostr.sh
+7
-0
python/paddle/trainer_config_helpers/tests/configs/protostr/test_split_datasource.protostr
...ers/tests/configs/protostr/test_split_datasource.protostr
+72
-0
python/paddle/trainer_config_helpers/tests/configs/test_split_datasource.py
...ner_config_helpers/tests/configs/test_split_datasource.py
+12
-0
python/paddle/utils/dump_config.py
python/paddle/utils/dump_config.py
+9
-1
未找到文件。
python/paddle/trainer_config_helpers/data_sources.py
浏览文件 @
904a43b0
...
@@ -139,7 +139,7 @@ def define_py_data_sources(train_list, test_list, module, obj, args=None,
...
@@ -139,7 +139,7 @@ def define_py_data_sources(train_list, test_list, module, obj, args=None,
test_obj
=
obj
test_obj
=
obj
train_obj
=
obj
train_obj
=
obj
if
__is_splitable__
(
obj
):
if
__is_splitable__
(
obj
):
train_
module
,
test_module
=
module
train_
obj
,
test_obj
=
obj
if
args
is
None
:
if
args
is
None
:
args
=
""
args
=
""
...
...
python/paddle/trainer_config_helpers/tests/configs/generate_protostr.sh
浏览文件 @
904a43b0
...
@@ -13,9 +13,16 @@ img_layers img_trans_layers util_layers simple_rnn_layers unused_layers test_cos
...
@@ -13,9 +13,16 @@ img_layers img_trans_layers util_layers simple_rnn_layers unused_layers test_cos
test_rnn_group shared_fc shared_lstm test_cost_layers_with_weight
test_rnn_group shared_fc shared_lstm test_cost_layers_with_weight
test_spp_layer test_bilinear_interp test_maxout test_bi_grumemory math_ops
)
test_spp_layer test_bilinear_interp test_maxout test_bi_grumemory math_ops
)
whole_configs
=(
test_split_datasource
)
for
conf
in
${
configs
[*]
}
for
conf
in
${
configs
[*]
}
do
do
echo
"Generating "
$conf
echo
"Generating "
$conf
python
-m
paddle.utils.dump_config
$conf
.py
>
$protostr
/
$conf
.protostr.unitest
python
-m
paddle.utils.dump_config
$conf
.py
>
$protostr
/
$conf
.protostr.unitest
done
done
for
conf
in
${
whole_configs
[*]
}
do
echo
"Generating "
$conf
python
-m
paddle.utils.dump_config
$conf
.py
""
--whole
>
$protostr
/
$conf
.protostr.unitest
done
python/paddle/trainer_config_helpers/tests/configs/protostr/test_split_datasource.protostr
0 → 100644
浏览文件 @
904a43b0
model_config {
type: "nn"
layers {
name: "a"
type: "data"
size: 10
active_type: ""
}
input_layer_names: "a"
output_layer_names: "a"
sub_models {
name: "root"
layer_names: "a"
input_layer_names: "a"
output_layer_names: "a"
is_recurrent_layer_group: false
}
}
data_config {
type: "py2"
files: "train.list"
async_load_data: true
for_test: false
load_data_module: "a"
load_data_object: "c"
load_data_args: ""
data_ratio: 1
is_main_data: true
usage_ratio: 1.0
}
opt_config {
batch_size: 1000
algorithm: "sgd"
learning_rate: 0.001
learning_rate_decay_a: 0.0
learning_rate_decay_b: 0.0
l1weight: 0.1
l2weight: 0.0
c1: 0.0001
backoff: 0.5
owlqn_steps: 10
max_backoff: 5
l2weight_zero_iter: 0
average_window: 0
learning_method: "momentum"
ada_epsilon: 1e-06
do_average_in_cpu: false
ada_rou: 0.95
learning_rate_schedule: "poly"
delta_add_rate: 1.0
shrink_parameter_value: 0
adam_beta1: 0.9
adam_beta2: 0.999
adam_epsilon: 1e-08
learning_rate_args: ""
async_lagged_grad_discard_ratio: 1.5
}
test_data_config {
type: "py2"
files: "test.list"
async_load_data: true
for_test: true
load_data_module: "b"
load_data_object: "d"
load_data_args: ""
data_ratio: 1
is_main_data: true
usage_ratio: 1.0
}
save_dir: "./output/model"
start_pass: 0
python/paddle/trainer_config_helpers/tests/configs/test_split_datasource.py
0 → 100644
浏览文件 @
904a43b0
from
paddle.trainer_config_helpers
import
*
define_py_data_sources2
(
train_list
=
"train.list"
,
test_list
=
"test.list"
,
module
=
[
"a"
,
"b"
],
obj
=
(
"c"
,
"d"
))
settings
(
learning_rate
=
1e-3
,
batch_size
=
1000
)
outputs
(
data_layer
(
name
=
"a"
,
size
=
10
))
python/paddle/utils/dump_config.py
浏览文件 @
904a43b0
...
@@ -19,13 +19,21 @@ import sys
...
@@ -19,13 +19,21 @@ import sys
__all__
=
[]
__all__
=
[]
if
__name__
==
'__main__'
:
if
__name__
==
'__main__'
:
whole_conf
=
False
if
len
(
sys
.
argv
)
==
2
:
if
len
(
sys
.
argv
)
==
2
:
conf
=
parse_config
(
sys
.
argv
[
1
],
''
)
conf
=
parse_config
(
sys
.
argv
[
1
],
''
)
elif
len
(
sys
.
argv
)
==
3
:
elif
len
(
sys
.
argv
)
==
3
:
conf
=
parse_config
(
sys
.
argv
[
1
],
sys
.
argv
[
2
])
conf
=
parse_config
(
sys
.
argv
[
1
],
sys
.
argv
[
2
])
elif
len
(
sys
.
argv
)
==
4
:
conf
=
parse_config
(
sys
.
argv
[
1
],
sys
.
argv
[
2
])
if
sys
.
argv
[
3
]
==
'--whole'
:
whole_conf
=
True
else
:
else
:
raise
RuntimeError
()
raise
RuntimeError
()
assert
isinstance
(
conf
,
TrainerConfig_pb2
.
TrainerConfig
)
assert
isinstance
(
conf
,
TrainerConfig_pb2
.
TrainerConfig
)
print
conf
.
model_config
if
whole_conf
:
print
conf
else
:
print
conf
.
model_config
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录