<trclass="field-even field"><thclass="field-name">Raises:</th><tdclass="field-body"><pclass="first last"><codeclass="xref py py-exc docutils literal"><spanclass="pre">ValueError</span></code>– If rank of input tensor is less than 2.</p>
<dd><pclass="first">input(Variable|list): The input tensor(s) to the fully connected layer.
size(int): The number of output units in the fully connected layer.
num_flatten_dims(int): The fc layer can accept an input tensor with more</p>
<blockquote>
<div>than two dimensions. If this happens, the
multidimensional tensor will first be flattened
into a 2-dimensional matrix. The parameter
<cite>num_flatten_dims</cite> determines how the input tensor
is flattened: the first <cite>num_flatten_dims</cite>
dimensions will be flatten to form the first
dimension of the final matrix (height of the
matrix), and the rest <cite>rank(X) - num_col_dims</cite>
dimensions are flattened to form the second
dimension of the final matrix (width of the matrix).
For example, suppose <cite>X</cite> is a 6-dimensional tensor
with a shape [2, 3, 4, 5, 6], and
<cite>x_num_col_dims</cite> = 3. Then, the flattened matrix
will have a shape [2 x 3 x 4, 5 x 6] = [24, 30].
By default, <cite>x_num_col_dims</cite> is set to 1.</div></blockquote>
<dlclass="docutils">
<dt>param_attr(ParamAttr|list): The parameter attribute for learnable</dt>
<dd>parameters/weights of the fully connected
layer.</dd>
<dt>param_initializer(ParamAttr|list): The initializer used for the</dt>
<dd>weight/parameter. If set None,
XavierInitializer() will be used.</dd>
<dt>bias_attr(ParamAttr|list): The parameter attribute for the bias parameter</dt>
<dd>for this layer. If set None, no bias will be
added to the output units.</dd>
<dt>bias_initializer(ParamAttr|list): The initializer used for the bias.</dt>
<dd>If set None, then ConstantInitializer()
will be used.</dd>
<dt>act(str): Activation to be applied to the output of the fully connected</dt>
<dd>layer.</dd>
</dl>
<pclass="last">name(str): Name/alias of the fully connected layer.</p>
</dd>
<dt>Returns:</dt>
<dd>Variable: The output tensor variable.</dd>
<dt>Raises:</dt>
<dd>ValueError: If rank of the input tensor is less than 2.</dd>
<dt>Examples:</dt>
<dd><divclass="first last highlight-python"><divclass="highlight"><pre><span></span><spanclass="n">data</span><spanclass="o">=</span><spanclass="n">fluid</span><spanclass="o">.</span><spanclass="n">layers</span><spanclass="o">.</span><spanclass="n">data</span><spanclass="p">(</span><spanclass="n">name</span><spanclass="o">=</span><spanclass="s2">"data"</span><spanclass="p">,</span><spanclass="n">shape</span><spanclass="o">=</span><spanclass="p">[</span><spanclass="mi">32</span><spanclass="p">,</span><spanclass="mi">32</span><spanclass="p">],</span><spanclass="n">dtype</span><spanclass="o">=</span><spanclass="s2">"float32"</span><spanclass="p">)</span>
<li><strong>x</strong>–The first input of mul op
<li><strong>x</strong>–(Tensor), The first input tensor of mul op.
Duplicable: False Optional: False</li>
<li><strong>y</strong>–The second input of mul op
<li><strong>y</strong>–(Tensor), The second input tensor of mul op.
Duplicable: False Optional: False</li>
<li><strong>x_num_col_dims</strong> (<em>INT</em>) – (int, default 1) mul_op can take tensors with more than two dimensions as input <cite>X</cite>,
in that case, tensors will be reshaped to a matrix. The matrix’s first
dimension(column length) will be the product of tensor’s last
<cite>num_col_dims</cite> dimensions, and the matrix’s second dimension(row length)
will be the product of tensor’s first <cite>rank - num_col_dims</cite> dimensions.</li>
<li><strong>y_num_col_dims</strong> (<em>INT</em>) – (int, default 1) mul_op can take tensors with more than two dimensions as input <cite>Y</cite>,
in that case, tensors will be reshaped to a matrix. Just like input <cite>X</cite>.</li>
<li><strong>x_num_col_dims</strong> (<em>INT</em>) – (int, default 1), The mul_op can take tensors with more than two
dimensions as its inputs. If the input $X$ is a tensor with more
than two dimensions, $X$ will be flattened into a two-dimensional
matrix first. The flattening rule is: the first <cite>num_col_dims</cite>
will be flattened to form the first dimension of the final matrix
(the height of the matrix), and the rest <cite>rank(X) - num_col_dims</cite>
dimensions are flattened to form the second dimension of the final
matrix (the width of the matrix). As a result, height of the
flattened matrix is equal to the product of $X$’s first
<cite>x_num_col_dims</cite> dimensions’ sizes, and width of the flattened
matrix is equal to the product of $X$’s last <cite>rank(x) - num_col_dims</cite>
dimensions’ size. For example, suppose $X$ is a 6-dimensional
tensor with the shape [2, 3, 4, 5, 6], and <cite>x_num_col_dims</cite> = 3.
Thus, the flattened matrix will have a shape [2 x 3 x 4, 5 x 6] =
[24, 30].</li>
<li><strong>y_num_col_dims</strong> (<em>INT</em>) – (int, default 1), The mul_op can take tensors with more than two,
dimensions as its inputs. If the input $Y$ is a tensor with more
than two dimensions, $Y$ will be flattened into a two-dimensional
matrix first. The attribute <cite>y_num_col_dims</cite> determines how $Y$ is
flattened. See comments of <cite>x_num_col_dims</cite> for more details.</li>
</ul>
</td>
</tr>
<trclass="field-even field"><thclass="field-name">Returns:</th><tdclass="field-body"><pclass="first last">The output of mul op</p>
<trclass="field-even field"><thclass="field-name">Returns:</th><tdclass="field-body"><pclass="first last">(Tensor), The output tensor of mul op.</p>
<spanid="l1decayregularizer"></span><h2>L1DecayRegularizer<aclass="headerlink"href="#module-paddle.v2.fluid.regularizer"title="Permalink to this headline">¶</a></h2>
<emclass="property">class </em><codeclass="descclassname">paddle.v2.fluid.regularizer.</code><codeclass="descname">L1DecayRegularizer</code><spanclass="sig-paren">(</span><em>regularization_coeff=0.0</em><spanclass="sig-paren">)</span><aclass="headerlink"href="#paddle.v2.fluid.regularizer.L1DecayRegularizer"title="Permalink to this definition">¶</a></dt>
<dd><p>Implements the L1 Weight Decay Regularization</p>
"comment":"\nMul Operator.\n\nThis operator is used to perform matrix multiplication for input X and Y.\n\nThe equation is:\n\n $$Out = X * Y$$\n\nBoth the input `X` and `Y` can carry the LoD (Level of Details) information,\nor not. But the output only shares the LoD information with input `X`.\n\n",
"comment":"\nMul Operator.\n\nThis operator is used to perform matrix multiplication for input $X$ and $Y$.\n\nThe equation is:\n\n $$Out = X * Y$$\n\nBoth the input $X$ and $Y$ can carry the LoD (Level of Details) information,\nor not. But the output only shares the LoD information with input $X$.\n\n",
"inputs":[
{
"name":"X",
"comment":"The first input of mul op",
"comment":"(Tensor), The first input tensor of mul op.",
"duplicable":0,
"intermediate":0
},{
"name":"Y",
"comment":"The second input of mul op",
"comment":"(Tensor), The second input tensor of mul op.",
"duplicable":0,
"intermediate":0
}],
"outputs":[
{
"name":"Out",
"comment":"The output of mul op",
"comment":"(Tensor), The output tensor of mul op.",
"duplicable":0,
"intermediate":0
}],
...
...
@@ -1236,12 +1236,12 @@
{
"name":"x_num_col_dims",
"type":"int",
"comment":"(int, default 1) mul_op can take tensors with more than two dimensions as input `X`,\n in that case, tensors will be reshaped to a matrix. The matrix's first\n dimension(column length) will be the product of tensor's last\n `num_col_dims` dimensions, and the matrix's second dimension(row length)\n will be the product of tensor's first `rank - num_col_dims` dimensions.\n ",
"comment":"(int, default 1), The mul_op can take tensors with more than two\n dimensions as its inputs. If the input $X$ is a tensor with more\n than two dimensions, $X$ will be flattened into a two-dimensional\n matrix first. The flattening rule is: the first `num_col_dims`\n will be flattened to form the first dimension of the final matrix\n (the height of the matrix), and the rest `rank(X) - num_col_dims`\n dimensions are flattened to form the second dimension of the final\n matrix (the width of the matrix). As a result, height of the\n flattened matrix is equal to the product of $X$'s first\n `x_num_col_dims` dimensions' sizes, and width of the flattened\n matrix is equal to the product of $X$'s last `rank(x) - num_col_dims`\n dimensions' size. For example, suppose $X$ is a 6-dimensional\n tensor with the shape [2, 3, 4, 5, 6], and `x_num_col_dims` = 3.\n Thus, the flattened matrix will have a shape [2 x 3 x 4, 5 x 6] =\n [24, 30].\n ",
"generated":0
},{
"name":"y_num_col_dims",
"type":"int",
"comment":"(int, default 1) mul_op can take tensors with more than two dimensions as input `Y`,\n in that case, tensors will be reshaped to a matrix. Just like input `X`.\n ",
"comment":"(int, default 1), The mul_op can take tensors with more than two,\n dimensions as its inputs. If the input $Y$ is a tensor with more\n than two dimensions, $Y$ will be flattened into a two-dimensional\n matrix first. The attribute `y_num_col_dims` determines how $Y$ is\n flattened. See comments of `x_num_col_dims` for more details.\n ",
<trclass="field-even field"><thclass="field-name">Raises:</th><tdclass="field-body"><pclass="first last"><codeclass="xref py py-exc docutils literal"><spanclass="pre">ValueError</span></code>– If rank of input tensor is less than 2.</p>
<dd><pclass="first">input(Variable|list): The input tensor(s) to the fully connected layer.
size(int): The number of output units in the fully connected layer.
num_flatten_dims(int): The fc layer can accept an input tensor with more</p>
<blockquote>
<div>than two dimensions. If this happens, the
multidimensional tensor will first be flattened
into a 2-dimensional matrix. The parameter
<cite>num_flatten_dims</cite> determines how the input tensor
is flattened: the first <cite>num_flatten_dims</cite>
dimensions will be flatten to form the first
dimension of the final matrix (height of the
matrix), and the rest <cite>rank(X) - num_col_dims</cite>
dimensions are flattened to form the second
dimension of the final matrix (width of the matrix).
For example, suppose <cite>X</cite> is a 6-dimensional tensor
with a shape [2, 3, 4, 5, 6], and
<cite>x_num_col_dims</cite> = 3. Then, the flattened matrix
will have a shape [2 x 3 x 4, 5 x 6] = [24, 30].
By default, <cite>x_num_col_dims</cite> is set to 1.</div></blockquote>
<dlclass="docutils">
<dt>param_attr(ParamAttr|list): The parameter attribute for learnable</dt>
<dd>parameters/weights of the fully connected
layer.</dd>
<dt>param_initializer(ParamAttr|list): The initializer used for the</dt>
<dd>weight/parameter. If set None,
XavierInitializer() will be used.</dd>
<dt>bias_attr(ParamAttr|list): The parameter attribute for the bias parameter</dt>
<dd>for this layer. If set None, no bias will be
added to the output units.</dd>
<dt>bias_initializer(ParamAttr|list): The initializer used for the bias.</dt>
<dd>If set None, then ConstantInitializer()
will be used.</dd>
<dt>act(str): Activation to be applied to the output of the fully connected</dt>
<dd>layer.</dd>
</dl>
<pclass="last">name(str): Name/alias of the fully connected layer.</p>
</dd>
<dt>Returns:</dt>
<dd>Variable: The output tensor variable.</dd>
<dt>Raises:</dt>
<dd>ValueError: If rank of the input tensor is less than 2.</dd>
<dt>Examples:</dt>
<dd><divclass="first last highlight-python"><divclass="highlight"><pre><span></span><spanclass="n">data</span><spanclass="o">=</span><spanclass="n">fluid</span><spanclass="o">.</span><spanclass="n">layers</span><spanclass="o">.</span><spanclass="n">data</span><spanclass="p">(</span><spanclass="n">name</span><spanclass="o">=</span><spanclass="s2">"data"</span><spanclass="p">,</span><spanclass="n">shape</span><spanclass="o">=</span><spanclass="p">[</span><spanclass="mi">32</span><spanclass="p">,</span><spanclass="mi">32</span><spanclass="p">],</span><spanclass="n">dtype</span><spanclass="o">=</span><spanclass="s2">"float32"</span><spanclass="p">)</span>
<li><strong>x</strong>–The first input of mul op
<li><strong>x</strong>–(Tensor), The first input tensor of mul op.
Duplicable: False Optional: False</li>
<li><strong>y</strong>–The second input of mul op
<li><strong>y</strong>–(Tensor), The second input tensor of mul op.
Duplicable: False Optional: False</li>
<li><strong>x_num_col_dims</strong> (<em>INT</em>) – (int, default 1) mul_op can take tensors with more than two dimensions as input <cite>X</cite>,
in that case, tensors will be reshaped to a matrix. The matrix’s first
dimension(column length) will be the product of tensor’s last
<cite>num_col_dims</cite> dimensions, and the matrix’s second dimension(row length)
will be the product of tensor’s first <cite>rank - num_col_dims</cite> dimensions.</li>
<li><strong>y_num_col_dims</strong> (<em>INT</em>) – (int, default 1) mul_op can take tensors with more than two dimensions as input <cite>Y</cite>,
in that case, tensors will be reshaped to a matrix. Just like input <cite>X</cite>.</li>
<li><strong>x_num_col_dims</strong> (<em>INT</em>) – (int, default 1), The mul_op can take tensors with more than two
dimensions as its inputs. If the input $X$ is a tensor with more
than two dimensions, $X$ will be flattened into a two-dimensional
matrix first. The flattening rule is: the first <cite>num_col_dims</cite>
will be flattened to form the first dimension of the final matrix
(the height of the matrix), and the rest <cite>rank(X) - num_col_dims</cite>
dimensions are flattened to form the second dimension of the final
matrix (the width of the matrix). As a result, height of the
flattened matrix is equal to the product of $X$’s first
<cite>x_num_col_dims</cite> dimensions’ sizes, and width of the flattened
matrix is equal to the product of $X$’s last <cite>rank(x) - num_col_dims</cite>
dimensions’ size. For example, suppose $X$ is a 6-dimensional
tensor with the shape [2, 3, 4, 5, 6], and <cite>x_num_col_dims</cite> = 3.
Thus, the flattened matrix will have a shape [2 x 3 x 4, 5 x 6] =
[24, 30].</li>
<li><strong>y_num_col_dims</strong> (<em>INT</em>) – (int, default 1), The mul_op can take tensors with more than two,
dimensions as its inputs. If the input $Y$ is a tensor with more
than two dimensions, $Y$ will be flattened into a two-dimensional
matrix first. The attribute <cite>y_num_col_dims</cite> determines how $Y$ is
flattened. See comments of <cite>x_num_col_dims</cite> for more details.</li>
</ul>
</td>
</tr>
<trclass="field-even field"><thclass="field-name">返回:</th><tdclass="field-body"><pclass="first last">The output of mul op</p>
<trclass="field-even field"><thclass="field-name">返回:</th><tdclass="field-body"><pclass="first last">(Tensor), The output tensor of mul op.</p>