未验证 提交 81a8e913 编写于 作者: W WuHaobo 提交者: GitHub

Merge pull request #233 from WuHaobo/master

polish regnet
...@@ -175,11 +175,6 @@ class RegNet(): ...@@ -175,11 +175,6 @@ class RegNet():
act=None, act=None,
name=None, name=None,
final_bn=False): final_bn=False):
param_attr, bias_attr = self.init_weights(
op_type='conv',
filter_size=filter_size,
num_channels=num_filters,
name=name)
conv = fluid.layers.conv2d( conv = fluid.layers.conv2d(
input=input, input=input,
num_filters=num_filters, num_filters=num_filters,
...@@ -188,22 +183,13 @@ class RegNet(): ...@@ -188,22 +183,13 @@ class RegNet():
padding=padding, padding=padding,
groups=groups, groups=groups,
act=None, act=None,
param_attr=param_attr,
bias_attr=bias_attr,
name=name + '.conv2d.output.1') name=name + '.conv2d.output.1')
bn_name = name + '_bn' bn_name = name + '_bn'
if final_bn:
param_attr, bias_attr = self.init_weights(
op_type='final_bn', name=bn_name)
else:
param_attr, bias_attr = self.init_weights(
op_type='bn', name=bn_name)
return fluid.layers.batch_norm( return fluid.layers.batch_norm(
input=conv, input=conv,
act=act, act=act,
name=bn_name + '.output.1', name=bn_name + '.output.1',
param_attr=param_attr,
bias_attr=bias_attr,
moving_mean_name=bn_name + '_mean', moving_mean_name=bn_name + '_mean',
moving_variance_name=bn_name + '_variance', ) moving_variance_name=bn_name + '_variance', )
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册