Skip to content

Commit 8845218

Browse files
committed
add batchnorm layer in simple test and branch test
1 parent 4d7eb09 commit 8845218

File tree

2 files changed

+36
-1
lines changed

2 files changed

+36
-1
lines changed

paddle/trainer/tests/sample_trainer_config_branch_net.conf

Lines changed: 30 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -89,6 +89,36 @@ tmp = img_pool_layer(input=tmp,
8989
padding=1,
9090
pool_type=MaxPooling())
9191

92+
tmp = img_conv_layer(input=tmp,
93+
filter_size=3,
94+
num_filters=32,
95+
padding=1,
96+
shared_biases=True,
97+
act=LinearActivation(),
98+
bias_attr=False)
99+
100+
tmp = batch_norm_layer(input=tmp,
101+
use_global_stats=False,
102+
act=ReluActivation())
103+
104+
c1 = img_conv_layer(input=tmp,
105+
filter_size=1,
106+
num_filters=32,
107+
padding=0,
108+
shared_biases=True,
109+
act=ReluActivation())
110+
111+
c2 = img_conv_layer(input=tmp,
112+
filter_size=3,
113+
num_filters=32,
114+
padding=1,
115+
shared_biases=True,
116+
act=ReluActivation())
117+
118+
tmp = addto_layer(input=[c1, c2],
119+
act=ReluActivation(),
120+
bias_attr=False)
121+
92122
tmp = fc_layer(input=tmp, size=64,
93123
bias_attr=False,
94124
act=TanhActivation())

paddle/trainer/tests/sample_trainer_config_simple_net.conf

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -38,9 +38,14 @@ tmp = img_pool_layer(input=tmp,
3838

3939
tmp = img_conv_layer(input=tmp,
4040
filter_size=3,
41-
num_filters=64,
41+
num_filters=32,
4242
padding=1,
4343
shared_biases=True,
44+
act=LinearActivation(),
45+
bias_attr=False)
46+
47+
tmp = batch_norm_layer(input=tmp,
48+
use_global_stats=False,
4449
act=ReluActivation())
4550

4651
tmp = img_pool_layer(input=tmp,

0 commit comments

Comments
 (0)