提交 0d26a158 编写于 作者: Z Zhaolong Xing 提交者: GitHub

Merge pull request #3009 from NHZlX/add_paramAttr

add param_attr parameter for img_conv_groups(...) in /python/trainer_config_helpers/networks.py
...@@ -340,24 +340,40 @@ def img_conv_group(input, ...@@ -340,24 +340,40 @@ def img_conv_group(input,
conv_with_batchnorm=False, conv_with_batchnorm=False,
conv_batchnorm_drop_rate=0, conv_batchnorm_drop_rate=0,
pool_stride=1, pool_stride=1,
pool_type=None): pool_type=None,
param_attr=None):
""" """
Image Convolution Group, Used for vgg net. Image Convolution Group, Used for vgg net.
TODO(yuyang18): Complete docs :param conv_batchnorm_drop_rate: if conv_with_batchnorm[i] is true,
conv_batchnorm_drop_rate[i] represents the drop rate of each batch norm.
:param conv_batchnorm_drop_rate: :type conv_batchnorm_drop_rate: list
:param input: :param input: layer's input.
:param conv_num_filter: :type input: LayerOutput
:param pool_size: :param conv_num_filter: output channels num.
:param num_channels: :type conv_num_filter: int
:param conv_padding: :param pool_size: pooling filter size.
:param conv_filter_size: :type pool_size: int
:param conv_act: :param num_channels: input channels num.
:param conv_with_batchnorm: :type num_channels: int
:param pool_stride: :param conv_padding: convolution padding size.
:param pool_type: :type conv_padding: int
:return: :param conv_filter_size: convolution filter size.
:type conv_filter_size: int
:param conv_act: activation funciton after convolution.
:type conv_act: BaseActivation
:param conv_with_batchnorm: conv_with_batchnorm[i] represents
if there is a batch normalization after each convolution.
:type conv_with_batchnorm: list
:param pool_stride: pooling stride size.
:type pool_stride: int
:param pool_type: pooling type.
:type pool_type: BasePoolingType
:param param_attr: Convolution param attribute.
None means default attribute.
:type param_attr: ParameterAttribute
:return: Layer's output
:type: LayerOutput
""" """
tmp = input tmp = input
...@@ -397,6 +413,7 @@ def img_conv_group(input, ...@@ -397,6 +413,7 @@ def img_conv_group(input,
padding=conv_padding[i], padding=conv_padding[i],
filter_size=conv_filter_size[i], filter_size=conv_filter_size[i],
num_filters=conv_num_filter[i], num_filters=conv_num_filter[i],
param_attr=param_attr,
**extra_kwargs) **extra_kwargs)
# logger.debug("tmp.num_filters = %d" % tmp.num_filters) # logger.debug("tmp.num_filters = %d" % tmp.num_filters)
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册