提交 10f3aa4c 编写于 作者: T Travis CI

Deploy to GitHub Pages: 1e92353a

上级 c6aa44ec
...@@ -305,3 +305,10 @@ lstm_unit ...@@ -305,3 +305,10 @@ lstm_unit
--------- ---------
.. autofunction:: paddle.v2.fluid.layers.lstm_unit .. autofunction:: paddle.v2.fluid.layers.lstm_unit
:noindex: :noindex:
sequence_softmax
---------
.. autofunction:: paddle.v2.fluid.layers.sequence_softmax
:noindex:
...@@ -1198,6 +1198,47 @@ bias weights will be created and be set to default value.</li> ...@@ -1198,6 +1198,47 @@ bias weights will be created and be set to default value.</li>
</div> </div>
</dd></dl> </dd></dl>
</div>
<div class="section" id="sequence-softmax">
<h2>sequence_softmax<a class="headerlink" href="#sequence-softmax" title="Permalink to this headline"></a></h2>
<dl class="function">
<dt>
<code class="descclassname">paddle.v2.fluid.layers.</code><code class="descname">sequence_softmax</code><span class="sig-paren">(</span><em>**kwargs</em><span class="sig-paren">)</span></dt>
<dd><p>Sequence Softmax Operator.</p>
<p>SequenceSoftmaxOp computes the softmax activation among all time-steps for each
sequence. The dimension of each time-step should be 1. Thus, the shape of
input Tensor can be either [N, 1] or [N], where N is the sum of the length
of all sequences.</p>
<dl class="docutils">
<dt>The algorithm works as follows:</dt>
<dd><dl class="first last docutils">
<dt>for i-th sequence in a mini-batch:</dt>
<dd><dl class="first last docutils">
<dt>$$Out(X[lod[i]:lod[i+1]], :) =</dt>
<dd>frac{exp(X[lod[i]:lod[i+1], :])}
{sum(exp(X[lod[i]:lod[i+1], :]))}$$</dd>
</dl>
</dd>
</dl>
</dd>
</dl>
<p>For example, for a mini-batch of 3 sequences with variable-length,
each containing 2, 3, 2 time-steps, the lod of which is [0, 2, 5, 7],
then softmax will be computed among X[0:2, :], X[2:5, :], X[5:7, :]
and N turns out to be 7.</p>
<table class="docutils field-list" frame="void" rules="none">
<col class="field-name" />
<col class="field-body" />
<tbody valign="top">
<tr class="field-odd field"><th class="field-name">Parameters:</th><td class="field-body"><strong>x</strong> &#8211; (LoDTensor) 1-D or 2-D input LoDTensor with the 2-nd dimension of length 1.
Duplicable: False Optional: False</td>
</tr>
<tr class="field-even field"><th class="field-name">Returns:</th><td class="field-body">(LoDTensor) 1-D or 2-D output LoDTensor with the 2-nd dimension of length 1.</td>
</tr>
</tbody>
</table>
</dd></dl>
</div> </div>
</div> </div>
......
因为 它太大了无法显示 source diff 。你可以改为 查看blob
...@@ -305,3 +305,10 @@ lstm_unit ...@@ -305,3 +305,10 @@ lstm_unit
--------- ---------
.. autofunction:: paddle.v2.fluid.layers.lstm_unit .. autofunction:: paddle.v2.fluid.layers.lstm_unit
:noindex: :noindex:
sequence_softmax
---------
.. autofunction:: paddle.v2.fluid.layers.sequence_softmax
:noindex:
...@@ -1217,6 +1217,47 @@ bias weights will be created and be set to default value.</li> ...@@ -1217,6 +1217,47 @@ bias weights will be created and be set to default value.</li>
</div> </div>
</dd></dl> </dd></dl>
</div>
<div class="section" id="sequence-softmax">
<h2>sequence_softmax<a class="headerlink" href="#sequence-softmax" title="永久链接至标题"></a></h2>
<dl class="function">
<dt>
<code class="descclassname">paddle.v2.fluid.layers.</code><code class="descname">sequence_softmax</code><span class="sig-paren">(</span><em>**kwargs</em><span class="sig-paren">)</span></dt>
<dd><p>Sequence Softmax Operator.</p>
<p>SequenceSoftmaxOp computes the softmax activation among all time-steps for each
sequence. The dimension of each time-step should be 1. Thus, the shape of
input Tensor can be either [N, 1] or [N], where N is the sum of the length
of all sequences.</p>
<dl class="docutils">
<dt>The algorithm works as follows:</dt>
<dd><dl class="first last docutils">
<dt>for i-th sequence in a mini-batch:</dt>
<dd><dl class="first last docutils">
<dt>$$Out(X[lod[i]:lod[i+1]], :) =</dt>
<dd>frac{exp(X[lod[i]:lod[i+1], :])}
{sum(exp(X[lod[i]:lod[i+1], :]))}$$</dd>
</dl>
</dd>
</dl>
</dd>
</dl>
<p>For example, for a mini-batch of 3 sequences with variable-length,
each containing 2, 3, 2 time-steps, the lod of which is [0, 2, 5, 7],
then softmax will be computed among X[0:2, :], X[2:5, :], X[5:7, :]
and N turns out to be 7.</p>
<table class="docutils field-list" frame="void" rules="none">
<col class="field-name" />
<col class="field-body" />
<tbody valign="top">
<tr class="field-odd field"><th class="field-name">参数:</th><td class="field-body"><strong>x</strong> &#8211; (LoDTensor) 1-D or 2-D input LoDTensor with the 2-nd dimension of length 1.
Duplicable: False Optional: False</td>
</tr>
<tr class="field-even field"><th class="field-name">返回:</th><td class="field-body">(LoDTensor) 1-D or 2-D output LoDTensor with the 2-nd dimension of length 1.</td>
</tr>
</tbody>
</table>
</dd></dl>
</div> </div>
</div> </div>
......
此差异已折叠。
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册