Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
BaiXuePrincess
Paddle
提交
16b70f3e
P
Paddle
项目概览
BaiXuePrincess
/
Paddle
与 Fork 源项目一致
Fork自
PaddlePaddle / Paddle
通知
1
Star
1
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看板
提交
16b70f3e
编写于
8月 07, 2017
作者:
L
Luo Tao
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
reduce time of test_TrainerOnePass
上级
efa50a45
变更
3
显示空白变更内容
内联
并排
Showing
3 changed file
with
10 addition
and
10 deletion
+10
-10
paddle/trainer/tests/simple_sparse_neural_network.py
paddle/trainer/tests/simple_sparse_neural_network.py
+2
-2
paddle/trainer/tests/simple_sparse_neural_network_dp.py
paddle/trainer/tests/simple_sparse_neural_network_dp.py
+4
-4
paddle/trainer/tests/test_TrainerOnePass.cpp
paddle/trainer/tests/test_TrainerOnePass.cpp
+4
-4
未找到文件。
paddle/trainer/tests/simple_sparse_neural_network.py
浏览文件 @
16b70f3e
from
paddle.trainer_config_helpers
import
*
from
paddle.trainer_config_helpers
import
*
settings
(
batch_size
=
1
28
,
learning_method
=
AdaGradOptimizer
(),
learning_rate
=
1e-4
)
settings
(
batch_size
=
1
7
,
learning_method
=
AdaGradOptimizer
(),
learning_rate
=
1e-4
)
file_list
=
'trainer/tests/fake_file_list.list'
file_list
=
'trainer/tests/fake_file_list.list'
...
@@ -12,7 +12,7 @@ define_py_data_sources2(
...
@@ -12,7 +12,7 @@ define_py_data_sources2(
embedding
=
embedding_layer
(
embedding
=
embedding_layer
(
input
=
data_layer
(
input
=
data_layer
(
name
=
"word_ids"
,
size
=
65536
),
name
=
"word_ids"
,
size
=
8191
),
size
=
128
,
size
=
128
,
param_attr
=
ParamAttr
(
sparse_update
=
True
))
param_attr
=
ParamAttr
(
sparse_update
=
True
))
prediction
=
fc_layer
(
input
=
embedding
,
size
=
10
,
act
=
SoftmaxActivation
())
prediction
=
fc_layer
(
input
=
embedding
,
size
=
10
,
act
=
SoftmaxActivation
())
...
...
paddle/trainer/tests/simple_sparse_neural_network_dp.py
浏览文件 @
16b70f3e
...
@@ -7,15 +7,15 @@ def init_hook(settings, is_train, **kwargs):
...
@@ -7,15 +7,15 @@ def init_hook(settings, is_train, **kwargs):
@
provider
(
@
provider
(
input_types
=
{
'word_ids'
:
integer_value
(
65536
),
input_types
=
{
'word_ids'
:
integer_value
(
8191
),
'label'
:
integer_value
(
10
)},
'label'
:
integer_value
(
10
)},
min_pool_size
=
0
,
min_pool_size
=
0
,
init_hook
=
init_hook
)
init_hook
=
init_hook
)
def
process
(
settings
,
filename
):
def
process
(
settings
,
filename
):
if
settings
.
is_train
:
if
settings
.
is_train
:
data_size
=
2
**
20
else
:
data_size
=
2
**
10
data_size
=
2
**
10
else
:
data_size
=
2
**
5
for
_
in
xrange
(
data_size
):
for
_
in
xrange
(
data_size
):
yield
random
.
randint
(
0
,
65535
),
random
.
randint
(
0
,
9
)
yield
random
.
randint
(
0
,
8190
),
random
.
randint
(
0
,
9
)
paddle/trainer/tests/test_TrainerOnePass.cpp
浏览文件 @
16b70f3e
...
@@ -100,25 +100,25 @@ TEST(average_window, gpu) {
...
@@ -100,25 +100,25 @@ TEST(average_window, gpu) {
}
}
TEST
(
average_window
,
gpu2
)
{
TEST
(
average_window
,
gpu2
)
{
FLAGS_num_passes
=
10
0
;
FLAGS_num_passes
=
2
0
;
trainerOnePassTest
(
configFile1
,
true
,
false
,
2
,
0.01
);
trainerOnePassTest
(
configFile1
,
true
,
false
,
2
,
0.01
);
FLAGS_num_passes
=
1
;
FLAGS_num_passes
=
1
;
}
}
TEST
(
average_window
,
gpu4
)
{
TEST
(
average_window
,
gpu4
)
{
FLAGS_num_passes
=
10
0
;
FLAGS_num_passes
=
2
0
;
trainerOnePassTest
(
configFile1
,
true
,
false
,
4
,
0.01
);
trainerOnePassTest
(
configFile1
,
true
,
false
,
4
,
0.01
);
FLAGS_num_passes
=
1
;
FLAGS_num_passes
=
1
;
}
}
TEST
(
average_window_cpu
,
gpu2
)
{
TEST
(
average_window_cpu
,
gpu2
)
{
FLAGS_num_passes
=
10
0
;
FLAGS_num_passes
=
2
0
;
trainerOnePassTest
(
configFile1
,
true
,
false
,
2
,
0.01
,
true
);
trainerOnePassTest
(
configFile1
,
true
,
false
,
2
,
0.01
,
true
);
FLAGS_num_passes
=
1
;
FLAGS_num_passes
=
1
;
}
}
TEST
(
average_window_cpu
,
gpu4
)
{
TEST
(
average_window_cpu
,
gpu4
)
{
FLAGS_num_passes
=
10
0
;
FLAGS_num_passes
=
2
0
;
trainerOnePassTest
(
configFile1
,
true
,
false
,
4
,
0.01
,
true
);
trainerOnePassTest
(
configFile1
,
true
,
false
,
4
,
0.01
,
true
);
FLAGS_num_passes
=
1
;
FLAGS_num_passes
=
1
;
}
}
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录