提交 784e242b 编写于 作者: G gaoyuan

Remove redundancy codes

上级 57c355a1
......@@ -109,6 +109,12 @@ sum_to_one_norm
:members: sum_to_one_norm
:noindex:
cross_channel_norm
---------------
.. automodule:: paddle.v2.layer
:members: cross_channel_norm
:noindex:
Recurrent Layers
================
......
......@@ -40,7 +40,6 @@ void CrossChannelNormLayer::forward(PassType passType) {
normBuffer_->addScalar(*normBuffer_, 1e-6);
inV->square2(*dataBuffer_);
for (size_t i = 0; i < batchSize; i++) {
spatialBuffer_->zeroMem();
MatrixPtr inTmp = Matrix::create(
inV->getData() + i * dataDim, channels_, spatialDim, false, useGpu_);
MatrixPtr dataTmp = Matrix::create(dataBuffer_->getData() + i * dataDim,
......@@ -80,7 +79,6 @@ void CrossChannelNormLayer::backward(const UpdateCallback& callback) {
scaleDiff_->zeroMem();
for (size_t i = 0; i < batchSize; i++) {
spatialBuffer_->zeroMem();
channelBuffer_->zeroMem();
// propagate to param.
MatrixPtr dataBufferTmp =
Matrix::create(dataBuffer_->getData() + i * dataDim,
......
......@@ -66,11 +66,10 @@ public:
};
/**
* This layer applys normalize across the channels of each sample to a
* conv layer's output and scale the output by a group of trainable factors
* which dimensions equal to the channel's number.
* - Input: One and only one input layer are accepted. The input layer must be
* be a data output layer.
* This layer applys normalization across the channels of each sample to a
* conv layer's output, and scales the output by a group of trainable factors
* whose equal to the number of channels.
* - Input: One and only one input layer are accepted.
* - Output: The normalized data of the input data.
* Reference:
* Wei Liu, Dragomir Anguelov, Dumitru Erhan, Christian Szegedy, Scott Reed,
......
......@@ -1015,6 +1015,7 @@ def cross_channel_norm_layer(input, name=None, param_attr=None):
This layer applys normalize across the channels of each sample to
a conv layer's output and scale the output by a group of trainable
factors which dimensions equal to the channel's number.
:param name: The Layer Name.
:type name: basestring
:param input: The input layer.
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册