提交 bd0e12c7 编写于 作者: T Travis CI

Deploy to GitHub Pages: 59be92e0

上级 f0655acd
......@@ -498,6 +498,12 @@ hsigmoid
:members: hsigmoid
:noindex:
smooth_l1_cost
--------------
.. automodule:: paddle.trainer_config_helpers.layers
:members: smooth_l1_cost
:noindex:
Check Layer
============
......
......@@ -419,6 +419,11 @@ hsigmoid
.. autoclass:: paddle.v2.layer.hsigmoid
:noindex:
smooth_l1_cost
--------------
.. autoclass:: paddle.v2.layer.smooth_l1_cost
:noindex:
Check Layer
============
......
......@@ -287,6 +287,7 @@
<li><a class="reference internal" href="#warp-ctc-layer">warp_ctc_layer</a></li>
<li><a class="reference internal" href="#nce-layer">nce_layer</a></li>
<li><a class="reference internal" href="#hsigmoid">hsigmoid</a></li>
<li><a class="reference internal" href="#smooth-l1-cost">smooth_l1_cost</a></li>
</ul>
</li>
<li><a class="reference internal" href="#check-layer">Check Layer</a><ul>
......@@ -3051,7 +3052,6 @@ Input should be a vector of positive numbers, without normalization.</p>
<tr class="field-odd field"><th class="field-name">Parameters:</th><td class="field-body"><ul class="first simple">
<li><strong>input</strong> (<em>LayerOutput</em>) &#8211; The first input layer.</li>
<li><strong>label</strong> &#8211; The input label.</li>
<li><strong>type</strong> (<em>basestring</em>) &#8211; The type of cost.</li>
<li><strong>name</strong> (<em>None|basestring</em>) &#8211; The name of this layers. It is not necessary.</li>
<li><strong>coeff</strong> (<em>float</em>) &#8211; The coefficient affects the gradient in the backward.</li>
<li><strong>layer_attr</strong> (<a class="reference internal" href="attrs.html#paddle.trainer_config_helpers.attrs.ExtraLayerAttribute" title="paddle.trainer_config_helpers.attrs.ExtraLayerAttribute"><em>ExtraLayerAttribute</em></a>) &#8211; Extra Layer Attribute.</li>
......@@ -3560,6 +3560,46 @@ False means no bias.</li>
</table>
</dd></dl>
</div>
<div class="section" id="smooth-l1-cost">
<h3>smooth_l1_cost<a class="headerlink" href="#smooth-l1-cost" title="Permalink to this headline"></a></h3>
<dl class="function">
<dt>
<code class="descclassname">paddle.trainer_config_helpers.layers.</code><code class="descname">smooth_l1_cost</code><span class="sig-paren">(</span><em>*args</em>, <em>**kwargs</em><span class="sig-paren">)</span></dt>
<dd><p>This is a L1 loss but more smooth. It requires that the
size of input and label are equal. The formula is as follows,</p>
<div class="math">
\[L = \sum_{i} smooth_{L1}(input_i - label_i)\]</div>
<p>in which</p>
<div class="math">
\[\begin{split}smooth_{L1}(x) = \begin{cases} 0.5x^2&amp; \text{if} \ |x| &lt; 1 \\ |x|-0.5&amp; \text{otherwise} \end{cases}\end{split}\]</div>
<p>More details can be found by referring to <a class="reference external" href="https://arxiv.org/pdf/1504.08083v2.pdf">Fast R-CNN</a></p>
<div class="highlight-python"><div class="highlight"><pre><span></span><span class="n">cost</span> <span class="o">=</span> <span class="n">smooth_l1_cost</span><span class="p">(</span><span class="nb">input</span><span class="o">=</span><span class="n">input_layer</span><span class="p">,</span>
<span class="n">label</span><span class="o">=</span><span class="n">label_layer</span><span class="p">)</span>
</pre></div>
</div>
<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"><ul class="first simple">
<li><strong>input</strong> (<em>LayerOutput</em>) &#8211; The input layer.</li>
<li><strong>label</strong> &#8211; The input label.</li>
<li><strong>name</strong> (<em>None|basestring</em>) &#8211; The name of this layers. It is not necessary.</li>
<li><strong>layer_attr</strong> (<a class="reference internal" href="attrs.html#paddle.trainer_config_helpers.attrs.ExtraLayerAttribute" title="paddle.trainer_config_helpers.attrs.ExtraLayerAttribute"><em>ExtraLayerAttribute</em></a>) &#8211; Extra Layer Attribute.</li>
</ul>
</td>
</tr>
<tr class="field-even field"><th class="field-name">Returns:</th><td class="field-body"><p class="first">LayerOutput object.</p>
</td>
</tr>
<tr class="field-odd field"><th class="field-name">Return type:</th><td class="field-body"><p class="first last">LayerOutput</p>
</td>
</tr>
</tbody>
</table>
</dd></dl>
</div>
</div>
<div class="section" id="check-layer">
......
......@@ -286,6 +286,7 @@
<li><a class="reference internal" href="#warp-ctc">warp_ctc</a></li>
<li><a class="reference internal" href="#nce">nce</a></li>
<li><a class="reference internal" href="#hsigmoid">hsigmoid</a></li>
<li><a class="reference internal" href="#smooth-l1-cost">smooth_l1_cost</a></li>
</ul>
</li>
<li><a class="reference internal" href="#check-layer">Check Layer</a><ul>
......@@ -2784,7 +2785,6 @@ Input should be a vector of positive numbers, without normalization.</p>
<tr class="field-odd field"><th class="field-name">Parameters:</th><td class="field-body"><ul class="first simple">
<li><strong>input</strong> (<em>paddle.v2.config_base.Layer</em>) &#8211; The first input layer.</li>
<li><strong>label</strong> &#8211; The input label.</li>
<li><strong>type</strong> (<em>basestring</em>) &#8211; The type of cost.</li>
<li><strong>name</strong> (<em>None|basestring</em>) &#8211; The name of this layers. It is not necessary.</li>
<li><strong>coeff</strong> (<em>float</em>) &#8211; The coefficient affects the gradient in the backward.</li>
<li><strong>layer_attr</strong> (<em>paddle.v2.attr.ExtraAttribute</em>) &#8211; Extra Layer Attribute.</li>
......@@ -3293,6 +3293,46 @@ False means no bias.</li>
</table>
</dd></dl>
</div>
<div class="section" id="smooth-l1-cost">
<h3>smooth_l1_cost<a class="headerlink" href="#smooth-l1-cost" title="Permalink to this headline"></a></h3>
<dl class="class">
<dt>
<em class="property">class </em><code class="descclassname">paddle.v2.layer.</code><code class="descname">smooth_l1_cost</code><span class="sig-paren">(</span><em>*args</em>, <em>**kwargs</em><span class="sig-paren">)</span></dt>
<dd><p>This is a L1 loss but more smooth. It requires that the
size of input and label are equal. The formula is as follows,</p>
<div class="math">
\[L = \sum_{i} smooth_{L1}(input_i - label_i)\]</div>
<p>in which</p>
<div class="math">
\[\begin{split}smooth_{L1}(x) = \begin{cases} 0.5x^2&amp; \text{if} \ |x| &lt; 1 \\ |x|-0.5&amp; \text{otherwise} \end{cases}\end{split}\]</div>
<p>More details can be found by referring to <a class="reference external" href="https://arxiv.org/pdf/1504.08083v2.pdf">Fast R-CNN</a></p>
<div class="highlight-python"><div class="highlight"><pre><span></span><span class="n">cost</span> <span class="o">=</span> <span class="n">smooth_l1_cost</span><span class="p">(</span><span class="nb">input</span><span class="o">=</span><span class="nb">input</span><span class="p">,</span>
<span class="n">label</span><span class="o">=</span><span class="n">label</span><span class="p">)</span>
</pre></div>
</div>
<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"><ul class="first simple">
<li><strong>input</strong> (<em>paddle.v2.config_base.Layer</em>) &#8211; The input layer.</li>
<li><strong>label</strong> &#8211; The input label.</li>
<li><strong>name</strong> (<em>None|basestring</em>) &#8211; The name of this layers. It is not necessary.</li>
<li><strong>layer_attr</strong> (<em>paddle.v2.attr.ExtraAttribute</em>) &#8211; Extra Layer Attribute.</li>
</ul>
</td>
</tr>
<tr class="field-even field"><th class="field-name">Returns:</th><td class="field-body"><p class="first">paddle.v2.config_base.Layer object.</p>
</td>
</tr>
<tr class="field-odd field"><th class="field-name">Return type:</th><td class="field-body"><p class="first last">paddle.v2.config_base.Layer</p>
</td>
</tr>
</tbody>
</table>
</dd></dl>
</div>
</div>
<div class="section" id="check-layer">
......
因为 它太大了无法显示 source diff 。你可以改为 查看blob
......@@ -498,6 +498,12 @@ hsigmoid
:members: hsigmoid
:noindex:
smooth_l1_cost
--------------
.. automodule:: paddle.trainer_config_helpers.layers
:members: smooth_l1_cost
:noindex:
Check Layer
============
......
......@@ -419,6 +419,11 @@ hsigmoid
.. autoclass:: paddle.v2.layer.hsigmoid
:noindex:
smooth_l1_cost
--------------
.. autoclass:: paddle.v2.layer.smooth_l1_cost
:noindex:
Check Layer
============
......
......@@ -294,6 +294,7 @@
<li><a class="reference internal" href="#warp-ctc-layer">warp_ctc_layer</a></li>
<li><a class="reference internal" href="#nce-layer">nce_layer</a></li>
<li><a class="reference internal" href="#hsigmoid">hsigmoid</a></li>
<li><a class="reference internal" href="#smooth-l1-cost">smooth_l1_cost</a></li>
</ul>
</li>
<li><a class="reference internal" href="#check-layer">Check Layer</a><ul>
......@@ -3058,7 +3059,6 @@ Input should be a vector of positive numbers, without normalization.</p>
<tr class="field-odd field"><th class="field-name">参数:</th><td class="field-body"><ul class="first simple">
<li><strong>input</strong> (<em>LayerOutput</em>) &#8211; The first input layer.</li>
<li><strong>label</strong> &#8211; The input label.</li>
<li><strong>type</strong> (<em>basestring</em>) &#8211; The type of cost.</li>
<li><strong>name</strong> (<em>None|basestring</em>) &#8211; The name of this layers. It is not necessary.</li>
<li><strong>coeff</strong> (<em>float</em>) &#8211; The coefficient affects the gradient in the backward.</li>
<li><strong>layer_attr</strong> (<a class="reference internal" href="attrs.html#paddle.trainer_config_helpers.attrs.ExtraLayerAttribute" title="paddle.trainer_config_helpers.attrs.ExtraLayerAttribute"><em>ExtraLayerAttribute</em></a>) &#8211; Extra Layer Attribute.</li>
......@@ -3567,6 +3567,46 @@ False means no bias.</li>
</table>
</dd></dl>
</div>
<div class="section" id="smooth-l1-cost">
<h3>smooth_l1_cost<a class="headerlink" href="#smooth-l1-cost" title="永久链接至标题"></a></h3>
<dl class="function">
<dt>
<code class="descclassname">paddle.trainer_config_helpers.layers.</code><code class="descname">smooth_l1_cost</code><span class="sig-paren">(</span><em>*args</em>, <em>**kwargs</em><span class="sig-paren">)</span></dt>
<dd><p>This is a L1 loss but more smooth. It requires that the
size of input and label are equal. The formula is as follows,</p>
<div class="math">
\[L = \sum_{i} smooth_{L1}(input_i - label_i)\]</div>
<p>in which</p>
<div class="math">
\[\begin{split}smooth_{L1}(x) = \begin{cases} 0.5x^2&amp; \text{if} \ |x| &lt; 1 \\ |x|-0.5&amp; \text{otherwise} \end{cases}\end{split}\]</div>
<p>More details can be found by referring to <a class="reference external" href="https://arxiv.org/pdf/1504.08083v2.pdf">Fast R-CNN</a></p>
<div class="highlight-python"><div class="highlight"><pre><span></span><span class="n">cost</span> <span class="o">=</span> <span class="n">smooth_l1_cost</span><span class="p">(</span><span class="nb">input</span><span class="o">=</span><span class="n">input_layer</span><span class="p">,</span>
<span class="n">label</span><span class="o">=</span><span class="n">label_layer</span><span class="p">)</span>
</pre></div>
</div>
<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"><ul class="first simple">
<li><strong>input</strong> (<em>LayerOutput</em>) &#8211; The input layer.</li>
<li><strong>label</strong> &#8211; The input label.</li>
<li><strong>name</strong> (<em>None|basestring</em>) &#8211; The name of this layers. It is not necessary.</li>
<li><strong>layer_attr</strong> (<a class="reference internal" href="attrs.html#paddle.trainer_config_helpers.attrs.ExtraLayerAttribute" title="paddle.trainer_config_helpers.attrs.ExtraLayerAttribute"><em>ExtraLayerAttribute</em></a>) &#8211; Extra Layer Attribute.</li>
</ul>
</td>
</tr>
<tr class="field-even field"><th class="field-name">返回:</th><td class="field-body"><p class="first">LayerOutput object.</p>
</td>
</tr>
<tr class="field-odd field"><th class="field-name">返回类型:</th><td class="field-body"><p class="first last">LayerOutput</p>
</td>
</tr>
</tbody>
</table>
</dd></dl>
</div>
</div>
<div class="section" id="check-layer">
......
......@@ -293,6 +293,7 @@
<li><a class="reference internal" href="#warp-ctc">warp_ctc</a></li>
<li><a class="reference internal" href="#nce">nce</a></li>
<li><a class="reference internal" href="#hsigmoid">hsigmoid</a></li>
<li><a class="reference internal" href="#smooth-l1-cost">smooth_l1_cost</a></li>
</ul>
</li>
<li><a class="reference internal" href="#check-layer">Check Layer</a><ul>
......@@ -2791,7 +2792,6 @@ Input should be a vector of positive numbers, without normalization.</p>
<tr class="field-odd field"><th class="field-name">参数:</th><td class="field-body"><ul class="first simple">
<li><strong>input</strong> (<em>paddle.v2.config_base.Layer</em>) &#8211; The first input layer.</li>
<li><strong>label</strong> &#8211; The input label.</li>
<li><strong>type</strong> (<em>basestring</em>) &#8211; The type of cost.</li>
<li><strong>name</strong> (<em>None|basestring</em>) &#8211; The name of this layers. It is not necessary.</li>
<li><strong>coeff</strong> (<em>float</em>) &#8211; The coefficient affects the gradient in the backward.</li>
<li><strong>layer_attr</strong> (<em>paddle.v2.attr.ExtraAttribute</em>) &#8211; Extra Layer Attribute.</li>
......@@ -3300,6 +3300,46 @@ False means no bias.</li>
</table>
</dd></dl>
</div>
<div class="section" id="smooth-l1-cost">
<h3>smooth_l1_cost<a class="headerlink" href="#smooth-l1-cost" title="永久链接至标题"></a></h3>
<dl class="class">
<dt>
<em class="property">class </em><code class="descclassname">paddle.v2.layer.</code><code class="descname">smooth_l1_cost</code><span class="sig-paren">(</span><em>*args</em>, <em>**kwargs</em><span class="sig-paren">)</span></dt>
<dd><p>This is a L1 loss but more smooth. It requires that the
size of input and label are equal. The formula is as follows,</p>
<div class="math">
\[L = \sum_{i} smooth_{L1}(input_i - label_i)\]</div>
<p>in which</p>
<div class="math">
\[\begin{split}smooth_{L1}(x) = \begin{cases} 0.5x^2&amp; \text{if} \ |x| &lt; 1 \\ |x|-0.5&amp; \text{otherwise} \end{cases}\end{split}\]</div>
<p>More details can be found by referring to <a class="reference external" href="https://arxiv.org/pdf/1504.08083v2.pdf">Fast R-CNN</a></p>
<div class="highlight-python"><div class="highlight"><pre><span></span><span class="n">cost</span> <span class="o">=</span> <span class="n">smooth_l1_cost</span><span class="p">(</span><span class="nb">input</span><span class="o">=</span><span class="nb">input</span><span class="p">,</span>
<span class="n">label</span><span class="o">=</span><span class="n">label</span><span class="p">)</span>
</pre></div>
</div>
<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"><ul class="first simple">
<li><strong>input</strong> (<em>paddle.v2.config_base.Layer</em>) &#8211; The input layer.</li>
<li><strong>label</strong> &#8211; The input label.</li>
<li><strong>name</strong> (<em>None|basestring</em>) &#8211; The name of this layers. It is not necessary.</li>
<li><strong>layer_attr</strong> (<em>paddle.v2.attr.ExtraAttribute</em>) &#8211; Extra Layer Attribute.</li>
</ul>
</td>
</tr>
<tr class="field-even field"><th class="field-name">返回:</th><td class="field-body"><p class="first">paddle.v2.config_base.Layer object.</p>
</td>
</tr>
<tr class="field-odd field"><th class="field-name">返回类型:</th><td class="field-body"><p class="first last">paddle.v2.config_base.Layer</p>
</td>
</tr>
</tbody>
</table>
</dd></dl>
</div>
</div>
<div class="section" id="check-layer">
......
此差异已折叠。
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册