layer.html 811.6 KB
Newer Older
1 2


Y
Yu Yang 已提交
3 4 5 6 7 8 9 10
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
  "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">


<html xmlns="http://www.w3.org/1999/xhtml">
  <head>
    <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
    
11
    <title>Base &#8212; PaddlePaddle  documentation</title>
Y
Yu Yang 已提交
12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28
    
    <link rel="stylesheet" href="../../../_static/classic.css" type="text/css" />
    <link rel="stylesheet" href="../../../_static/pygments.css" type="text/css" />
    
    <script type="text/javascript">
      var DOCUMENTATION_OPTIONS = {
        URL_ROOT:    '../../../',
        VERSION:     '',
        COLLAPSE_INDEX: false,
        FILE_SUFFIX: '.html',
        HAS_SOURCE:  true
      };
    </script>
    <script type="text/javascript" src="../../../_static/jquery.js"></script>
    <script type="text/javascript" src="../../../_static/underscore.js"></script>
    <script type="text/javascript" src="../../../_static/doctools.js"></script>
    <script type="text/javascript" src="https://cdn.mathjax.org/mathjax/latest/MathJax.js?config=TeX-AMS-MML_HTMLorMML"></script>
29 30
    <link rel="index" title="Index" href="../../../genindex.html" />
    <link rel="search" title="Search" href="../../../search.html" />
Y
Yu Yang 已提交
31 32
    <link rel="top" title="PaddlePaddle  documentation" href="../../../index.html" />
    <link rel="up" title="Layers Documents" href="index.html" />
Y
Yu Yang 已提交
33
    <link rel="next" title="Writing New Layers" href="../../../dev/new_layer/index.html" />
Y
Yu Yang 已提交
34
    <link rel="prev" title="Layers Documents" href="index.html" /> 
35 36 37 38 39 40 41 42 43 44
<script>
var _hmt = _hmt || [];
(function() {
  var hm = document.createElement("script");
  hm.src = "//hm.baidu.com/hm.js?b9a314ab40d04d805655aab1deee08ba";
  var s = document.getElementsByTagName("script")[0]; 
  s.parentNode.insertBefore(hm, s);
})();
</script>

Y
Yu Yang 已提交
45 46 47 48 49 50 51 52 53 54 55 56
  </head>
  <body role="document">
    <div class="related" role="navigation" aria-label="related navigation">
      <h3>Navigation</h3>
      <ul>
        <li class="right" style="margin-right: 10px">
          <a href="../../../genindex.html" title="General Index"
             accesskey="I">index</a></li>
        <li class="right" >
          <a href="../../../py-modindex.html" title="Python Module Index"
             >modules</a> |</li>
        <li class="right" >
Y
Yu Yang 已提交
57
          <a href="../../../dev/new_layer/index.html" title="Writing New Layers"
Y
Yu Yang 已提交
58 59 60 61
             accesskey="N">next</a> |</li>
        <li class="right" >
          <a href="index.html" title="Layers Documents"
             accesskey="P">previous</a> |</li>
62 63 64
        <li class="nav-item nav-item-0"><a href="../../../index.html">PaddlePaddle  documentation</a> &#187;</li>
          <li class="nav-item nav-item-1"><a href="../../../layer.html" >Layer Documents</a> &#187;</li>
          <li class="nav-item nav-item-2"><a href="index.html" accesskey="U">Layers Documents</a> &#187;</li> 
Y
Yu Yang 已提交
65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80
      </ul>
    </div>  

    <div class="document">
      <div class="documentwrapper">
        <div class="bodywrapper">
          <div class="body" role="main">
            
  <div class="section" id="base">
<h1>Base<a class="headerlink" href="#base" title="Permalink to this headline">¶</a></h1>
<div class="section" id="layer">
<h2>Layer<a class="headerlink" href="#layer" title="Permalink to this headline">¶</a></h2>
<dl class="class">
<dt id="_CPPv2N6paddle5LayerE">
<span id="paddle::Layer"></span><span class="target" id="paddleclasspaddle_1_1Layer"></span><em class="property">class </em><code class="descclassname">paddle::</code><code class="descname">Layer</code><a class="headerlink" href="#_CPPv2N6paddle5LayerE" title="Permalink to this definition">¶</a></dt>
<dd><p>Base class for layer. Define necessary variables and functions for every layer. </p>
81
<p>Subclassed by <a class="reference internal" href="#paddleclasspaddle_1_1AddtoLayer"><span class="std std-ref">paddle::AddtoLayer</span></a>, <a class="reference internal" href="#paddleclasspaddle_1_1AgentLayer"><span class="std std-ref">paddle::AgentLayer</span></a>, <a class="reference internal" href="#paddleclasspaddle_1_1BatchNormBaseLayer"><span class="std std-ref">paddle::BatchNormBaseLayer</span></a>, paddle::BilinearInterpLayer, <a class="reference internal" href="#paddleclasspaddle_1_1BlockExpandLayer"><span class="std std-ref">paddle::BlockExpandLayer</span></a>, paddle::BootBiasLayer, <a class="reference internal" href="#paddleclasspaddle_1_1ConcatenateLayer"><span class="std std-ref">paddle::ConcatenateLayer</span></a>, <a class="reference internal" href="#paddleclasspaddle_1_1ConcatenateLayer2"><span class="std std-ref">paddle::ConcatenateLayer2</span></a>, <a class="reference internal" href="#paddleclasspaddle_1_1ConvBaseLayer"><span class="std std-ref">paddle::ConvBaseLayer</span></a>, <a class="reference internal" href="#paddleclasspaddle_1_1ConvexCombinationLayer"><span class="std std-ref">paddle::ConvexCombinationLayer</span></a>, <a class="reference internal" href="#paddleclasspaddle_1_1ConvShiftLayer"><span class="std std-ref">paddle::ConvShiftLayer</span></a>, <a class="reference internal" href="#paddleclasspaddle_1_1CosSimLayer"><span class="std std-ref">paddle::CosSimLayer</span></a>, <a class="reference internal" href="#paddleclasspaddle_1_1CosSimVecMatLayer"><span class="std std-ref">paddle::CosSimVecMatLayer</span></a>, <a class="reference internal" href="#paddleclasspaddle_1_1CostLayer"><span class="std std-ref">paddle::CostLayer</span></a>, <a class="reference internal" href="#paddleclasspaddle_1_1CRFLayer"><span class="std std-ref">paddle::CRFLayer</span></a>, <a class="reference internal" href="#paddleclasspaddle_1_1CTCLayer"><span class="std std-ref">paddle::CTCLayer</span></a>, <a class="reference internal" href="#paddleclasspaddle_1_1DataLayer"><span class="std std-ref">paddle::DataLayer</span></a>, <a class="reference internal" href="#paddleclasspaddle_1_1DataNormLayer"><span class="std std-ref">paddle::DataNormLayer</span></a>, <a class="reference internal" href="#paddleclasspaddle_1_1EosIdCheckLayer"><span class="std std-ref">paddle::EosIdCheckLayer</span></a>, <a class="reference internal" href="#paddleclasspaddle_1_1ExpandLayer"><span class="std std-ref">paddle::ExpandLayer</span></a>, <a class="reference internal" href="#paddleclasspaddle_1_1FeatureMapExpandLayer"><span class="std std-ref">paddle::FeatureMapExpandLayer</span></a>, <a class="reference internal" href="#paddleclasspaddle_1_1FullyConnectedLayer"><span class="std std-ref">paddle::FullyConnectedLayer</span></a>, <a class="reference internal" href="#paddleclasspaddle_1_1GatedRecurrentLayer"><span class="std std-ref">paddle::GatedRecurrentLayer</span></a>, <a class="reference internal" href="#paddleclasspaddle_1_1GatherAgentLayer"><span class="std std-ref">paddle::GatherAgentLayer</span></a>, <a class="reference internal" href="#paddleclasspaddle_1_1GetOutputLayer"><span class="std std-ref">paddle::GetOutputLayer</span></a>, <a class="reference internal" href="#paddleclasspaddle_1_1GruStepLayer"><span class="std std-ref">paddle::GruStepLayer</span></a>, <a class="reference internal" href="#paddleclasspaddle_1_1HierarchicalSigmoidLayer"><span class="std std-ref">paddle::HierarchicalSigmoidLayer</span></a>, <a class="reference internal" href="#paddleclasspaddle_1_1InterpolationLayer"><span class="std std-ref">paddle::InterpolationLayer</span></a>, <a class="reference internal" href="#paddleclasspaddle_1_1LambdaCost"><span class="std std-ref">paddle::LambdaCost</span></a>, <a class="reference internal" href="#paddleclasspaddle_1_1LstmLayer"><span class="std std-ref">paddle::LstmLayer</span></a>, <a class="reference internal" href="#paddleclasspaddle_1_1LstmStepLayer"><span class="std std-ref">paddle::LstmStepLayer</span></a>, <a class="reference internal" href="#paddleclasspaddle_1_1MaxIdLayer"><span class="std std-ref">paddle::MaxIdLayer</span></a>, paddle::MaxOutLayer, <a class="reference internal" href="#paddleclasspaddle_1_1MixedLayer"><span class="std std-ref">paddle::MixedLayer</span></a>, <a class="reference internal" href="#paddleclasspaddle_1_1MultiplexLayer"><span class="std std-ref">paddle::MultiplexLayer</span></a>, <a class="reference internal" href="#paddleclasspaddle_1_1NCELayer"><span class="std std-ref">paddle::NCELayer</span></a>, <a class="reference internal" href="#paddleclasspaddle_1_1NormLayer"><span class="std std-ref">paddle::NormLayer</span></a>, <a class="reference internal" href="#paddleclasspaddle_1_1OuterProdLayer"><span class="std std-ref">paddle::OuterProdLayer</span></a>, <a class="reference internal" href="#paddleclasspaddle_1_1ParameterReluLayer"><span class="std std-ref">paddle::ParameterReluLayer</span></a>, <a class="reference internal" href="#paddleclasspaddle_1_1PoolLayer"><span class="std std-ref">paddle::PoolLayer</span></a>, <a class="reference internal" href="#paddleclasspaddle_1_1PowerLayer"><span class="std std-ref">paddle::PowerLayer</span></a>, paddle::PrintLayer, <a class="reference internal" href="#paddleclasspaddle_1_1RankingCost"><span class="std std-ref">paddle::RankingCost</span></a>, <a class="reference internal" href="#paddleclasspaddle_1_1RecurrentLayer"><span class="std std-ref">paddle::RecurrentLayer</span></a>, paddle::RecurrentLayerGroup, <a class="reference internal" href="#paddleclasspaddle_1_1ResizeLayer"><span class="std std-ref">paddle::ResizeLayer</span></a>, <a class="reference internal" href="#paddleclasspaddle_1_1SamplingIdLayer"><span class="std std-ref">paddle::SamplingIdLayer</span></a>, <a class="reference internal" href="#paddleclasspaddle_1_1ScalingLayer"><span class="std std-ref">paddle::ScalingLayer</span></a>, <a class="reference internal" href="#paddleclasspaddle_1_1ScatterAgentLayer"><span class="std std-ref">paddle::ScatterAgentLayer</span></a>, <a class="reference internal" href="#paddleclasspaddle_1_1SelectiveFullyConnectedLayer"><span class="std std-ref">paddle::SelectiveFullyConnectedLayer</span></a>, <a class="reference internal" href="#paddleclasspaddle_1_1SequenceConcatLayer"><span class="std std-ref">paddle::SequenceConcatLayer</span></a>, paddle::SequencePoolLayer, <a class="reference internal" href="#paddleclasspaddle_1_1SequenceReshapeLayer"><span class="std std-ref">paddle::SequenceReshapeLayer</span></a>, <a class="reference internal" href="#paddleclasspaddle_1_1SlopeInterceptLayer"><span class="std std-ref">paddle::SlopeInterceptLayer</span></a>, paddle::SpatialPyramidPoolLayer, <a class="reference internal" href="#paddleclasspaddle_1_1SubSequenceLayer"><span class="std std-ref">paddle::SubSequenceLayer</span></a>, <a class="reference internal" href="#paddleclasspaddle_1_1SumCostLayer"><span class="std std-ref">paddle::SumCostLayer</span></a>, <a class="reference internal" href="#paddleclasspaddle_1_1SumToOneNormLayer"><span class="std std-ref">paddle::SumToOneNormLayer</span></a>, <a class="reference internal" href="#paddleclasspaddle_1_1TensorLayer"><span class="std std-ref">paddle::TensorLayer</span></a>, <a class="reference internal" href="#paddleclasspaddle_1_1TransLayer"><span class="std std-ref">paddle::TransLayer</span></a>, <a class="reference internal" href="#paddleclasspaddle_1_1ValidationLayer"><span class="std std-ref">paddle::ValidationLayer</span></a></p>
82
<div class="breathe-sectiondef docutils container">
Y
Yu Yang 已提交
83 84 85
<p class="breathe-sectiondef-title rubric">Public Functions</p>
<dl class="function">
<dt id="_CPPv2N6paddle5Layer14waitInputValueEv">
86
<span id="paddle::Layer::waitInputValue"></span><span class="target" id="paddleclasspaddle_1_1Layer_1a91a73939067203aee3787a0cf634240a"></span>void <code class="descname">waitInputValue</code><span class="sig-paren">(</span><span class="sig-paren">)</span><a class="headerlink" href="#_CPPv2N6paddle5Layer14waitInputValueEv" title="Permalink to this definition">¶</a></dt>
87
<dd><p>Wait until all input value ready. Called before <a class="reference internal" href="#paddleclasspaddle_1_1Layer_1a12386b3f20dd731e7ceaa2c61667cbe1"><span class="std std-ref">Layer::forward()</span></a> function. </p>
Y
Yu Yang 已提交
88 89 90 91
</dd></dl>

<dl class="function">
<dt id="_CPPv2N6paddle5Layer23copyOutputToOtherDeviceEv">
92
<span id="paddle::Layer::copyOutputToOtherDevice"></span><span class="target" id="paddleclasspaddle_1_1Layer_1ab5232ce7ef7bfd4baca02a90b71e3f43"></span>void <code class="descname">copyOutputToOtherDevice</code><span class="sig-paren">(</span><span class="sig-paren">)</span><a class="headerlink" href="#_CPPv2N6paddle5Layer23copyOutputToOtherDeviceEv" title="Permalink to this definition">¶</a></dt>
93
<dd><p>Copy layer&#8217;s output_ to other device. If output layer is in other device, called after <a class="reference internal" href="#paddleclasspaddle_1_1Layer_1a12386b3f20dd731e7ceaa2c61667cbe1"><span class="std std-ref">Layer::forward()</span></a> function. </p>
Y
Yu Yang 已提交
94 95 96 97
</dd></dl>

<dl class="function">
<dt id="_CPPv2N6paddle5Layer22waitAndMergeOutputGradEv">
98
<span id="paddle::Layer::waitAndMergeOutputGrad"></span><span class="target" id="paddleclasspaddle_1_1Layer_1aeee80bb7aaefd1701f273919eba5dd9a"></span>void <code class="descname">waitAndMergeOutputGrad</code><span class="sig-paren">(</span><span class="sig-paren">)</span><a class="headerlink" href="#_CPPv2N6paddle5Layer22waitAndMergeOutputGradEv" title="Permalink to this definition">¶</a></dt>
99
<dd><p>Wait until all output grad ready and merge them to output_.grad. Called before <a class="reference internal" href="#paddleclasspaddle_1_1Layer_1a51bf2c7819a05925349a65f01868e15f"><span class="std std-ref">Layer::backward()</span></a> function. </p>
Y
Yu Yang 已提交
100 101 102 103
</dd></dl>

<dl class="function">
<dt id="_CPPv2N6paddle5Layer16markAllInputGradEv">
104
<span id="paddle::Layer::markAllInputGrad"></span><span class="target" id="paddleclasspaddle_1_1Layer_1a8ff04056b44d1596e6be2c7a4a0d3c5c"></span>void <code class="descname">markAllInputGrad</code><span class="sig-paren">(</span><span class="sig-paren">)</span><a class="headerlink" href="#_CPPv2N6paddle5Layer16markAllInputGradEv" title="Permalink to this definition">¶</a></dt>
105
<dd><p>Notify previous layer the output grad ready. Called after <a class="reference internal" href="#paddleclasspaddle_1_1Layer_1a51bf2c7819a05925349a65f01868e15f"><span class="std std-ref">Layer::backward()</span></a> function. </p>
Y
Yu Yang 已提交
106 107 108 109 110 111 112 113 114
</dd></dl>

<dl class="function">
<dt id="_CPPv2N6paddle5Layer5LayerERK11LayerConfigb">
<span id="paddle::Layer::Layer__LayerConfigCR.b"></span><span class="target" id="paddleclasspaddle_1_1Layer_1a6a298bfbba507e60af1e147ccecbb39c"></span><code class="descname">Layer</code><span class="sig-paren">(</span><em class="property">const</em> LayerConfig &amp;<em>config</em>, bool <em>useGpu</em> = FLAGS_use_gpu<span class="sig-paren">)</span><a class="headerlink" href="#_CPPv2N6paddle5Layer5LayerERK11LayerConfigb" title="Permalink to this definition">¶</a></dt>
<dd></dd></dl>

<dl class="function">
<dt id="_CPPv2N6paddle5LayerD0Ev">
115
<span id="paddle::Layer::~Layer"></span><span class="target" id="paddleclasspaddle_1_1Layer_1a133decb329423dc7e9d1a3562371aa14"></span><em class="property">virtual</em> <code class="descname">~Layer</code><span class="sig-paren">(</span><span class="sig-paren">)</span><a class="headerlink" href="#_CPPv2N6paddle5LayerD0Ev" title="Permalink to this definition">¶</a></dt>
Y
Yu Yang 已提交
116 117 118
<dd></dd></dl>

<dl class="function">
119 120
<dt id="_CPPv2NK6paddle5Layer12needGradientEv">
<span id="paddle::Layer::needGradientC"></span><span class="target" id="paddleclasspaddle_1_1Layer_1a19661e9e28e3cf338c7c239cfbb024b2"></span>bool <code class="descname">needGradient</code><span class="sig-paren">(</span><span class="sig-paren">)</span> <em class="property">const</em><a class="headerlink" href="#_CPPv2NK6paddle5Layer12needGradientEv" title="Permalink to this definition">¶</a></dt>
Y
Yu Yang 已提交
121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136
<dd><p>Get the flag whether layer need to compute gradient. </p>
</dd></dl>

<dl class="function">
<dt id="_CPPv2N6paddle5Layer15setNeedGradientEb">
<span id="paddle::Layer::setNeedGradient__b"></span><span class="target" id="paddleclasspaddle_1_1Layer_1aa2dab8596036b708d9c9ec78bab4530e"></span>void <code class="descname">setNeedGradient</code><span class="sig-paren">(</span>bool <em>need</em><span class="sig-paren">)</span><a class="headerlink" href="#_CPPv2N6paddle5Layer15setNeedGradientEb" title="Permalink to this definition">¶</a></dt>
<dd><p>Set the flag whether layer need to compute gradient. </p>
</dd></dl>

<dl class="function">
<dt id="_CPPv2N6paddle5Layer19setNeedSequenceInfoEb">
<span id="paddle::Layer::setNeedSequenceInfo__b"></span><span class="target" id="paddleclasspaddle_1_1Layer_1a47df0761caf8164187bf8bf6d9d74d5f"></span>void <code class="descname">setNeedSequenceInfo</code><span class="sig-paren">(</span>bool <em>need</em><span class="sig-paren">)</span><a class="headerlink" href="#_CPPv2N6paddle5Layer19setNeedSequenceInfoEb" title="Permalink to this definition">¶</a></dt>
<dd><p>Set the flag whether layer need to re-compute sequence information, which includes sequenceStartPositions or subSequenceStartPositions. </p>
</dd></dl>

<dl class="function">
137 138
<dt id="_CPPv2NK6paddle5Layer7getNameEv">
<span id="paddle::Layer::getNameC"></span><span class="target" id="paddleclasspaddle_1_1Layer_1a8b46d31fbd7549627a47ee4d551308b0"></span><em class="property">const</em> std::string &amp;<code class="descname">getName</code><span class="sig-paren">(</span><span class="sig-paren">)</span> <em class="property">const</em><a class="headerlink" href="#_CPPv2NK6paddle5Layer7getNameEv" title="Permalink to this definition">¶</a></dt>
Y
Yu Yang 已提交
139 140 141 142
<dd><p>Get layer&#8217;s name. </p>
</dd></dl>

<dl class="function">
143 144
<dt id="_CPPv2NK6paddle5Layer7getTypeEv">
<span id="paddle::Layer::getTypeC"></span><span class="target" id="paddleclasspaddle_1_1Layer_1ad859c5ce59f913ed0a06067c07da4f9a"></span><em class="property">const</em> std::string &amp;<code class="descname">getType</code><span class="sig-paren">(</span><span class="sig-paren">)</span> <em class="property">const</em><a class="headerlink" href="#_CPPv2NK6paddle5Layer7getTypeEv" title="Permalink to this definition">¶</a></dt>
Y
Yu Yang 已提交
145 146 147 148
<dd><p>Get layer&#8217;s type. </p>
</dd></dl>

<dl class="function">
149 150
<dt id="_CPPv2NK6paddle5Layer7getSizeEv">
<span id="paddle::Layer::getSizeC"></span><span class="target" id="paddleclasspaddle_1_1Layer_1a8b12bac2760d062f2b7a1f076f26acdb"></span>size_t <code class="descname">getSize</code><span class="sig-paren">(</span><span class="sig-paren">)</span> <em class="property">const</em><a class="headerlink" href="#_CPPv2NK6paddle5Layer7getSizeEv" title="Permalink to this definition">¶</a></dt>
Y
Yu Yang 已提交
151 152 153 154
<dd><p>Get layer&#8217;s size. </p>
</dd></dl>

<dl class="function">
155 156
<dt id="_CPPv2NK6paddle5Layer11getDeviceIdEv">
<span id="paddle::Layer::getDeviceIdC"></span><span class="target" id="paddleclasspaddle_1_1Layer_1a97a3ad4829025e36e7f1e8bc0d0c26f4"></span>int <code class="descname">getDeviceId</code><span class="sig-paren">(</span><span class="sig-paren">)</span> <em class="property">const</em><a class="headerlink" href="#_CPPv2NK6paddle5Layer11getDeviceIdEv" title="Permalink to this definition">¶</a></dt>
Y
Yu Yang 已提交
157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 201 202
<dd><p>Get layer&#8217;s deviceId. </p>
</dd></dl>

<dl class="function">
<dt id="_CPPv2N6paddle5Layer7addPrevE8LayerPtr">
<span id="paddle::Layer::addPrev__LayerPtr"></span><span class="target" id="paddleclasspaddle_1_1Layer_1a3312a52772507e92a73a3a27cd5b076a"></span>void <code class="descname">addPrev</code><span class="sig-paren">(</span>LayerPtr <em>l</em><span class="sig-paren">)</span><a class="headerlink" href="#_CPPv2N6paddle5Layer7addPrevE8LayerPtr" title="Permalink to this definition">¶</a></dt>
<dd><p>Add the inputLayer. </p>
</dd></dl>

<dl class="function">
<dt id="_CPPv2N6paddle5Layer7getPrevE6size_t">
<span id="paddle::Layer::getPrev__s"></span><span class="target" id="paddleclasspaddle_1_1Layer_1a48e3ff478d7d7b15657852de324491e8"></span><em class="property">const</em> LayerPtr &amp;<code class="descname">getPrev</code><span class="sig-paren">(</span>size_t <em>i</em><span class="sig-paren">)</span><a class="headerlink" href="#_CPPv2N6paddle5Layer7getPrevE6size_t" title="Permalink to this definition">¶</a></dt>
<dd><p>Get the size of inputLayer[i]. </p>
</dd></dl>

<dl class="function">
<dt id="_CPPv2N6paddle5Layer14getOutputValueEv">
<span id="paddle::Layer::getOutputValue"></span><span class="target" id="paddleclasspaddle_1_1Layer_1a95c9d244c48aefd2db163b82551d83d9"></span><em class="property">const</em> <a class="reference internal" href="../../math/matrix/matrix.html#_CPPv2N6paddle9MatrixPtrE" title="paddle::MatrixPtr">MatrixPtr</a> &amp;<code class="descname">getOutputValue</code><span class="sig-paren">(</span><span class="sig-paren">)</span><a class="headerlink" href="#_CPPv2N6paddle5Layer14getOutputValueEv" title="Permalink to this definition">¶</a></dt>
<dd><p>Get the forward-output value. </p>
</dd></dl>

<dl class="function">
<dt id="_CPPv2N6paddle5Layer14getOutputLabelEv">
<span id="paddle::Layer::getOutputLabel"></span><span class="target" id="paddleclasspaddle_1_1Layer_1aea1e4836ca96e47bb164970eb4788a2e"></span><em class="property">const</em> <a class="reference internal" href="../../math/matrix/matrix.html#_CPPv2N6paddle10IVectorPtrE" title="paddle::IVectorPtr">IVectorPtr</a> &amp;<code class="descname">getOutputLabel</code><span class="sig-paren">(</span><span class="sig-paren">)</span><a class="headerlink" href="#_CPPv2N6paddle5Layer14getOutputLabelEv" title="Permalink to this definition">¶</a></dt>
<dd><p>Get the forward-output label. </p>
</dd></dl>

<dl class="function">
<dt id="_CPPv2N6paddle5Layer13getOutputGradEv">
<span id="paddle::Layer::getOutputGrad"></span><span class="target" id="paddleclasspaddle_1_1Layer_1a1ec682608fd977401de453896b74579f"></span><em class="property">const</em> <a class="reference internal" href="../../math/matrix/matrix.html#_CPPv2N6paddle9MatrixPtrE" title="paddle::MatrixPtr">MatrixPtr</a> &amp;<code class="descname">getOutputGrad</code><span class="sig-paren">(</span><span class="sig-paren">)</span><a class="headerlink" href="#_CPPv2N6paddle5Layer13getOutputGradEv" title="Permalink to this definition">¶</a></dt>
<dd><p>Get the backward-Loss value. </p>
</dd></dl>

<dl class="function">
<dt id="_CPPv2N6paddle5Layer9setOutputERKNSt6stringEP8Argument">
<span id="paddle::Layer::setOutput__ssCR.ArgumentP"></span><span class="target" id="paddleclasspaddle_1_1Layer_1a8c80649b5009b66eb6dce90e53a92c94"></span>void <code class="descname">setOutput</code><span class="sig-paren">(</span><em class="property">const</em> std::string &amp;<em>name</em>, <a class="reference internal" href="../../parameter/parameter/parameter.html#_CPPv2N6paddle8ArgumentE" title="paddle::Argument">Argument</a> *<em>output</em><span class="sig-paren">)</span><a class="headerlink" href="#_CPPv2N6paddle5Layer9setOutputERKNSt6stringEP8Argument" title="Permalink to this definition">¶</a></dt>
<dd><p>If layer has multi-output, set output into outputMap_. </p>
</dd></dl>

<dl class="function">
<dt id="_CPPv2N6paddle5Layer9getOutputERKNSt6stringE">
<span id="paddle::Layer::getOutput__ssCR"></span><span class="target" id="paddleclasspaddle_1_1Layer_1a65d3a4089f522a117ae9d01938b7cbed"></span><a class="reference internal" href="../../parameter/parameter/parameter.html#_CPPv2N6paddle8ArgumentE" title="paddle::Argument">Argument</a> &amp;<code class="descname">getOutput</code><span class="sig-paren">(</span><em class="property">const</em> std::string &amp;<em>str</em> = &quot;&quot;<span class="sig-paren">)</span><a class="headerlink" href="#_CPPv2N6paddle5Layer9getOutputERKNSt6stringE" title="Permalink to this definition">¶</a></dt>
<dd><p>Get the output based on layer&#8217;s name. </p>
</dd></dl>

<dl class="function">
203 204
<dt id="_CPPv2NK6paddle5Layer9getOutputEi">
<span id="paddle::Layer::getOutput__iC"></span><span class="target" id="paddleclasspaddle_1_1Layer_1ab42874fb82be657320b741da6050eb27"></span><em class="property">const</em> <a class="reference internal" href="../../parameter/parameter/parameter.html#_CPPv2N6paddle8ArgumentE" title="paddle::Argument">Argument</a> &amp;<code class="descname">getOutput</code><span class="sig-paren">(</span>int <em>deviceId</em><span class="sig-paren">)</span> <em class="property">const</em><a class="headerlink" href="#_CPPv2NK6paddle5Layer9getOutputEi" title="Permalink to this definition">¶</a></dt>
Y
Yu Yang 已提交
205 206 207 208 209 210 211 212 213 214 215 216 217 218 219 220 221 222 223 224 225 226 227 228 229 230 231 232 233 234 235 236 237 238 239 240 241 242 243 244 245
<dd><p>Get the output based on deviceId. </p>
</dd></dl>

<dl class="function">
<dt id="_CPPv2N6paddle5Layer13getParametersEv">
<span id="paddle::Layer::getParameters"></span><span class="target" id="paddleclasspaddle_1_1Layer_1aafa6970a859e549e14c50a403da88a3a"></span><em class="property">const</em> std::vector&lt;<a class="reference internal" href="../../parameter/parameter/parameter.html#_CPPv2N6paddle12ParameterPtrE" title="paddle::ParameterPtr">ParameterPtr</a>&gt; &amp;<code class="descname">getParameters</code><span class="sig-paren">(</span><span class="sig-paren">)</span><a class="headerlink" href="#_CPPv2N6paddle5Layer13getParametersEv" title="Permalink to this definition">¶</a></dt>
<dd><p>Get layer&#8217;s parameters. </p>
</dd></dl>

<dl class="function">
<dt id="_CPPv2N6paddle5Layer16getBiasParameterEv">
<span id="paddle::Layer::getBiasParameter"></span><span class="target" id="paddleclasspaddle_1_1Layer_1a1d78c8155c9234ff94fb8ce5ad46469e"></span><em class="property">const</em> <a class="reference internal" href="../../parameter/parameter/parameter.html#_CPPv2N6paddle12ParameterPtrE" title="paddle::ParameterPtr">ParameterPtr</a> &amp;<code class="descname">getBiasParameter</code><span class="sig-paren">(</span><span class="sig-paren">)</span><a class="headerlink" href="#_CPPv2N6paddle5Layer16getBiasParameterEv" title="Permalink to this definition">¶</a></dt>
<dd><p>Get layer&#8217;s bias-parameters. </p>
</dd></dl>

<dl class="function">
<dt id="_CPPv2N6paddle5Layer12resizeOutputE6size_t6size_t">
<span id="paddle::Layer::resizeOutput__s.s"></span><span class="target" id="paddleclasspaddle_1_1Layer_1af9c609c8d8ecc5144f1b3fdfcf280f0b"></span>void <code class="descname">resizeOutput</code><span class="sig-paren">(</span>size_t <em>height</em>, size_t <em>width</em><span class="sig-paren">)</span><a class="headerlink" href="#_CPPv2N6paddle5Layer12resizeOutputE6size_t6size_t" title="Permalink to this definition">¶</a></dt>
<dd><p>Resize the output matrix size. </p>
</dd></dl>

<dl class="function">
<dt id="_CPPv2N6paddle5Layer13reserveOutputE6size_t6size_t">
<span id="paddle::Layer::reserveOutput__s.s"></span><span class="target" id="paddleclasspaddle_1_1Layer_1a8ddb80774cd6431697be97b9cfb1999c"></span>void <code class="descname">reserveOutput</code><span class="sig-paren">(</span>size_t <em>height</em>, size_t <em>width</em><span class="sig-paren">)</span><a class="headerlink" href="#_CPPv2N6paddle5Layer13reserveOutputE6size_t6size_t" title="Permalink to this definition">¶</a></dt>
<dd><p>Resize the output matrix size, and reset value to zero. </p>
</dd></dl>

<dl class="function">
<dt id="_CPPv2N6paddle5Layer11resetOutputE6size_t6size_t">
<span id="paddle::Layer::resetOutput__s.s"></span><span class="target" id="paddleclasspaddle_1_1Layer_1a350b11916f118b1d5a8a01663c699cb6"></span>void <code class="descname">resetOutput</code><span class="sig-paren">(</span>size_t <em>height</em>, size_t <em>width</em><span class="sig-paren">)</span><a class="headerlink" href="#_CPPv2N6paddle5Layer11resetOutputE6size_t6size_t" title="Permalink to this definition">¶</a></dt>
<dd><p>Resize the output matrix size, and reset value and grad to zero. </p>
</dd></dl>

<dl class="function">
<dt id="_CPPv2N6paddle5Layer8zeroGradEv">
<span id="paddle::Layer::zeroGrad"></span><span class="target" id="paddleclasspaddle_1_1Layer_1a327284501ae27aa499045291171e6003"></span>void <code class="descname">zeroGrad</code><span class="sig-paren">(</span><span class="sig-paren">)</span><a class="headerlink" href="#_CPPv2N6paddle5Layer8zeroGradEv" title="Permalink to this definition">¶</a></dt>
<dd><p>Clear the gradient of output. </p>
</dd></dl>

<dl class="function">
<dt id="_CPPv2N6paddle5Layer4initERK8LayerMapRK12ParameterMap">
246
<span id="paddle::Layer::init__LayerMapCR.ParameterMapCR"></span><span class="target" id="paddleclasspaddle_1_1Layer_1a18c89afb67652868604e87b53a72df94"></span>bool <code class="descname">init</code><span class="sig-paren">(</span><em class="property">const</em> LayerMap &amp;<em>layerMap</em>, <em class="property">const</em> <a class="reference internal" href="../../parameter/parameter/parameter.html#_CPPv2N6paddle12ParameterMapE" title="paddle::ParameterMap">ParameterMap</a> &amp;<em>parameterMap</em><span class="sig-paren">)</span><a class="headerlink" href="#_CPPv2N6paddle5Layer4initERK8LayerMapRK12ParameterMap" title="Permalink to this definition">¶</a></dt>
Y
Yu Yang 已提交
247 248 249 250 251
<dd><p>Intialization. For example, adding input layers from layerMap and parameterMap. </p>
</dd></dl>

<dl class="function">
<dt id="_CPPv2N6paddle5Layer14initSubNetworkEP13NeuralNetworkRK11ModelConfigRKNSt6vectorI13ParameterTypeEEb">
252
<span id="paddle::Layer::initSubNetwork__NeuralNetworkP.ModelConfigCR.std::vector:ParameterType:CR.b"></span><span class="target" id="paddleclasspaddle_1_1Layer_1aa28cdc78c4ae7bdc41d20e5d96fec9f1"></span><em class="property">virtual</em> void <code class="descname">initSubNetwork</code><span class="sig-paren">(</span><a class="reference internal" href="../gradientmachines/gradientmachines.html#_CPPv2N6paddle13NeuralNetworkE" title="paddle::NeuralNetwork">NeuralNetwork</a> *<em>rootNetwork</em>, <em class="property">const</em> <a class="reference internal" href="../../api/api.html#_CPPv211ModelConfig" title="ModelConfig">ModelConfig</a> &amp;<em>config</em>, <em class="property">const</em> std::vector&lt;ParameterType&gt; &amp;<em>parameterTypes</em>, bool <em>useGpu</em><span class="sig-paren">)</span><a class="headerlink" href="#_CPPv2N6paddle5Layer14initSubNetworkEP13NeuralNetworkRK11ModelConfigRKNSt6vectorI13ParameterTypeEEb" title="Permalink to this definition">¶</a></dt>
Y
Yu Yang 已提交
253 254
<dd><p>Intialization for sub network if there has sub network. <dl class="docutils">
<dt><strong>Parameters</strong></dt>
255 256 257 258 259
<dd><ul class="breatheparameterlist first last simple">
<li><code class="docutils literal"><span class="pre">rootNetwork</span></code>: root network </li>
<li><code class="docutils literal"><span class="pre">config</span></code>: model config </li>
<li><code class="docutils literal"><span class="pre">parameterTypes</span></code>: parameter&#8217;s type </li>
<li><code class="docutils literal"><span class="pre">useGpu</span></code>: whether to use gpu or not </li>
Y
Yu Yang 已提交
260 261 262 263 264 265 266 267
</ul>
</dd>
</dl>
</p>
</dd></dl>

<dl class="function">
<dt id="_CPPv2N6paddle5Layer16accessSubNetworkERKNSt8functionIFvR13NeuralNetworkEEE">
268
<span class="target" id="paddleclasspaddle_1_1Layer_1a80e1752698b61409984b7f789aec1c44"></span><em class="property">virtual</em> void <code class="descname">accessSubNetwork</code><span class="sig-paren">(</span><em class="property">const</em> std::function&lt;void<span class="sig-paren">(</span><a class="reference internal" href="../gradientmachines/gradientmachines.html#_CPPv2N6paddle13NeuralNetworkE" title="paddle::NeuralNetwork">NeuralNetwork</a>&amp;<span class="sig-paren">)</span>&gt; &amp;<em>callback</em><span class="sig-paren">)</span><a class="headerlink" href="#_CPPv2N6paddle5Layer16accessSubNetworkERKNSt8functionIFvR13NeuralNetworkEEE" title="Permalink to this definition">¶</a></dt>
Y
Yu Yang 已提交
269 270 271
<dd><p>Access SubNetwork Object. If subnetwork exists, then invoke callback with subnetwrk. </p>
<p><dl class="docutils">
<dt><strong>Parameters</strong></dt>
272 273
<dd><ul class="breatheparameterlist first last simple">
<li><code class="docutils literal"><span class="pre">callback</span></code>: if sub-network is exist, the callback is invoked. </li>
Y
Yu Yang 已提交
274 275 276 277 278 279 280 281
</ul>
</dd>
</dl>
</p>
</dd></dl>

<dl class="function">
<dt id="_CPPv2N6paddle5Layer8prefetchEv">
282
<span id="paddle::Layer::prefetch"></span><span class="target" id="paddleclasspaddle_1_1Layer_1a485106c46ee55c9bc8ce67460738d99a"></span><em class="property">virtual</em> void <code class="descname">prefetch</code><span class="sig-paren">(</span><span class="sig-paren">)</span><a class="headerlink" href="#_CPPv2N6paddle5Layer8prefetchEv" title="Permalink to this definition">¶</a></dt>
Y
Yu Yang 已提交
283 284 285 286 287
<dd><p>If use sparse row matrix as parameter, prefetch feature ids in input label. </p>
</dd></dl>

<dl class="function">
<dt id="_CPPv2N6paddle5Layer7forwardE8PassType">
288
<span id="paddle::Layer::forward__PassType"></span><span class="target" id="paddleclasspaddle_1_1Layer_1a12386b3f20dd731e7ceaa2c61667cbe1"></span><em class="property">virtual</em> void <code class="descname">forward</code><span class="sig-paren">(</span>PassType <em>passType</em><span class="sig-paren">)</span><a class="headerlink" href="#_CPPv2N6paddle5Layer7forwardE8PassType" title="Permalink to this definition">¶</a></dt>
Y
Yu Yang 已提交
289 290 291 292 293
<dd><p>Forward propagation. All inherited implementation should call Layer::foward() function. </p>
</dd></dl>

<dl class="function">
<dt id="_CPPv2N6paddle5Layer10resetStateEv">
294
<span id="paddle::Layer::resetState"></span><span class="target" id="paddleclasspaddle_1_1Layer_1a7e3f24861a6bdd6ede74d3d1ee96af5b"></span><em class="property">virtual</em> void <code class="descname">resetState</code><span class="sig-paren">(</span><span class="sig-paren">)</span><a class="headerlink" href="#_CPPv2N6paddle5Layer10resetStateEv" title="Permalink to this definition">¶</a></dt>
295 296
<dd><p>Reset the internal state variables. Allocate them if they have not been allocated. This function need to called before <a class="reference internal" href="#paddleclasspaddle_1_1Layer_1a12386b3f20dd731e7ceaa2c61667cbe1"><span class="std std-ref">Layer::forward()</span></a> for generating sequence.</p>
<p>This is used for sequence generation. When generating sequence, the calculation at current timestamp depends on the state from previous timestamp. The model needs to keep the information about the previous timestamp in the state variables. Layers such as <a class="reference internal" href="#paddleclasspaddle_1_1RecurrentLayer"><span class="std std-ref">RecurrentLayer</span></a>, <a class="reference internal" href="#paddleclasspaddle_1_1LstmLayer"><span class="std std-ref">LstmLayer</span></a> and ContextLayer have state variables. </p>
Y
Yu Yang 已提交
297 298 299 300
</dd></dl>

<dl class="function">
<dt id="_CPPv2N6paddle5Layer8setStateE13LayerStatePtr">
301
<span id="paddle::Layer::setState__LayerStatePtr"></span><span class="target" id="paddleclasspaddle_1_1Layer_1a5c8853a23011c7f78248946af05b61fa"></span><em class="property">virtual</em> void <code class="descname">setState</code><span class="sig-paren">(</span>LayerStatePtr <em>state</em><span class="sig-paren">)</span><a class="headerlink" href="#_CPPv2N6paddle5Layer8setStateE13LayerStatePtr" title="Permalink to this definition">¶</a></dt>
Y
Yu Yang 已提交
302 303 304 305 306
<dd><p>Set layer state. </p>
</dd></dl>

<dl class="function">
<dt id="_CPPv2N6paddle5Layer8getStateEv">
307
<span id="paddle::Layer::getState"></span><span class="target" id="paddleclasspaddle_1_1Layer_1a167ca853f91da5189f71de12c3dfaa81"></span><em class="property">virtual</em> LayerStatePtr <code class="descname">getState</code><span class="sig-paren">(</span><span class="sig-paren">)</span><a class="headerlink" href="#_CPPv2N6paddle5Layer8getStateEv" title="Permalink to this definition">¶</a></dt>
Y
Yu Yang 已提交
308 309 310 311 312 313 314 315 316 317 318 319 320 321 322
<dd><p>Get layer state. <dl class="docutils">
<dt><strong>Return</strong></dt>
<dd>A copy of internal state. </dd>
</dl>
</p>
</dd></dl>

<dl class="function">
<dt id="_CPPv2N6paddle5Layer15showOutputStatsEv">
<span id="paddle::Layer::showOutputStats"></span><span class="target" id="paddleclasspaddle_1_1Layer_1ae04dc22691d3899b41d6f72a407e376a"></span>void <code class="descname">showOutputStats</code><span class="sig-paren">(</span><span class="sig-paren">)</span><a class="headerlink" href="#_CPPv2N6paddle5Layer15showOutputStatsEv" title="Permalink to this definition">¶</a></dt>
<dd><p>Show output state. </p>
</dd></dl>

<dl class="function">
<dt id="_CPPv2N6paddle5Layer8backwardERK14UpdateCallback">
323
<span id="paddle::Layer::backward__UpdateCallbackCR"></span><span class="target" id="paddleclasspaddle_1_1Layer_1a51bf2c7819a05925349a65f01868e15f"></span><em class="property">virtual</em> void <code class="descname">backward</code><span class="sig-paren">(</span><em class="property">const</em> <a class="reference internal" href="../../parameter/parameter/parameter.html#_CPPv2N6paddle14UpdateCallbackE" title="paddle::UpdateCallback">UpdateCallback</a> &amp;<em>callback</em> = nullptr<span class="sig-paren">)</span> = 0<a class="headerlink" href="#_CPPv2N6paddle5Layer8backwardERK14UpdateCallback" title="Permalink to this definition">¶</a></dt>
324
<dd><p>Backward propagation. Should only be called after <a class="reference internal" href="#paddleclasspaddle_1_1Layer_1a12386b3f20dd731e7ceaa2c61667cbe1"><span class="std std-ref">Layer::forward()</span></a> function. </p>
Y
Yu Yang 已提交
325 326 327 328
</dd></dl>

<dl class="function">
<dt id="_CPPv2N6paddle5Layer9onPassEndEv">
329
<span id="paddle::Layer::onPassEnd"></span><span class="target" id="paddleclasspaddle_1_1Layer_1a69d55d94f5aa536669b8d6ebc95487c2"></span><em class="property">virtual</em> void <code class="descname">onPassEnd</code><span class="sig-paren">(</span><span class="sig-paren">)</span><a class="headerlink" href="#_CPPv2N6paddle5Layer9onPassEndEv" title="Permalink to this definition">¶</a></dt>
Y
Yu Yang 已提交
330 331 332 333
<dd><p>One pass is finished. </p>
</dd></dl>

</div>
334
<div class="breathe-sectiondef docutils container">
Y
Yu Yang 已提交
335 336 337 338 339 340 341 342
<p class="breathe-sectiondef-title rubric">Public Static Functions</p>
<dl class="function">
<dt id="_CPPv2N6paddle5Layer6createERK11LayerConfig">
<span id="paddle::Layer::create__LayerConfigCR"></span><span class="target" id="paddleclasspaddle_1_1Layer_1aaf45a53c76df051b409fd8c9cb6d6915"></span>LayerPtr <code class="descname">create</code><span class="sig-paren">(</span><em class="property">const</em> LayerConfig &amp;<em>config</em><span class="sig-paren">)</span><a class="headerlink" href="#_CPPv2N6paddle5Layer6createERK11LayerConfig" title="Permalink to this definition">¶</a></dt>
<dd><p>Create pointer of layer. </p>
</dd></dl>

</div>
343
<div class="breathe-sectiondef docutils container">
Y
Yu Yang 已提交
344 345 346
<p class="breathe-sectiondef-title rubric">Public Static Attributes</p>
<dl class="member">
<dt id="_CPPv2N6paddle5Layer10registrar_E">
347 348
<span id="paddle::Layer::registrar___ClassRegistrar:Layer.LayerConfig:"></span><span class="target" id="paddleclasspaddle_1_1Layer_1ac1be67e555935b8c4c54b9a847987f0b"></span>ClassRegistrar&lt;<a class="reference internal" href="#_CPPv2N6paddle5LayerE" title="paddle::Layer">Layer</a>, LayerConfig&gt; <code class="descname">registrar_</code><a class="headerlink" href="#_CPPv2N6paddle5Layer10registrar_E" title="Permalink to this definition">¶</a></dt>
<dd><p>Register a <a class="reference internal" href="#paddleclasspaddle_1_1Layer"><span class="std std-ref">Layer</span></a>. </p>
Y
Yu Yang 已提交
349 350 351
</dd></dl>

</div>
352
<div class="breathe-sectiondef docutils container">
Y
Yu Yang 已提交
353 354 355 356 357 358 359 360
<p class="breathe-sectiondef-title rubric">Protected Functions</p>
<dl class="function">
<dt id="_CPPv2N6paddle5Layer13markInputGradEi">
<span id="paddle::Layer::markInputGrad__i"></span><span class="target" id="paddleclasspaddle_1_1Layer_1a9416581ce1f5609bd9fa078284131a0c"></span>void <code class="descname">markInputGrad</code><span class="sig-paren">(</span>int <em>inputIndex</em><span class="sig-paren">)</span><a class="headerlink" href="#_CPPv2N6paddle5Layer13markInputGradEi" title="Permalink to this definition">¶</a></dt>
<dd><p>Notify specified layer the output grad ready. Called in the backward function. If do mark input grad in the backward function, you should to ensure that all input grad will be marked in the backward function. </p>
</dd></dl>

<dl class="function">
361 362
<dt id="_CPPv2NK6paddle5Layer8getInputE6size_t">
<span id="paddle::Layer::getInput__sC"></span><span class="target" id="paddleclasspaddle_1_1Layer_1af00f0b773d300e3e39a2464e75bdd570"></span><em class="property">const</em> <a class="reference internal" href="../../parameter/parameter/parameter.html#_CPPv2N6paddle8ArgumentE" title="paddle::Argument">Argument</a> &amp;<code class="descname">getInput</code><span class="sig-paren">(</span>size_t <em>inputIndex</em><span class="sig-paren">)</span> <em class="property">const</em><a class="headerlink" href="#_CPPv2NK6paddle5Layer8getInputE6size_t" title="Permalink to this definition">¶</a></dt>
Y
Yu Yang 已提交
363 364 365 366
<dd><p>Get the argument of input layer. </p>
</dd></dl>

<dl class="function">
367 368
<dt id="_CPPv2NK6paddle5Layer8getInputERK5Layer">
<span id="paddle::Layer::getInput__LayerCRC"></span><span class="target" id="paddleclasspaddle_1_1Layer_1a9a87c663421730384a73e015eae317a9"></span><em class="property">const</em> <a class="reference internal" href="../../parameter/parameter/parameter.html#_CPPv2N6paddle8ArgumentE" title="paddle::Argument">Argument</a> &amp;<code class="descname">getInput</code><span class="sig-paren">(</span><em class="property">const</em> <a class="reference internal" href="#_CPPv2N6paddle5LayerE" title="paddle::Layer">Layer</a> &amp;<em>inputLayer</em><span class="sig-paren">)</span> <em class="property">const</em><a class="headerlink" href="#_CPPv2NK6paddle5Layer8getInputERK5Layer" title="Permalink to this definition">¶</a></dt>
Y
Yu Yang 已提交
369 370 371 372 373 374 375 376 377 378 379
<dd><p>Get the argument of input layer. </p>
</dd></dl>

<dl class="function">
<dt id="_CPPv2N6paddle5Layer13getInputValueEi">
<span id="paddle::Layer::getInputValue__i"></span><span class="target" id="paddleclasspaddle_1_1Layer_1a8ed348f4bf5e2509ba553380ceabff5c"></span><em class="property">const</em> <a class="reference internal" href="../../math/matrix/matrix.html#_CPPv2N6paddle9MatrixPtrE" title="paddle::MatrixPtr">MatrixPtr</a> &amp;<code class="descname">getInputValue</code><span class="sig-paren">(</span>int <em>inputIndex</em><span class="sig-paren">)</span><a class="headerlink" href="#_CPPv2N6paddle5Layer13getInputValueEi" title="Permalink to this definition">¶</a></dt>
<dd><p>Get the forward-input value. </p>
</dd></dl>

<dl class="function">
<dt id="_CPPv2N6paddle5Layer13getInputValueERK5Layer">
380
<span id="paddle::Layer::getInputValue__LayerCR"></span><span class="target" id="paddleclasspaddle_1_1Layer_1afabccf627d32a0da7f2e5848359ddffa"></span><em class="property">const</em> <a class="reference internal" href="../../math/matrix/matrix.html#_CPPv2N6paddle9MatrixPtrE" title="paddle::MatrixPtr">MatrixPtr</a> &amp;<code class="descname">getInputValue</code><span class="sig-paren">(</span><em class="property">const</em> <a class="reference internal" href="#_CPPv2N6paddle5LayerE" title="paddle::Layer">Layer</a> &amp;<em>inputLayer</em><span class="sig-paren">)</span><a class="headerlink" href="#_CPPv2N6paddle5Layer13getInputValueERK5Layer" title="Permalink to this definition">¶</a></dt>
Y
Yu Yang 已提交
381 382 383 384 385 386 387 388 389 390 391
<dd><p>Get the forward-input value. </p>
</dd></dl>

<dl class="function">
<dt id="_CPPv2N6paddle5Layer12getInputGradEi">
<span id="paddle::Layer::getInputGrad__i"></span><span class="target" id="paddleclasspaddle_1_1Layer_1a91f8ed6a92c5ae035dbfa5badb2eb780"></span><em class="property">const</em> <a class="reference internal" href="../../math/matrix/matrix.html#_CPPv2N6paddle9MatrixPtrE" title="paddle::MatrixPtr">MatrixPtr</a> &amp;<code class="descname">getInputGrad</code><span class="sig-paren">(</span>int <em>inputIndex</em><span class="sig-paren">)</span><a class="headerlink" href="#_CPPv2N6paddle5Layer12getInputGradEi" title="Permalink to this definition">¶</a></dt>
<dd><p>Get the forward-input grad. </p>
</dd></dl>

<dl class="function">
<dt id="_CPPv2N6paddle5Layer12getInputGradERK5Layer">
392
<span id="paddle::Layer::getInputGrad__LayerCR"></span><span class="target" id="paddleclasspaddle_1_1Layer_1acb59b08bd5008513011d516332c1a3be"></span><em class="property">const</em> <a class="reference internal" href="../../math/matrix/matrix.html#_CPPv2N6paddle9MatrixPtrE" title="paddle::MatrixPtr">MatrixPtr</a> &amp;<code class="descname">getInputGrad</code><span class="sig-paren">(</span><em class="property">const</em> <a class="reference internal" href="#_CPPv2N6paddle5LayerE" title="paddle::Layer">Layer</a> &amp;<em>inputLayer</em><span class="sig-paren">)</span><a class="headerlink" href="#_CPPv2N6paddle5Layer12getInputGradERK5Layer" title="Permalink to this definition">¶</a></dt>
Y
Yu Yang 已提交
393 394 395 396 397
<dd><p>Get the forward-input grad. </p>
</dd></dl>

<dl class="function">
<dt id="_CPPv2N6paddle5Layer13getInputLabelERK5Layer">
398
<span id="paddle::Layer::getInputLabel__LayerCR"></span><span class="target" id="paddleclasspaddle_1_1Layer_1abba8cfe5f7a5ebbd9558ebfb655d4b61"></span><em class="property">const</em> <a class="reference internal" href="../../math/matrix/matrix.html#_CPPv2N6paddle10IVectorPtrE" title="paddle::IVectorPtr">IVectorPtr</a> &amp;<code class="descname">getInputLabel</code><span class="sig-paren">(</span><em class="property">const</em> <a class="reference internal" href="#_CPPv2N6paddle5LayerE" title="paddle::Layer">Layer</a> &amp;<em>inputLayer</em><span class="sig-paren">)</span><a class="headerlink" href="#_CPPv2N6paddle5Layer13getInputLabelERK5Layer" title="Permalink to this definition">¶</a></dt>
Y
Yu Yang 已提交
399 400 401 402 403 404 405 406 407 408 409 410 411 412 413 414 415 416 417 418 419 420 421 422 423 424 425 426 427 428 429 430 431 432 433 434 435 436 437 438
<dd><p>Get the forward-input label. </p>
</dd></dl>

<dl class="function">
<dt id="_CPPv2N6paddle5Layer18resetSpecifyOutputER8Argument6size_t6size_tbb">
<span id="paddle::Layer::resetSpecifyOutput__ArgumentR.s.s.b.b"></span><span class="target" id="paddleclasspaddle_1_1Layer_1aa095e40a41695ab4968fe7b61ea0cda2"></span>void <code class="descname">resetSpecifyOutput</code><span class="sig-paren">(</span><a class="reference internal" href="../../parameter/parameter/parameter.html#_CPPv2N6paddle8ArgumentE" title="paddle::Argument">Argument</a> &amp;<em>output</em>, size_t <em>height</em>, size_t <em>width</em>, bool <em>isValueClean</em>, bool <em>isGradClean</em><span class="sig-paren">)</span><a class="headerlink" href="#_CPPv2N6paddle5Layer18resetSpecifyOutputER8Argument6size_t6size_tbb" title="Permalink to this definition">¶</a></dt>
<dd><p>Change the size of output (value, grad). Reset to value zero if isValueClean = true, Reset to grad zero if isGradClean = true. </p>
</dd></dl>

<dl class="function">
<dt id="_CPPv2N6paddle5Layer17addOutputArgumentEi">
<span id="paddle::Layer::addOutputArgument__i"></span><span class="target" id="paddleclasspaddle_1_1Layer_1ae859412318b0b79c1669ccbd0f663593"></span>void <code class="descname">addOutputArgument</code><span class="sig-paren">(</span>int <em>deviceId</em><span class="sig-paren">)</span><a class="headerlink" href="#_CPPv2N6paddle5Layer17addOutputArgumentEi" title="Permalink to this definition">¶</a></dt>
<dd><p>Add output argument to other devices. </p>
</dd></dl>

<dl class="function">
<dt id="_CPPv2N6paddle5Layer17forwardActivationEv">
<span id="paddle::Layer::forwardActivation"></span><span class="target" id="paddleclasspaddle_1_1Layer_1ad7ad1fcbf801ba30a248949ca415c3e8"></span>void <code class="descname">forwardActivation</code><span class="sig-paren">(</span><span class="sig-paren">)</span><a class="headerlink" href="#_CPPv2N6paddle5Layer17forwardActivationEv" title="Permalink to this definition">¶</a></dt>
<dd><p>Forward of activation function. </p>
</dd></dl>

<dl class="function">
<dt id="_CPPv2N6paddle5Layer18backwardActivationEv">
<span id="paddle::Layer::backwardActivation"></span><span class="target" id="paddleclasspaddle_1_1Layer_1a5aef0a51af761eb8427f6752f175fb31"></span>void <code class="descname">backwardActivation</code><span class="sig-paren">(</span><span class="sig-paren">)</span><a class="headerlink" href="#_CPPv2N6paddle5Layer18backwardActivationEv" title="Permalink to this definition">¶</a></dt>
<dd><p>Backward of activation function. </p>
</dd></dl>

<dl class="function">
<dt id="_CPPv2N6paddle5Layer14forwardDropOutEv">
<span id="paddle::Layer::forwardDropOut"></span><span class="target" id="paddleclasspaddle_1_1Layer_1a5ce995462e230e7c7909e3cb45afa160"></span>void <code class="descname">forwardDropOut</code><span class="sig-paren">(</span><span class="sig-paren">)</span><a class="headerlink" href="#_CPPv2N6paddle5Layer14forwardDropOutEv" title="Permalink to this definition">¶</a></dt>
<dd><p>Forward of dropOut. </p>
</dd></dl>

<dl class="function">
<dt id="_CPPv2N6paddle5Layer13initNeedFlagsEv">
<span id="paddle::Layer::initNeedFlags"></span><span class="target" id="paddleclasspaddle_1_1Layer_1a6937a2829e94af85c0b8d00491fae31c"></span>void <code class="descname">initNeedFlags</code><span class="sig-paren">(</span><span class="sig-paren">)</span><a class="headerlink" href="#_CPPv2N6paddle5Layer13initNeedFlagsEv" title="Permalink to this definition">¶</a></dt>
<dd><p>Initilize the needGradient_ flag. </p>
</dd></dl>

</div>
439
<div class="breathe-sectiondef docutils container">
Y
Yu Yang 已提交
440 441 442 443
<p class="breathe-sectiondef-title rubric">Protected Attributes</p>
<dl class="member">
<dt id="_CPPv2N6paddle5Layer7config_E">
<span id="paddle::Layer::config___LayerConfig"></span><span class="target" id="paddleclasspaddle_1_1Layer_1a8f26b5361a4a7c4e217c135834330aaf"></span>LayerConfig <code class="descname">config_</code><a class="headerlink" href="#_CPPv2N6paddle5Layer7config_E" title="Permalink to this definition">¶</a></dt>
444
<dd><p><a class="reference internal" href="#paddleclasspaddle_1_1Layer"><span class="std std-ref">Layer</span></a> config. </p>
Y
Yu Yang 已提交
445 446 447 448 449 450 451 452 453 454 455 456 457 458 459 460 461 462 463 464 465 466 467
</dd></dl>

<dl class="member">
<dt id="_CPPv2N6paddle5Layer7useGpu_E">
<span id="paddle::Layer::useGpu___b"></span><span class="target" id="paddleclasspaddle_1_1Layer_1a4d85bb9983962e0db6dc24fd68a2cf96"></span>bool <code class="descname">useGpu_</code><a class="headerlink" href="#_CPPv2N6paddle5Layer7useGpu_E" title="Permalink to this definition">¶</a></dt>
<dd><p>whether to use GPU </p>
</dd></dl>

<dl class="member">
<dt id="_CPPv2N6paddle5Layer9deviceId_E">
<span id="paddle::Layer::deviceId___i"></span><span class="target" id="paddleclasspaddle_1_1Layer_1a283dfd2540939278b8b5e338328e905c"></span>int <code class="descname">deviceId_</code><a class="headerlink" href="#_CPPv2N6paddle5Layer9deviceId_E" title="Permalink to this definition">¶</a></dt>
<dd><p>Device Id. CPU is -1, and GPU is 0, 1, 2 ... </p>
</dd></dl>

<dl class="member">
<dt id="_CPPv2N6paddle5Layer12inputLayers_E">
<span id="paddle::Layer::inputLayers___std::vector:LayerPtr:"></span><span class="target" id="paddleclasspaddle_1_1Layer_1aad6b349ac2fc4a49bc32db91b4d49bd7"></span>std::vector&lt;LayerPtr&gt; <code class="descname">inputLayers_</code><a class="headerlink" href="#_CPPv2N6paddle5Layer12inputLayers_E" title="Permalink to this definition">¶</a></dt>
<dd><p>Input layers. </p>
</dd></dl>

<dl class="member">
<dt id="_CPPv2N6paddle5Layer14inputArgument_E">
<span id="paddle::Layer::inputArgument___std::vector:ss:"></span><span class="target" id="paddleclasspaddle_1_1Layer_1a637f6ab1d7dd2f8cf2c4357ba372a355"></span>std::vector&lt;std::string&gt; <code class="descname">inputArgument_</code><a class="headerlink" href="#_CPPv2N6paddle5Layer14inputArgument_E" title="Permalink to this definition">¶</a></dt>
468
<dd><p><a class="reference internal" href="../../parameter/parameter/parameter.html#paddlestructpaddle_1_1Argument"><span class="std std-ref">Argument</span></a> of input layers. </p>
Y
Yu Yang 已提交
469 470 471 472 473
</dd></dl>

<dl class="member">
<dt id="_CPPv2N6paddle5Layer11parameters_E">
<span id="paddle::Layer::parameters___std::vector:ParameterPtr:"></span><span class="target" id="paddleclasspaddle_1_1Layer_1af60548b369b0c96154ef2bc7290d9225"></span>std::vector&lt;<a class="reference internal" href="../../parameter/parameter/parameter.html#_CPPv2N6paddle12ParameterPtrE" title="paddle::ParameterPtr">ParameterPtr</a>&gt; <code class="descname">parameters_</code><a class="headerlink" href="#_CPPv2N6paddle5Layer11parameters_E" title="Permalink to this definition">¶</a></dt>
474
<dd><p><a class="reference internal" href="../../parameter/parameter/parameter.html#paddleclasspaddle_1_1Parameter"><span class="std std-ref">Parameter</span></a> for each input layer. Parameters_[i] is nullptr if inputLayers_[i] does not need parameter. </p>
Y
Yu Yang 已提交
475 476 477 478 479 480 481 482 483 484 485 486 487 488 489 490 491 492 493 494 495 496 497 498 499 500 501 502 503 504 505 506 507 508 509 510 511 512 513 514 515 516 517 518 519 520 521 522 523 524 525 526 527 528 529 530 531 532 533 534 535 536 537 538 539 540 541 542 543 544 545 546 547 548 549 550
</dd></dl>

<dl class="member">
<dt id="_CPPv2N6paddle5Layer14biasParameter_E">
<span id="paddle::Layer::biasParameter___ParameterPtr"></span><span class="target" id="paddleclasspaddle_1_1Layer_1a8fb18a85b69714f63d4ec1010425133e"></span><a class="reference internal" href="../../parameter/parameter/parameter.html#_CPPv2N6paddle12ParameterPtrE" title="paddle::ParameterPtr">ParameterPtr</a> <code class="descname">biasParameter_</code><a class="headerlink" href="#_CPPv2N6paddle5Layer14biasParameter_E" title="Permalink to this definition">¶</a></dt>
<dd><p>nullptr if bias is not needed. </p>
</dd></dl>

<dl class="member">
<dt id="_CPPv2N6paddle5Layer7output_E">
<span id="paddle::Layer::output___Argument"></span><span class="target" id="paddleclasspaddle_1_1Layer_1a955c467f7d96f46d8e2ea0e995137097"></span><a class="reference internal" href="../../parameter/parameter/parameter.html#_CPPv2N6paddle8ArgumentE" title="paddle::Argument">Argument</a> <code class="descname">output_</code><a class="headerlink" href="#_CPPv2N6paddle5Layer7output_E" title="Permalink to this definition">¶</a></dt>
<dd><p>Output. </p>
</dd></dl>

<dl class="member">
<dt id="_CPPv2N6paddle5Layer18outputOtherDevice_E">
<span id="paddle::Layer::outputOtherDevice___std::vector:Argument:"></span><span class="target" id="paddleclasspaddle_1_1Layer_1a5e2d47420fad92ebf3f7905cb330f1f6"></span>std::vector&lt;<a class="reference internal" href="../../parameter/parameter/parameter.html#_CPPv2N6paddle8ArgumentE" title="paddle::Argument">Argument</a>&gt; <code class="descname">outputOtherDevice_</code><a class="headerlink" href="#_CPPv2N6paddle5Layer18outputOtherDevice_E" title="Permalink to this definition">¶</a></dt>
<dd><p>Several outputs stored on different devices, used in &#8216;parallel_nn&#8217; case, and record them by deviceId_. </p>
</dd></dl>

<dl class="member">
<dt id="_CPPv2N6paddle5Layer10outputMap_E">
<span id="paddle::Layer::outputMap___std::map:ss.ArgumentP:"></span><span class="target" id="paddleclasspaddle_1_1Layer_1ad72cbf88127c189caae1be5ae0192816"></span>std::map&lt;std::string, <a class="reference internal" href="../../parameter/parameter/parameter.html#_CPPv2N6paddle8ArgumentE" title="paddle::Argument">Argument</a> *&gt; <code class="descname">outputMap_</code><a class="headerlink" href="#_CPPv2N6paddle5Layer10outputMap_E" title="Permalink to this definition">¶</a></dt>
<dd><p>If there are several outputs, map them by each name. </p>
</dd></dl>

<dl class="member">
<dt id="_CPPv2N6paddle5Layer8tmpGrad_E">
<span id="paddle::Layer::tmpGrad___MatrixPtr"></span><span class="target" id="paddleclasspaddle_1_1Layer_1a6d46df7d690baf0ee771080cffc3383d"></span><a class="reference internal" href="../../math/matrix/matrix.html#_CPPv2N6paddle9MatrixPtrE" title="paddle::MatrixPtr">MatrixPtr</a> <code class="descname">tmpGrad_</code><a class="headerlink" href="#_CPPv2N6paddle5Layer8tmpGrad_E" title="Permalink to this definition">¶</a></dt>
<dd><p>Used to merge grad on different devices. </p>
</dd></dl>

<dl class="member">
<dt id="_CPPv2N6paddle5Layer11activation_E">
<span id="paddle::Layer::activation___std::unique_ptr:ActivationFunction:"></span><span class="target" id="paddleclasspaddle_1_1Layer_1a1887f71ea157ba2a4c899cc6ceea4862"></span>std::unique_ptr&lt;<a class="reference internal" href="../activations/index.html#_CPPv2N6paddle18ActivationFunctionE" title="paddle::ActivationFunction">ActivationFunction</a>&gt; <code class="descname">activation_</code><a class="headerlink" href="#_CPPv2N6paddle5Layer11activation_E" title="Permalink to this definition">¶</a></dt>
<dd></dd></dl>

<dl class="member">
<dt id="_CPPv2N6paddle5Layer9passType_E">
<span id="paddle::Layer::passType___PassType"></span><span class="target" id="paddleclasspaddle_1_1Layer_1a67582774a967bf08de70e5d34c451e05"></span>PassType <code class="descname">passType_</code><a class="headerlink" href="#_CPPv2N6paddle5Layer9passType_E" title="Permalink to this definition">¶</a></dt>
<dd><p>Current passType, PASS_TRAIN or PASS_TEST. </p>
</dd></dl>

<dl class="member">
<dt id="_CPPv2N6paddle5Layer12dropOutMask_E">
<span id="paddle::Layer::dropOutMask___MatrixPtr"></span><span class="target" id="paddleclasspaddle_1_1Layer_1a9c4190cc34bbfe809fc2cea65d2855ec"></span><a class="reference internal" href="../../math/matrix/matrix.html#_CPPv2N6paddle9MatrixPtrE" title="paddle::MatrixPtr">MatrixPtr</a> <code class="descname">dropOutMask_</code><a class="headerlink" href="#_CPPv2N6paddle5Layer12dropOutMask_E" title="Permalink to this definition">¶</a></dt>
<dd><p>Random 0-1 matrix for dropOut. </p>
</dd></dl>

<dl class="member">
<dt id="_CPPv2N6paddle5Layer13needGradient_E">
<span id="paddle::Layer::needGradient___b"></span><span class="target" id="paddleclasspaddle_1_1Layer_1a63119f910550502651041a18c4a01b2a"></span>bool <code class="descname">needGradient_</code><a class="headerlink" href="#_CPPv2N6paddle5Layer13needGradient_E" title="Permalink to this definition">¶</a></dt>
<dd><p>Whether the layer need to compute gradient. </p>
</dd></dl>

<dl class="member">
<dt id="_CPPv2N6paddle5Layer17needSequenceInfo_E">
<span id="paddle::Layer::needSequenceInfo___b"></span><span class="target" id="paddleclasspaddle_1_1Layer_1acee8704f2ad0f1c665f55bded3b89a5c"></span>bool <code class="descname">needSequenceInfo_</code><a class="headerlink" href="#_CPPv2N6paddle5Layer17needSequenceInfo_E" title="Permalink to this definition">¶</a></dt>
<dd><p>Whether the layer need to compute re-sequence information. </p>
</dd></dl>

<dl class="member">
<dt id="_CPPv2N6paddle5Layer15markInBackward_E">
<span id="paddle::Layer::markInBackward___std::vector:b:"></span><span class="target" id="paddleclasspaddle_1_1Layer_1af9b18f129d130123c1bbc2dadb54ffc6"></span>std::vector&lt;bool&gt; <code class="descname">markInBackward_</code><a class="headerlink" href="#_CPPv2N6paddle5Layer15markInBackward_E" title="Permalink to this definition">¶</a></dt>
<dd><p>Mark input grad in(true) or out(false) of backward function. </p>
</dd></dl>

</div>
</dd></dl>

</div>
<div class="section" id="projection">
<h2>Projection<a class="headerlink" href="#projection" title="Permalink to this headline">¶</a></h2>
<dl class="class">
<dt id="_CPPv2N6paddle10ProjectionE">
<span id="paddle::Projection"></span><span class="target" id="paddleclasspaddle_1_1Projection"></span><em class="property">class </em><code class="descclassname">paddle::</code><code class="descname">Projection</code><a class="headerlink" href="#_CPPv2N6paddle10ProjectionE" title="Permalink to this definition">¶</a></dt>
551
<dd><p>A projection takes one <a class="reference internal" href="../../parameter/parameter/parameter.html#paddlestructpaddle_1_1Argument"><span class="std std-ref">Argument</span></a> as input, calculate the result and add it to output <a class="reference internal" href="../../parameter/parameter/parameter.html#paddlestructpaddle_1_1Argument"><span class="std std-ref">Argument</span></a>. </p>
552
<p>Subclassed by <a class="reference internal" href="#paddleclasspaddle_1_1ContextProjection"><span class="std std-ref">paddle::ContextProjection</span></a>, paddle::ConvProjection, <a class="reference internal" href="#paddleclasspaddle_1_1DotMulProjection"><span class="std std-ref">paddle::DotMulProjection</span></a>, <a class="reference internal" href="#paddleclasspaddle_1_1FullMatrixProjection"><span class="std std-ref">paddle::FullMatrixProjection</span></a>, <a class="reference internal" href="#paddleclasspaddle_1_1IdentityOffsetProjection"><span class="std std-ref">paddle::IdentityOffsetProjection</span></a>, <a class="reference internal" href="#paddleclasspaddle_1_1IdentityProjection"><span class="std std-ref">paddle::IdentityProjection</span></a>, paddle::PoolProjection, paddle::ScalingProjection, <a class="reference internal" href="#paddleclasspaddle_1_1TableProjection"><span class="std std-ref">paddle::TableProjection</span></a>, <a class="reference internal" href="#paddleclasspaddle_1_1TransposedFullMatrixProjection"><span class="std std-ref">paddle::TransposedFullMatrixProjection</span></a></p>
553
<div class="breathe-sectiondef docutils container">
Y
Yu Yang 已提交
554 555 556 557 558 559 560 561
<p class="breathe-sectiondef-title rubric">Public Functions</p>
<dl class="function">
<dt id="_CPPv2N6paddle10Projection10ProjectionERK16ProjectionConfig12ParameterPtrb">
<span id="paddle::Projection::Projection__ProjectionConfigCR.ParameterPtr.b"></span><span class="target" id="paddleclasspaddle_1_1Projection_1a6c605f804b023418ec42d670ff9fefc0"></span><code class="descname">Projection</code><span class="sig-paren">(</span><em class="property">const</em> ProjectionConfig &amp;<em>config</em>, <a class="reference internal" href="../../parameter/parameter/parameter.html#_CPPv2N6paddle12ParameterPtrE" title="paddle::ParameterPtr">ParameterPtr</a> <em>parameter</em>, bool <em>useGpu</em><span class="sig-paren">)</span><a class="headerlink" href="#_CPPv2N6paddle10Projection10ProjectionERK16ProjectionConfig12ParameterPtrb" title="Permalink to this definition">¶</a></dt>
<dd></dd></dl>

<dl class="function">
<dt id="_CPPv2N6paddle10ProjectionD0Ev">
562
<span id="paddle::Projection::~Projection"></span><span class="target" id="paddleclasspaddle_1_1Projection_1a827487ed67d614a98de8841fda66b4a4"></span><em class="property">virtual</em> <code class="descname">~Projection</code><span class="sig-paren">(</span><span class="sig-paren">)</span><a class="headerlink" href="#_CPPv2N6paddle10ProjectionD0Ev" title="Permalink to this definition">¶</a></dt>
Y
Yu Yang 已提交
563 564 565
<dd></dd></dl>

<dl class="function">
566 567
<dt id="_CPPv2NK6paddle10Projection7getNameEv">
<span id="paddle::Projection::getNameC"></span><span class="target" id="paddleclasspaddle_1_1Projection_1af5816c49f069ad54bd23c9cafe3c6205"></span><em class="property">const</em> std::string &amp;<code class="descname">getName</code><span class="sig-paren">(</span><span class="sig-paren">)</span> <em class="property">const</em><a class="headerlink" href="#_CPPv2NK6paddle10Projection7getNameEv" title="Permalink to this definition">¶</a></dt>
Y
Yu Yang 已提交
568 569 570 571 572 573 574
<dd></dd></dl>

<dl class="function">
<dt id="_CPPv2N6paddle10Projection7forwardEPK8ArgumentPK8Argument8PassType">
<span id="paddle::Projection::forward__ArgumentCP.ArgumentCP.PassType"></span><span class="target" id="paddleclasspaddle_1_1Projection_1a44b084ac8e8a736507225c3edbcd2308"></span>void <code class="descname">forward</code><span class="sig-paren">(</span><em class="property">const</em> <a class="reference internal" href="../../parameter/parameter/parameter.html#_CPPv2N6paddle8ArgumentE" title="paddle::Argument">Argument</a> *<em>in</em>, <em class="property">const</em> <a class="reference internal" href="../../parameter/parameter/parameter.html#_CPPv2N6paddle8ArgumentE" title="paddle::Argument">Argument</a> *<em>out</em>, PassType <em>passType</em><span class="sig-paren">)</span><a class="headerlink" href="#_CPPv2N6paddle10Projection7forwardEPK8ArgumentPK8Argument8PassType" title="Permalink to this definition">¶</a></dt>
<dd><p>Forward propagation. If backward() will be called, in and out must be kept valid until then. <dl class="docutils">
<dt><strong>Parameters</strong></dt>
575 576 577 578
<dd><ul class="breatheparameterlist first last simple">
<li><code class="docutils literal"><span class="pre">in</span></code>: input of projection </li>
<li><code class="docutils literal"><span class="pre">out</span></code>: output of projection </li>
<li><code class="docutils literal"><span class="pre">passType</span></code>: PASS_TRAIN of PASS_TEST </li>
Y
Yu Yang 已提交
579 580 581 582 583 584 585 586
</ul>
</dd>
</dl>
</p>
</dd></dl>

<dl class="function">
<dt id="_CPPv2N6paddle10Projection8prefetchEPK8Argument">
587
<span id="paddle::Projection::prefetch__ArgumentCP"></span><span class="target" id="paddleclasspaddle_1_1Projection_1a8b6a3f588bec53cca2c2eb8673848106"></span><em class="property">virtual</em> void <code class="descname">prefetch</code><span class="sig-paren">(</span><em class="property">const</em> <a class="reference internal" href="../../parameter/parameter/parameter.html#_CPPv2N6paddle8ArgumentE" title="paddle::Argument">Argument</a> *<em>in</em><span class="sig-paren">)</span><a class="headerlink" href="#_CPPv2N6paddle10Projection8prefetchEPK8Argument" title="Permalink to this definition">¶</a></dt>
Y
Yu Yang 已提交
588 589 590 591
<dd></dd></dl>

<dl class="function">
<dt id="_CPPv2N6paddle10Projection7forwardEv">
592
<span id="paddle::Projection::forward"></span><span class="target" id="paddleclasspaddle_1_1Projection_1a40a34b90823c100b936279dbb6451f9b"></span><em class="property">virtual</em> void <code class="descname">forward</code><span class="sig-paren">(</span><span class="sig-paren">)</span> = 0<a class="headerlink" href="#_CPPv2N6paddle10Projection7forwardEv" title="Permalink to this definition">¶</a></dt>
Y
Yu Yang 已提交
593 594 595 596
<dd></dd></dl>

<dl class="function">
<dt id="_CPPv2N6paddle10Projection8backwardERK14UpdateCallback">
597
<span id="paddle::Projection::backward__UpdateCallbackCR"></span><span class="target" id="paddleclasspaddle_1_1Projection_1a0549372559b84b10282c5677d25c44cc"></span><em class="property">virtual</em> void <code class="descname">backward</code><span class="sig-paren">(</span><em class="property">const</em> <a class="reference internal" href="../../parameter/parameter/parameter.html#_CPPv2N6paddle14UpdateCallbackE" title="paddle::UpdateCallback">UpdateCallback</a> &amp;<em>callback</em><span class="sig-paren">)</span> = 0<a class="headerlink" href="#_CPPv2N6paddle10Projection8backwardERK14UpdateCallback" title="Permalink to this definition">¶</a></dt>
Y
Yu Yang 已提交
598 599 600 601
<dd></dd></dl>

<dl class="function">
<dt id="_CPPv2N6paddle10Projection10resetStateEv">
602
<span id="paddle::Projection::resetState"></span><span class="target" id="paddleclasspaddle_1_1Projection_1af365867bfa4271b363076fcf91a32fbe"></span><em class="property">virtual</em> void <code class="descname">resetState</code><span class="sig-paren">(</span><span class="sig-paren">)</span><a class="headerlink" href="#_CPPv2N6paddle10Projection10resetStateEv" title="Permalink to this definition">¶</a></dt>
Y
Yu Yang 已提交
603 604 605 606 607
<dd><p>See comment in Layer.h for the function with the same name. </p>
</dd></dl>

<dl class="function">
<dt id="_CPPv2N6paddle10Projection8setStateE13LayerStatePtr">
608
<span id="paddle::Projection::setState__LayerStatePtr"></span><span class="target" id="paddleclasspaddle_1_1Projection_1adb9fa8dc78e6c5f9a623a9346c5e0137"></span><em class="property">virtual</em> void <code class="descname">setState</code><span class="sig-paren">(</span>LayerStatePtr <em>state</em><span class="sig-paren">)</span><a class="headerlink" href="#_CPPv2N6paddle10Projection8setStateE13LayerStatePtr" title="Permalink to this definition">¶</a></dt>
Y
Yu Yang 已提交
609 610 611 612 613
<dd><p>Set layer state. </p>
</dd></dl>

<dl class="function">
<dt id="_CPPv2N6paddle10Projection8getStateEv">
614
<span id="paddle::Projection::getState"></span><span class="target" id="paddleclasspaddle_1_1Projection_1a0a23a3a55ffaba828ae8315bffdf2064"></span><em class="property">virtual</em> LayerStatePtr <code class="descname">getState</code><span class="sig-paren">(</span><span class="sig-paren">)</span><a class="headerlink" href="#_CPPv2N6paddle10Projection8getStateEv" title="Permalink to this definition">¶</a></dt>
Y
Yu Yang 已提交
615 616 617 618
<dd><p>Get layer state. A copy of internal state is returned. </p>
</dd></dl>

<dl class="function">
619 620
<dt id="_CPPv2NK6paddle10Projection13getOutputSizeEv">
<span id="paddle::Projection::getOutputSizeC"></span><span class="target" id="paddleclasspaddle_1_1Projection_1a2eb81a03fcca71461ea8b5947c819499"></span>size_t <code class="descname">getOutputSize</code><span class="sig-paren">(</span><span class="sig-paren">)</span> <em class="property">const</em><a class="headerlink" href="#_CPPv2NK6paddle10Projection13getOutputSizeEv" title="Permalink to this definition">¶</a></dt>
Y
Yu Yang 已提交
621 622 623 624
<dd><p>Get output size of projection. </p>
</dd></dl>

</div>
625
<div class="breathe-sectiondef docutils container">
Y
Yu Yang 已提交
626 627 628
<p class="breathe-sectiondef-title rubric">Public Static Functions</p>
<dl class="function">
<dt id="_CPPv2N6paddle10Projection6createERK16ProjectionConfig12ParameterPtrb">
629
<span id="paddle::Projection::create__ProjectionConfigCR.ParameterPtr.b"></span><span class="target" id="paddleclasspaddle_1_1Projection_1acb54ecdc84637f1e772284b6ce36a377"></span><a class="reference internal" href="#_CPPv2N6paddle10ProjectionE" title="paddle::Projection">Projection</a> *<code class="descname">create</code><span class="sig-paren">(</span><em class="property">const</em> ProjectionConfig &amp;<em>config</em>, <a class="reference internal" href="../../parameter/parameter/parameter.html#_CPPv2N6paddle12ParameterPtrE" title="paddle::ParameterPtr">ParameterPtr</a> <em>parameter</em>, bool <em>useGpu</em><span class="sig-paren">)</span><a class="headerlink" href="#_CPPv2N6paddle10Projection6createERK16ProjectionConfig12ParameterPtrb" title="Permalink to this definition">¶</a></dt>
Y
Yu Yang 已提交
630 631 632
<dd></dd></dl>

</div>
633
<div class="breathe-sectiondef docutils container">
Y
Yu Yang 已提交
634 635 636
<p class="breathe-sectiondef-title rubric">Public Static Attributes</p>
<dl class="member">
<dt id="_CPPv2N6paddle10Projection10registrar_E">
637
<span id="paddle::Projection::registrar___ClassRegistrar:Projection.ProjectionConfig.ParameterPtr.b:"></span><span class="target" id="paddleclasspaddle_1_1Projection_1af4c99de4268de6fffbbbeef8b8954206"></span>ClassRegistrar&lt;<a class="reference internal" href="#_CPPv2N6paddle10ProjectionE" title="paddle::Projection">Projection</a>, ProjectionConfig, <a class="reference internal" href="../../parameter/parameter/parameter.html#_CPPv2N6paddle12ParameterPtrE" title="paddle::ParameterPtr">ParameterPtr</a>, bool&gt; <code class="descname">registrar_</code><a class="headerlink" href="#_CPPv2N6paddle10Projection10registrar_E" title="Permalink to this definition">¶</a></dt>
Y
Yu Yang 已提交
638 639 640 641
<dd><p>Register a projection. </p>
</dd></dl>

</div>
642
<div class="breathe-sectiondef docutils container">
Y
Yu Yang 已提交
643 644 645 646 647 648 649 650 651 652
<p class="breathe-sectiondef-title rubric">Protected Attributes</p>
<dl class="member">
<dt id="_CPPv2N6paddle10Projection7config_E">
<span id="paddle::Projection::config___ProjectionConfig"></span><span class="target" id="paddleclasspaddle_1_1Projection_1a0f4a414ee8013a1071915a510f4fbe28"></span>ProjectionConfig <code class="descname">config_</code><a class="headerlink" href="#_CPPv2N6paddle10Projection7config_E" title="Permalink to this definition">¶</a></dt>
<dd><p>Config of projection. </p>
</dd></dl>

<dl class="member">
<dt id="_CPPv2N6paddle10Projection10parameter_E">
<span id="paddle::Projection::parameter___ParameterPtr"></span><span class="target" id="paddleclasspaddle_1_1Projection_1ae75907ae0bdb368093a8021bb910d9b7"></span><a class="reference internal" href="../../parameter/parameter/parameter.html#_CPPv2N6paddle12ParameterPtrE" title="paddle::ParameterPtr">ParameterPtr</a> <code class="descname">parameter_</code><a class="headerlink" href="#_CPPv2N6paddle10Projection10parameter_E" title="Permalink to this definition">¶</a></dt>
653
<dd><p><a class="reference internal" href="../../parameter/parameter/parameter.html#paddleclasspaddle_1_1Parameter"><span class="std std-ref">Parameter</span></a> of projection. </p>
Y
Yu Yang 已提交
654 655 656 657 658 659 660 661 662 663 664 665 666 667 668 669 670 671 672 673 674 675 676 677 678 679 680 681 682 683 684 685 686 687
</dd></dl>

<dl class="member">
<dt id="_CPPv2N6paddle10Projection7useGpu_E">
<span id="paddle::Projection::useGpu___b"></span><span class="target" id="paddleclasspaddle_1_1Projection_1a6a549c3b2ccce4b03d445ef03f8f2da5"></span>bool <code class="descname">useGpu_</code><a class="headerlink" href="#_CPPv2N6paddle10Projection7useGpu_E" title="Permalink to this definition">¶</a></dt>
<dd></dd></dl>

<dl class="member">
<dt id="_CPPv2N6paddle10Projection3in_E">
<span id="paddle::Projection::in___ArgumentCP"></span><span class="target" id="paddleclasspaddle_1_1Projection_1a4ddeade10b53a0aaeea887130c067046"></span><em class="property">const</em> <a class="reference internal" href="../../parameter/parameter/parameter.html#_CPPv2N6paddle8ArgumentE" title="paddle::Argument">Argument</a> *<code class="descname">in_</code><a class="headerlink" href="#_CPPv2N6paddle10Projection3in_E" title="Permalink to this definition">¶</a></dt>
<dd><p>Store <code class="docutils literal"><span class="pre">in</span></code> passed to forward() </p>
</dd></dl>

<dl class="member">
<dt id="_CPPv2N6paddle10Projection4out_E">
<span id="paddle::Projection::out___ArgumentCP"></span><span class="target" id="paddleclasspaddle_1_1Projection_1a725e00ad363337e0f53fa37b27cad3ac"></span><em class="property">const</em> <a class="reference internal" href="../../parameter/parameter/parameter.html#_CPPv2N6paddle8ArgumentE" title="paddle::Argument">Argument</a> *<code class="descname">out_</code><a class="headerlink" href="#_CPPv2N6paddle10Projection4out_E" title="Permalink to this definition">¶</a></dt>
<dd><p>Store <code class="docutils literal"><span class="pre">out</span></code> passed to forward() </p>
</dd></dl>

<dl class="member">
<dt id="_CPPv2N6paddle10Projection9passType_E">
<span id="paddle::Projection::passType___PassType"></span><span class="target" id="paddleclasspaddle_1_1Projection_1a4626100edab0476e160976c3b495fcbb"></span>PassType <code class="descname">passType_</code><a class="headerlink" href="#_CPPv2N6paddle10Projection9passType_E" title="Permalink to this definition">¶</a></dt>
<dd><p>Store <code class="docutils literal"><span class="pre">passType</span></code> passed to forward() </p>
</dd></dl>

</div>
</dd></dl>

</div>
<div class="section" id="operator">
<h2>Operator<a class="headerlink" href="#operator" title="Permalink to this headline">¶</a></h2>
<dl class="class">
<dt id="_CPPv2N6paddle8OperatorE">
<span id="paddle::Operator"></span><span class="target" id="paddleclasspaddle_1_1Operator"></span><em class="property">class </em><code class="descclassname">paddle::</code><code class="descname">Operator</code><a class="headerlink" href="#_CPPv2N6paddle8OperatorE" title="Permalink to this definition">¶</a></dt>
688
<dd><p><a class="reference internal" href="#paddleclasspaddle_1_1Operator"><span class="std std-ref">Operator</span></a> like <a class="reference internal" href="#paddleclasspaddle_1_1Projection"><span class="std std-ref">Projection</span></a>, but takes more than one <a class="reference internal" href="../../api/api.html#paddleclassArguments"><span class="std std-ref">Arguments</span></a> as input. <dl class="docutils">
Y
Yu Yang 已提交
689
<dt><strong>Note</strong></dt>
690
<dd>: <a class="reference internal" href="#paddleclasspaddle_1_1Operator"><span class="std std-ref">Operator</span></a> can&#8217;t have parameters. </dd>
Y
Yu Yang 已提交
691 692
</dl>
</p>
693
<p>Subclassed by <a class="reference internal" href="#paddleclasspaddle_1_1ConvOperator"><span class="std std-ref">paddle::ConvOperator</span></a>, <a class="reference internal" href="#paddleclasspaddle_1_1DotMulOperator"><span class="std std-ref">paddle::DotMulOperator</span></a></p>
694
<div class="breathe-sectiondef docutils container">
Y
Yu Yang 已提交
695 696 697 698 699 700 701 702
<p class="breathe-sectiondef-title rubric">Public Functions</p>
<dl class="function">
<dt id="_CPPv2N6paddle8Operator8OperatorERK14OperatorConfigb">
<span id="paddle::Operator::Operator__OperatorConfigCR.b"></span><span class="target" id="paddleclasspaddle_1_1Operator_1a9746cc5a5903ce252bf4e9a697ac12ad"></span><code class="descname">Operator</code><span class="sig-paren">(</span><em class="property">const</em> OperatorConfig &amp;<em>config</em>, bool <em>useGpu</em><span class="sig-paren">)</span><a class="headerlink" href="#_CPPv2N6paddle8Operator8OperatorERK14OperatorConfigb" title="Permalink to this definition">¶</a></dt>
<dd></dd></dl>

<dl class="function">
<dt id="_CPPv2N6paddle8OperatorD0Ev">
703
<span id="paddle::Operator::~Operator"></span><span class="target" id="paddleclasspaddle_1_1Operator_1ad548391dbd62a2dd908d786a51f8b5e5"></span><em class="property">virtual</em> <code class="descname">~Operator</code><span class="sig-paren">(</span><span class="sig-paren">)</span><a class="headerlink" href="#_CPPv2N6paddle8OperatorD0Ev" title="Permalink to this definition">¶</a></dt>
Y
Yu Yang 已提交
704 705 706
<dd></dd></dl>

<dl class="function">
707 708
<dt id="_CPPv2NK6paddle8Operator9getConfigEv">
<span id="paddle::Operator::getConfigC"></span><span class="target" id="paddleclasspaddle_1_1Operator_1a837e36199d6c3f37dd09def73949bc4a"></span><em class="property">const</em> OperatorConfig &amp;<code class="descname">getConfig</code><span class="sig-paren">(</span><span class="sig-paren">)</span> <em class="property">const</em><a class="headerlink" href="#_CPPv2NK6paddle8Operator9getConfigEv" title="Permalink to this definition">¶</a></dt>
Y
Yu Yang 已提交
709 710 711 712 713 714 715
<dd></dd></dl>

<dl class="function">
<dt id="_CPPv2N6paddle8Operator7forwardENSt6vectorIPK8ArgumentEEP8Argument8PassType">
<span id="paddle::Operator::forward__std::vector:ArgumentCP:.ArgumentP.PassType"></span><span class="target" id="paddleclasspaddle_1_1Operator_1a381821f046fe36ec058b27dd0364787d"></span>void <code class="descname">forward</code><span class="sig-paren">(</span>std::vector&lt;<em class="property">const</em> <a class="reference internal" href="../../parameter/parameter/parameter.html#_CPPv2N6paddle8ArgumentE" title="paddle::Argument">Argument</a> *&gt; <em>ins</em>, <a class="reference internal" href="../../parameter/parameter/parameter.html#_CPPv2N6paddle8ArgumentE" title="paddle::Argument">Argument</a> *<em>out</em>, PassType <em>passType</em><span class="sig-paren">)</span><a class="headerlink" href="#_CPPv2N6paddle8Operator7forwardENSt6vectorIPK8ArgumentEEP8Argument8PassType" title="Permalink to this definition">¶</a></dt>
<dd><p>Forward propagation. If backward() will be called, in and out must be kept valid until then. <dl class="docutils">
<dt><strong>Parameters</strong></dt>
716 717 718 719
<dd><ul class="breatheparameterlist first last simple">
<li><code class="docutils literal"><span class="pre">ins</span></code>: inputs of operator </li>
<li><code class="docutils literal"><span class="pre">out</span></code>: output of operator </li>
<li><code class="docutils literal"><span class="pre">passType</span></code>: PASS_TRAIN of PASS_TEST </li>
Y
Yu Yang 已提交
720 721 722 723 724 725 726 727
</ul>
</dd>
</dl>
</p>
</dd></dl>

<dl class="function">
<dt id="_CPPv2N6paddle8Operator8prefetchEPK8Argument">
728
<span id="paddle::Operator::prefetch__ArgumentCP"></span><span class="target" id="paddleclasspaddle_1_1Operator_1acda1eff558b42b25030451fc25882462"></span><em class="property">virtual</em> void <code class="descname">prefetch</code><span class="sig-paren">(</span><em class="property">const</em> <a class="reference internal" href="../../parameter/parameter/parameter.html#_CPPv2N6paddle8ArgumentE" title="paddle::Argument">Argument</a> *<em>in</em><span class="sig-paren">)</span><a class="headerlink" href="#_CPPv2N6paddle8Operator8prefetchEPK8Argument" title="Permalink to this definition">¶</a></dt>
Y
Yu Yang 已提交
729 730 731 732
<dd></dd></dl>

<dl class="function">
<dt id="_CPPv2N6paddle8Operator7forwardEv">
733
<span id="paddle::Operator::forward"></span><span class="target" id="paddleclasspaddle_1_1Operator_1a2395a30660770f2ddaafad5413cef480"></span><em class="property">virtual</em> void <code class="descname">forward</code><span class="sig-paren">(</span><span class="sig-paren">)</span> = 0<a class="headerlink" href="#_CPPv2N6paddle8Operator7forwardEv" title="Permalink to this definition">¶</a></dt>
Y
Yu Yang 已提交
734 735 736 737
<dd></dd></dl>

<dl class="function">
<dt id="_CPPv2N6paddle8Operator8backwardEv">
738
<span id="paddle::Operator::backward"></span><span class="target" id="paddleclasspaddle_1_1Operator_1a4fe009b98e112c88ef9754ec184214c6"></span><em class="property">virtual</em> void <code class="descname">backward</code><span class="sig-paren">(</span><span class="sig-paren">)</span> = 0<a class="headerlink" href="#_CPPv2N6paddle8Operator8backwardEv" title="Permalink to this definition">¶</a></dt>
Y
Yu Yang 已提交
739 740 741 742
<dd></dd></dl>

<dl class="function">
<dt id="_CPPv2N6paddle8Operator10resetStateEv">
743
<span id="paddle::Operator::resetState"></span><span class="target" id="paddleclasspaddle_1_1Operator_1a3c4fcc44439063de4515ebf4a573d67f"></span><em class="property">virtual</em> void <code class="descname">resetState</code><span class="sig-paren">(</span><span class="sig-paren">)</span><a class="headerlink" href="#_CPPv2N6paddle8Operator10resetStateEv" title="Permalink to this definition">¶</a></dt>
Y
Yu Yang 已提交
744 745 746 747 748
<dd><p>See comment in Layer.h for the function with the same name. </p>
</dd></dl>

<dl class="function">
<dt id="_CPPv2N6paddle8Operator8setStateE13LayerStatePtr">
749
<span id="paddle::Operator::setState__LayerStatePtr"></span><span class="target" id="paddleclasspaddle_1_1Operator_1a775fbb6e292e3e51fecb0a16b2f9271d"></span><em class="property">virtual</em> void <code class="descname">setState</code><span class="sig-paren">(</span>LayerStatePtr <em>state</em><span class="sig-paren">)</span><a class="headerlink" href="#_CPPv2N6paddle8Operator8setStateE13LayerStatePtr" title="Permalink to this definition">¶</a></dt>
Y
Yu Yang 已提交
750 751 752 753 754
<dd><p>Set layer state. </p>
</dd></dl>

<dl class="function">
<dt id="_CPPv2N6paddle8Operator8getStateEv">
755
<span id="paddle::Operator::getState"></span><span class="target" id="paddleclasspaddle_1_1Operator_1a78e31cde4f964061c46378962012aee7"></span><em class="property">virtual</em> LayerStatePtr <code class="descname">getState</code><span class="sig-paren">(</span><span class="sig-paren">)</span><a class="headerlink" href="#_CPPv2N6paddle8Operator8getStateEv" title="Permalink to this definition">¶</a></dt>
Y
Yu Yang 已提交
756 757 758 759
<dd><p>Set layer state. </p>
</dd></dl>

</div>
760
<div class="breathe-sectiondef docutils container">
Y
Yu Yang 已提交
761 762 763
<p class="breathe-sectiondef-title rubric">Public Static Functions</p>
<dl class="function">
<dt id="_CPPv2N6paddle8Operator6createERK14OperatorConfigb">
764
<span id="paddle::Operator::create__OperatorConfigCR.b"></span><span class="target" id="paddleclasspaddle_1_1Operator_1ac5d860a3a5f4b67c166d335ac3bc17e4"></span><a class="reference internal" href="#_CPPv2N6paddle8OperatorE" title="paddle::Operator">Operator</a> *<code class="descname">create</code><span class="sig-paren">(</span><em class="property">const</em> OperatorConfig &amp;<em>config</em>, bool <em>useGpu</em><span class="sig-paren">)</span><a class="headerlink" href="#_CPPv2N6paddle8Operator6createERK14OperatorConfigb" title="Permalink to this definition">¶</a></dt>
Y
Yu Yang 已提交
765 766 767
<dd></dd></dl>

</div>
768
<div class="breathe-sectiondef docutils container">
Y
Yu Yang 已提交
769 770 771
<p class="breathe-sectiondef-title rubric">Public Static Attributes</p>
<dl class="member">
<dt id="_CPPv2N6paddle8Operator10registrar_E">
772
<span id="paddle::Operator::registrar___ClassRegistrar:Operator.OperatorConfig.b:"></span><span class="target" id="paddleclasspaddle_1_1Operator_1a1b71916225c65a4af36292971fa27876"></span>ClassRegistrar&lt;<a class="reference internal" href="#_CPPv2N6paddle8OperatorE" title="paddle::Operator">Operator</a>, OperatorConfig, bool&gt; <code class="descname">registrar_</code><a class="headerlink" href="#_CPPv2N6paddle8Operator10registrar_E" title="Permalink to this definition">¶</a></dt>
Y
Yu Yang 已提交
773 774 775
<dd></dd></dl>

</div>
776
<div class="breathe-sectiondef docutils container">
Y
Yu Yang 已提交
777 778 779 780 781 782 783 784 785 786 787 788 789 790 791 792 793 794 795 796 797 798 799 800 801 802 803 804 805 806 807 808 809 810 811 812 813 814 815 816 817 818
<p class="breathe-sectiondef-title rubric">Protected Attributes</p>
<dl class="member">
<dt id="_CPPv2N6paddle8Operator7config_E">
<span id="paddle::Operator::config___OperatorConfig"></span><span class="target" id="paddleclasspaddle_1_1Operator_1ac3ef8f1ca155cee66d701aea2ed68dc4"></span>OperatorConfig <code class="descname">config_</code><a class="headerlink" href="#_CPPv2N6paddle8Operator7config_E" title="Permalink to this definition">¶</a></dt>
<dd><p>Config of operator. </p>
</dd></dl>

<dl class="member">
<dt id="_CPPv2N6paddle8Operator7useGpu_E">
<span id="paddle::Operator::useGpu___b"></span><span class="target" id="paddleclasspaddle_1_1Operator_1a7594797f6e86c4de9f917b4e68c2ea7d"></span>bool <code class="descname">useGpu_</code><a class="headerlink" href="#_CPPv2N6paddle8Operator7useGpu_E" title="Permalink to this definition">¶</a></dt>
<dd></dd></dl>

<dl class="member">
<dt id="_CPPv2N6paddle8Operator4ins_E">
<span id="paddle::Operator::ins___std::vector:ArgumentCP:"></span><span class="target" id="paddleclasspaddle_1_1Operator_1aa96d8534e952cc14e8d332a1fbaae90f"></span>std::vector&lt;<em class="property">const</em> <a class="reference internal" href="../../parameter/parameter/parameter.html#_CPPv2N6paddle8ArgumentE" title="paddle::Argument">Argument</a> *&gt; <code class="descname">ins_</code><a class="headerlink" href="#_CPPv2N6paddle8Operator4ins_E" title="Permalink to this definition">¶</a></dt>
<dd><p>Store <code class="docutils literal"><span class="pre">ins</span></code> passed to forward() </p>
</dd></dl>

<dl class="member">
<dt id="_CPPv2N6paddle8Operator4out_E">
<span id="paddle::Operator::out___ArgumentP"></span><span class="target" id="paddleclasspaddle_1_1Operator_1a7ffbf0cc51fae254efa011947bf4f1a6"></span><a class="reference internal" href="../../parameter/parameter/parameter.html#_CPPv2N6paddle8ArgumentE" title="paddle::Argument">Argument</a> *<code class="descname">out_</code><a class="headerlink" href="#_CPPv2N6paddle8Operator4out_E" title="Permalink to this definition">¶</a></dt>
<dd><p>Store <code class="docutils literal"><span class="pre">out</span></code> passed to forward() </p>
</dd></dl>

<dl class="member">
<dt id="_CPPv2N6paddle8Operator9passType_E">
<span id="paddle::Operator::passType___PassType"></span><span class="target" id="paddleclasspaddle_1_1Operator_1ad2a21289b422c00143cc9d576ef17d28"></span>PassType <code class="descname">passType_</code><a class="headerlink" href="#_CPPv2N6paddle8Operator9passType_E" title="Permalink to this definition">¶</a></dt>
<dd><p>Store <code class="docutils literal"><span class="pre">passType</span></code> passed to forward() </p>
</dd></dl>

</div>
</dd></dl>

</div>
</div>
<div class="section" id="data-layer">
<h1>Data Layer<a class="headerlink" href="#data-layer" title="Permalink to this headline">¶</a></h1>
<dl class="class">
<dt id="_CPPv2N6paddle9DataLayerE">
<span id="paddle::DataLayer"></span><span class="target" id="paddleclasspaddle_1_1DataLayer"></span><em class="property">class </em><code class="descclassname">paddle::</code><code class="descname">DataLayer</code><a class="headerlink" href="#_CPPv2N6paddle9DataLayerE" title="Permalink to this definition">¶</a></dt>
<dd><p>This layer just copy data to output, and has no backward propagation.</p>
<p>The config file api is data_layer. </p>
819
<p>Inherits from <a class="reference internal" href="#paddleclasspaddle_1_1Layer"><span class="std std-ref">paddle::Layer</span></a></p>
820
<div class="breathe-sectiondef docutils container">
Y
Yu Yang 已提交
821 822 823 824 825 826 827 828
<p class="breathe-sectiondef-title rubric">Public Functions</p>
<dl class="function">
<dt id="_CPPv2N6paddle9DataLayer9DataLayerERK11LayerConfig">
<span id="paddle::DataLayer::DataLayer__LayerConfigCR"></span><span class="target" id="paddleclasspaddle_1_1DataLayer_1abaebfaf24ebf143dde1c1eb2eabed93e"></span><code class="descname">DataLayer</code><span class="sig-paren">(</span><em class="property">const</em> LayerConfig &amp;<em>config</em><span class="sig-paren">)</span><a class="headerlink" href="#_CPPv2N6paddle9DataLayer9DataLayerERK11LayerConfig" title="Permalink to this definition">¶</a></dt>
<dd></dd></dl>

<dl class="function">
<dt id="_CPPv2N6paddle9DataLayer7setDataERK8Argument">
829
<span id="paddle::DataLayer::setData__ArgumentCR"></span><span class="target" id="paddleclasspaddle_1_1DataLayer_1a255c47ab4befde33184222902ba9b0bc"></span><em class="property">virtual</em> void <code class="descname">setData</code><span class="sig-paren">(</span><em class="property">const</em> <a class="reference internal" href="../../parameter/parameter/parameter.html#_CPPv2N6paddle8ArgumentE" title="paddle::Argument">Argument</a> &amp;<em>data</em><span class="sig-paren">)</span><a class="headerlink" href="#_CPPv2N6paddle9DataLayer7setDataERK8Argument" title="Permalink to this definition">¶</a></dt>
Y
Yu Yang 已提交
830 831 832 833
<dd></dd></dl>

<dl class="function">
<dt id="_CPPv2N6paddle9DataLayer8prefetchEv">
834
<span id="paddle::DataLayer::prefetch"></span><span class="target" id="paddleclasspaddle_1_1DataLayer_1a3c3ca9470f1699ac1db0baf7079d4490"></span>void <code class="descname">prefetch</code><span class="sig-paren">(</span><span class="sig-paren">)</span><a class="headerlink" href="#_CPPv2N6paddle9DataLayer8prefetchEv" title="Permalink to this definition">¶</a></dt>
Y
Yu Yang 已提交
835 836 837 838 839
<dd><p>Prefetch sparse matrix/ids only. </p>
</dd></dl>

<dl class="function">
<dt id="_CPPv2N6paddle9DataLayer7forwardE8PassType">
840
<span id="paddle::DataLayer::forward__PassType"></span><span class="target" id="paddleclasspaddle_1_1DataLayer_1a7daec6da5702632a3c16e0325a97f93f"></span><em class="property">virtual</em> void <code class="descname">forward</code><span class="sig-paren">(</span>PassType <em>passType</em><span class="sig-paren">)</span><a class="headerlink" href="#_CPPv2N6paddle9DataLayer7forwardE8PassType" title="Permalink to this definition">¶</a></dt>
Y
Yu Yang 已提交
841 842 843 844 845
<dd><p>Forward propagation. Copy data_ (value, in, grad, ids, cpuSequenceDims, sequenceStartPositions, subSequenceStartPositions, strs) to output_. </p>
</dd></dl>

<dl class="function">
<dt id="_CPPv2N6paddle9DataLayer8backwardERK14UpdateCallback">
846
<span id="paddle::DataLayer::backward__UpdateCallbackCR"></span><span class="target" id="paddleclasspaddle_1_1DataLayer_1a6dcee007033fe73ecfcaad55402a2cb5"></span><em class="property">virtual</em> void <code class="descname">backward</code><span class="sig-paren">(</span><em class="property">const</em> <a class="reference internal" href="../../parameter/parameter/parameter.html#_CPPv2N6paddle14UpdateCallbackE" title="paddle::UpdateCallback">UpdateCallback</a> &amp;<em>callback</em><span class="sig-paren">)</span><a class="headerlink" href="#_CPPv2N6paddle9DataLayer8backwardERK14UpdateCallback" title="Permalink to this definition">¶</a></dt>
Y
Yu Yang 已提交
847 848 849 850 851
<dd><p>Data layer&#8217;s backward propagation do nothing. </p>
</dd></dl>

<dl class="function">
<dt id="_CPPv2N6paddle9DataLayer23copyOutputToOtherDeviceEv">
852
<span id="paddle::DataLayer::copyOutputToOtherDevice"></span><span class="target" id="paddleclasspaddle_1_1DataLayer_1a89ba3fa1daa91b8f2d18e817fc735dc8"></span><em class="property">virtual</em> void <code class="descname">copyOutputToOtherDevice</code><span class="sig-paren">(</span><span class="sig-paren">)</span><a class="headerlink" href="#_CPPv2N6paddle9DataLayer23copyOutputToOtherDeviceEv" title="Permalink to this definition">¶</a></dt>
853
<dd><p>Copy layer&#8217;s output_ to other device. If output layer is in other device, called after <a class="reference internal" href="#paddleclasspaddle_1_1Layer_1a12386b3f20dd731e7ceaa2c61667cbe1"><span class="std std-ref">Layer::forward()</span></a> function. </p>
Y
Yu Yang 已提交
854 855 856
</dd></dl>

</div>
857
<div class="breathe-sectiondef docutils container">
Y
Yu Yang 已提交
858 859 860 861 862 863 864 865 866 867 868 869 870 871 872 873 874 875 876
<p class="breathe-sectiondef-title rubric">Protected Attributes</p>
<dl class="member">
<dt id="_CPPv2N6paddle9DataLayer5data_E">
<span id="paddle::DataLayer::data___Argument"></span><span class="target" id="paddleclasspaddle_1_1DataLayer_1a4505246fd22e1a8c80bce2f72fead720"></span><a class="reference internal" href="../../parameter/parameter/parameter.html#_CPPv2N6paddle8ArgumentE" title="paddle::Argument">Argument</a> <code class="descname">data_</code><a class="headerlink" href="#_CPPv2N6paddle9DataLayer5data_E" title="Permalink to this definition">¶</a></dt>
<dd></dd></dl>

</div>
</dd></dl>

</div>
<div class="section" id="fully-connected-layers">
<h1>Fully Connected Layers<a class="headerlink" href="#fully-connected-layers" title="Permalink to this headline">¶</a></h1>
<div class="section" id="fullyconnectedlayer">
<h2>FullyConnectedLayer<a class="headerlink" href="#fullyconnectedlayer" title="Permalink to this headline">¶</a></h2>
<dl class="class">
<dt id="_CPPv2N6paddle19FullyConnectedLayerE">
<span id="paddle::FullyConnectedLayer"></span><span class="target" id="paddleclasspaddle_1_1FullyConnectedLayer"></span><em class="property">class </em><code class="descclassname">paddle::</code><code class="descname">FullyConnectedLayer</code><a class="headerlink" href="#_CPPv2N6paddle19FullyConnectedLayerE" title="Permalink to this definition">¶</a></dt>
<dd><p>A layer has full connections to all neurons in the previous layer. It computes an inner product with a set of learned weights, and (optionally) adds biases.</p>
<p>The config file api is fc_layer. </p>
877
<p>Inherits from <a class="reference internal" href="#paddleclasspaddle_1_1Layer"><span class="std std-ref">paddle::Layer</span></a></p>
878
<div class="breathe-sectiondef docutils container">
Y
Yu Yang 已提交
879 880 881 882 883 884 885 886 887 888 889 890 891
<p class="breathe-sectiondef-title rubric">Public Functions</p>
<dl class="function">
<dt id="_CPPv2N6paddle19FullyConnectedLayer19FullyConnectedLayerERK11LayerConfig">
<span id="paddle::FullyConnectedLayer::FullyConnectedLayer__LayerConfigCR"></span><span class="target" id="paddleclasspaddle_1_1FullyConnectedLayer_1a3c0fa0d92006603fbf580285e7fb2190"></span><code class="descname">FullyConnectedLayer</code><span class="sig-paren">(</span><em class="property">const</em> LayerConfig &amp;<em>config</em><span class="sig-paren">)</span><a class="headerlink" href="#_CPPv2N6paddle19FullyConnectedLayer19FullyConnectedLayerERK11LayerConfig" title="Permalink to this definition">¶</a></dt>
<dd></dd></dl>

<dl class="function">
<dt id="_CPPv2N6paddle19FullyConnectedLayerD0Ev">
<span id="paddle::FullyConnectedLayer::~FullyConnectedLayer"></span><span class="target" id="paddleclasspaddle_1_1FullyConnectedLayer_1a7a53531e5832366ff2e6f429200fe63d"></span><code class="descname">~FullyConnectedLayer</code><span class="sig-paren">(</span><span class="sig-paren">)</span><a class="headerlink" href="#_CPPv2N6paddle19FullyConnectedLayerD0Ev" title="Permalink to this definition">¶</a></dt>
<dd></dd></dl>

<dl class="function">
<dt id="_CPPv2N6paddle19FullyConnectedLayer4initERK8LayerMapRK12ParameterMap">
892
<span id="paddle::FullyConnectedLayer::init__LayerMapCR.ParameterMapCR"></span><span class="target" id="paddleclasspaddle_1_1FullyConnectedLayer_1a4aa793342e82af6abe5c15ab9152de89"></span>bool <code class="descname">init</code><span class="sig-paren">(</span><em class="property">const</em> LayerMap &amp;<em>layerMap</em>, <em class="property">const</em> <a class="reference internal" href="../../parameter/parameter/parameter.html#_CPPv2N6paddle12ParameterMapE" title="paddle::ParameterMap">ParameterMap</a> &amp;<em>parameterMap</em><span class="sig-paren">)</span><a class="headerlink" href="#_CPPv2N6paddle19FullyConnectedLayer4initERK8LayerMapRK12ParameterMap" title="Permalink to this definition">¶</a></dt>
Y
Yu Yang 已提交
893 894 895 896 897 898 899 900 901 902
<dd><p>Intialization. For example, adding input layers from layerMap and parameterMap. </p>
</dd></dl>

<dl class="function">
<dt id="_CPPv2N6paddle19FullyConnectedLayer9getWeightEi">
<span id="paddle::FullyConnectedLayer::getWeight__i"></span><span class="target" id="paddleclasspaddle_1_1FullyConnectedLayer_1ad15f0d3ae1863fa5757b3d2aa880dde8"></span><a class="reference internal" href="../../parameter/parameter/parameter.html#_CPPv2N6paddle6WeightE" title="paddle::Weight">Weight</a> &amp;<code class="descname">getWeight</code><span class="sig-paren">(</span>int <em>idx</em><span class="sig-paren">)</span><a class="headerlink" href="#_CPPv2N6paddle19FullyConnectedLayer9getWeightEi" title="Permalink to this definition">¶</a></dt>
<dd></dd></dl>

<dl class="function">
<dt id="_CPPv2N6paddle19FullyConnectedLayer8prefetchEv">
903
<span id="paddle::FullyConnectedLayer::prefetch"></span><span class="target" id="paddleclasspaddle_1_1FullyConnectedLayer_1a08a9ba40c7949407183c7984f5f20ec5"></span>void <code class="descname">prefetch</code><span class="sig-paren">(</span><span class="sig-paren">)</span><a class="headerlink" href="#_CPPv2N6paddle19FullyConnectedLayer8prefetchEv" title="Permalink to this definition">¶</a></dt>
Y
Yu Yang 已提交
904 905 906 907 908
<dd><p>If use sparse row matrix as parameter, prefetch feature ids in input label. </p>
</dd></dl>

<dl class="function">
<dt id="_CPPv2N6paddle19FullyConnectedLayer7forwardE8PassType">
909
<span id="paddle::FullyConnectedLayer::forward__PassType"></span><span class="target" id="paddleclasspaddle_1_1FullyConnectedLayer_1a3f4980bc18756a75678c505a29658eca"></span>void <code class="descname">forward</code><span class="sig-paren">(</span>PassType <em>passType</em><span class="sig-paren">)</span><a class="headerlink" href="#_CPPv2N6paddle19FullyConnectedLayer7forwardE8PassType" title="Permalink to this definition">¶</a></dt>
Y
Yu Yang 已提交
910 911 912 913 914
<dd><p>Forward propagation. All inherited implementation should call Layer::foward() function. </p>
</dd></dl>

<dl class="function">
<dt id="_CPPv2N6paddle19FullyConnectedLayer8backwardERK14UpdateCallback">
915
<span id="paddle::FullyConnectedLayer::backward__UpdateCallbackCR"></span><span class="target" id="paddleclasspaddle_1_1FullyConnectedLayer_1a25fab0fc84458497004b6ba0bfc7e266"></span>void <code class="descname">backward</code><span class="sig-paren">(</span><em class="property">const</em> <a class="reference internal" href="../../parameter/parameter/parameter.html#_CPPv2N6paddle14UpdateCallbackE" title="paddle::UpdateCallback">UpdateCallback</a> &amp;<em>callback</em> = nullptr<span class="sig-paren">)</span><a class="headerlink" href="#_CPPv2N6paddle19FullyConnectedLayer8backwardERK14UpdateCallback" title="Permalink to this definition">¶</a></dt>
916
<dd><p>Backward propagation. Should only be called after <a class="reference internal" href="#paddleclasspaddle_1_1Layer_1a12386b3f20dd731e7ceaa2c61667cbe1"><span class="std std-ref">Layer::forward()</span></a> function. </p>
Y
Yu Yang 已提交
917 918 919
</dd></dl>

</div>
920
<div class="breathe-sectiondef docutils container">
Y
Yu Yang 已提交
921 922 923 924 925 926 927 928 929 930 931 932 933 934 935 936 937 938 939 940
<p class="breathe-sectiondef-title rubric">Protected Attributes</p>
<dl class="member">
<dt id="_CPPv2N6paddle19FullyConnectedLayer8weights_E">
<span id="paddle::FullyConnectedLayer::weights___WeightList"></span><span class="target" id="paddleclasspaddle_1_1FullyConnectedLayer_1a1c0d554d8a297b3898452dbeeffa7e53"></span><a class="reference internal" href="../../parameter/parameter/parameter.html#_CPPv2N6paddle10WeightListE" title="paddle::WeightList">WeightList</a> <code class="descname">weights_</code><a class="headerlink" href="#_CPPv2N6paddle19FullyConnectedLayer8weights_E" title="Permalink to this definition">¶</a></dt>
<dd></dd></dl>

<dl class="member">
<dt id="_CPPv2N6paddle19FullyConnectedLayer7biases_E">
<span id="paddle::FullyConnectedLayer::biases___std::unique_ptr:Weight:"></span><span class="target" id="paddleclasspaddle_1_1FullyConnectedLayer_1a727bfcc8fd87a338a5af6315ba5ed497"></span>std::unique_ptr&lt;<a class="reference internal" href="../../parameter/parameter/parameter.html#_CPPv2N6paddle6WeightE" title="paddle::Weight">Weight</a>&gt; <code class="descname">biases_</code><a class="headerlink" href="#_CPPv2N6paddle19FullyConnectedLayer7biases_E" title="Permalink to this definition">¶</a></dt>
<dd></dd></dl>

</div>
</dd></dl>

</div>
<div class="section" id="selectivefullyconnectedlayer">
<h2>SelectiveFullyConnectedLayer<a class="headerlink" href="#selectivefullyconnectedlayer" title="Permalink to this headline">¶</a></h2>
<dl class="class">
<dt id="_CPPv2N6paddle28SelectiveFullyConnectedLayerE">
<span id="paddle::SelectiveFullyConnectedLayer"></span><span class="target" id="paddleclasspaddle_1_1SelectiveFullyConnectedLayer"></span><em class="property">class </em><code class="descclassname">paddle::</code><code class="descname">SelectiveFullyConnectedLayer</code><a class="headerlink" href="#_CPPv2N6paddle28SelectiveFullyConnectedLayerE" title="Permalink to this definition">¶</a></dt>
941 942
<dd><p>The <a class="reference internal" href="#paddleclasspaddle_1_1SelectiveFullyConnectedLayer"><span class="std std-ref">SelectiveFullyConnectedLayer</span></a> class. </p>
<p><a class="reference internal" href="#paddleclasspaddle_1_1SelectiveFullyConnectedLayer"><span class="std std-ref">SelectiveFullyConnectedLayer</span></a> differs from <a class="reference internal" href="#paddleclasspaddle_1_1FullyConnectedLayer"><span class="std std-ref">FullyConnectedLayer</span></a> by that it requires an additional input to indicate several selected columns, and only compute the multiplications between the input matrices and the selected columns of the parameter matrices of this layer. If the selected columns is not specified, SelectiveFullyConnected layer acts exactly like <a class="reference internal" href="#paddleclasspaddle_1_1FullyConnectedLayer"><span class="std std-ref">FullyConnectedLayer</span></a>.</p>
Y
Yu Yang 已提交
943
<p>The config file api is selective_fc_layer. </p>
944
<p>Inherits from <a class="reference internal" href="#paddleclasspaddle_1_1Layer"><span class="std std-ref">paddle::Layer</span></a></p>
945
<div class="breathe-sectiondef docutils container">
Y
Yu Yang 已提交
946 947 948 949 950 951 952 953 954 955 956 957 958
<p class="breathe-sectiondef-title rubric">Public Functions</p>
<dl class="function">
<dt id="_CPPv2N6paddle28SelectiveFullyConnectedLayer28SelectiveFullyConnectedLayerERK11LayerConfig">
<span id="paddle::SelectiveFullyConnectedLayer::SelectiveFullyConnectedLayer__LayerConfigCR"></span><span class="target" id="paddleclasspaddle_1_1SelectiveFullyConnectedLayer_1a17e3c3889ee8f75f15517ac6eda2d3c9"></span><code class="descname">SelectiveFullyConnectedLayer</code><span class="sig-paren">(</span><em class="property">const</em> LayerConfig &amp;<em>config</em><span class="sig-paren">)</span><a class="headerlink" href="#_CPPv2N6paddle28SelectiveFullyConnectedLayer28SelectiveFullyConnectedLayerERK11LayerConfig" title="Permalink to this definition">¶</a></dt>
<dd></dd></dl>

<dl class="function">
<dt id="_CPPv2N6paddle28SelectiveFullyConnectedLayerD0Ev">
<span id="paddle::SelectiveFullyConnectedLayer::~SelectiveFullyConnectedLayer"></span><span class="target" id="paddleclasspaddle_1_1SelectiveFullyConnectedLayer_1a8f31e8420af1b7a210c640624fbeffb0"></span><code class="descname">~SelectiveFullyConnectedLayer</code><span class="sig-paren">(</span><span class="sig-paren">)</span><a class="headerlink" href="#_CPPv2N6paddle28SelectiveFullyConnectedLayerD0Ev" title="Permalink to this definition">¶</a></dt>
<dd></dd></dl>

<dl class="function">
<dt id="_CPPv2N6paddle28SelectiveFullyConnectedLayer8prefetchEv">
959
<span id="paddle::SelectiveFullyConnectedLayer::prefetch"></span><span class="target" id="paddleclasspaddle_1_1SelectiveFullyConnectedLayer_1a8ba8c55661a6e822772aa0099012cfaa"></span>void <code class="descname">prefetch</code><span class="sig-paren">(</span><span class="sig-paren">)</span><a class="headerlink" href="#_CPPv2N6paddle28SelectiveFullyConnectedLayer8prefetchEv" title="Permalink to this definition">¶</a></dt>
Y
Yu Yang 已提交
960 961 962 963 964
<dd><p>If use sparse row matrix as parameter, prefetch feature ids in input label. </p>
</dd></dl>

<dl class="function">
<dt id="_CPPv2N6paddle28SelectiveFullyConnectedLayer4initERK8LayerMapRK12ParameterMap">
965
<span id="paddle::SelectiveFullyConnectedLayer::init__LayerMapCR.ParameterMapCR"></span><span class="target" id="paddleclasspaddle_1_1SelectiveFullyConnectedLayer_1a29a95af6d4f643f5c283a5ebe4623028"></span>bool <code class="descname">init</code><span class="sig-paren">(</span><em class="property">const</em> LayerMap &amp;<em>layerMap</em>, <em class="property">const</em> <a class="reference internal" href="../../parameter/parameter/parameter.html#_CPPv2N6paddle12ParameterMapE" title="paddle::ParameterMap">ParameterMap</a> &amp;<em>parameterMap</em><span class="sig-paren">)</span><a class="headerlink" href="#_CPPv2N6paddle28SelectiveFullyConnectedLayer4initERK8LayerMapRK12ParameterMap" title="Permalink to this definition">¶</a></dt>
Y
Yu Yang 已提交
966 967 968 969 970 971 972 973 974 975 976 977 978 979 980 981 982 983 984 985 986 987
<dd><p>Intialization. For example, adding input layers from layerMap and parameterMap. </p>
</dd></dl>

<dl class="function">
<dt id="_CPPv2N6paddle28SelectiveFullyConnectedLayer9getWeightEi">
<span id="paddle::SelectiveFullyConnectedLayer::getWeight__i"></span><span class="target" id="paddleclasspaddle_1_1SelectiveFullyConnectedLayer_1a9920c901ca06dac41e237bab4a508750"></span><a class="reference internal" href="../../parameter/parameter/parameter.html#_CPPv2N6paddle6WeightE" title="paddle::Weight">Weight</a> &amp;<code class="descname">getWeight</code><span class="sig-paren">(</span>int <em>idx</em><span class="sig-paren">)</span><a class="headerlink" href="#_CPPv2N6paddle28SelectiveFullyConnectedLayer9getWeightEi" title="Permalink to this definition">¶</a></dt>
<dd></dd></dl>

<dl class="function">
<dt id="_CPPv2N6paddle28SelectiveFullyConnectedLayer13reserveOutputE6size_t6size_t6size_t">
<span id="paddle::SelectiveFullyConnectedLayer::reserveOutput__s.s.s"></span><span class="target" id="paddleclasspaddle_1_1SelectiveFullyConnectedLayer_1acaddc6841555461fec122c2a8ff80512"></span>void <code class="descname">reserveOutput</code><span class="sig-paren">(</span>size_t <em>height</em>, size_t <em>width</em>, size_t <em>nnz</em><span class="sig-paren">)</span><a class="headerlink" href="#_CPPv2N6paddle28SelectiveFullyConnectedLayer13reserveOutputE6size_t6size_t6size_t" title="Permalink to this definition">¶</a></dt>
<dd><p>Resize the output matrix size. And reset value to zero. </p>
</dd></dl>

<dl class="function">
<dt id="_CPPv2N6paddle28SelectiveFullyConnectedLayer17fillSelectiveDataERKNSt10shared_ptrINSt6vectorINSt4pairIPi6size_tEEEEEE">
<span id="paddle::SelectiveFullyConnectedLayer::fillSelectiveData__std::shared_ptr:std::vector:std::pair:iP.s:::CR"></span><span class="target" id="paddleclasspaddle_1_1SelectiveFullyConnectedLayer_1a83fc3f6700c3a8276d11f7e3479b0af7"></span>void <code class="descname">fillSelectiveData</code><span class="sig-paren">(</span><em class="property">const</em> std::shared_ptr&lt;std::vector&lt;std::pair&lt;int *, size_t&gt;&gt;&gt; &amp;<em>candidates</em><span class="sig-paren">)</span><a class="headerlink" href="#_CPPv2N6paddle28SelectiveFullyConnectedLayer17fillSelectiveDataERKNSt10shared_ptrINSt6vectorINSt4pairIPi6size_tEEEEEE" title="Permalink to this definition">¶</a></dt>
<dd><p>Fill candidates to select several activations as output. </p>
<p><dl class="docutils">
<dt><strong>Note</strong></dt>
<dd>CURRENTLY, THIS METHOD IS ONLY USED FOR BEAM SEARCH </dd>
<dt><strong>Parameters</strong></dt>
988 989
<dd><ul class="breatheparameterlist first last simple">
<li><code class="docutils literal"><span class="pre">candidates</span></code>: specifies several selected columns of the parameter matrices of this layer. Multiplications only between the input matrices and the selected columns are computed. If the candidates is a nullptr, selective fc layer acts exactly like the fully connected layer. </li>
Y
Yu Yang 已提交
990 991 992 993 994 995 996 997
</ul>
</dd>
</dl>
</p>
</dd></dl>

<dl class="function">
<dt id="_CPPv2N6paddle28SelectiveFullyConnectedLayer7forwardE8PassType">
998
<span id="paddle::SelectiveFullyConnectedLayer::forward__PassType"></span><span class="target" id="paddleclasspaddle_1_1SelectiveFullyConnectedLayer_1a7e7edaabcea16979a605bced4e56ece8"></span>void <code class="descname">forward</code><span class="sig-paren">(</span>PassType <em>passType</em><span class="sig-paren">)</span><a class="headerlink" href="#_CPPv2N6paddle28SelectiveFullyConnectedLayer7forwardE8PassType" title="Permalink to this definition">¶</a></dt>
Y
Yu Yang 已提交
999 1000 1001 1002 1003
<dd><p>Forward propagation. All inherited implementation should call Layer::foward() function. </p>
</dd></dl>

<dl class="function">
<dt id="_CPPv2N6paddle28SelectiveFullyConnectedLayer8backwardERK14UpdateCallback">
1004
<span id="paddle::SelectiveFullyConnectedLayer::backward__UpdateCallbackCR"></span><span class="target" id="paddleclasspaddle_1_1SelectiveFullyConnectedLayer_1a962ae04867ac37595c31007bf3c89342"></span>void <code class="descname">backward</code><span class="sig-paren">(</span><em class="property">const</em> <a class="reference internal" href="../../parameter/parameter/parameter.html#_CPPv2N6paddle14UpdateCallbackE" title="paddle::UpdateCallback">UpdateCallback</a> &amp;<em>callback</em> = nullptr<span class="sig-paren">)</span><a class="headerlink" href="#_CPPv2N6paddle28SelectiveFullyConnectedLayer8backwardERK14UpdateCallback" title="Permalink to this definition">¶</a></dt>
1005
<dd><p>Backward propagation. Should only be called after <a class="reference internal" href="#paddleclasspaddle_1_1Layer_1a12386b3f20dd731e7ceaa2c61667cbe1"><span class="std std-ref">Layer::forward()</span></a> function. </p>
Y
Yu Yang 已提交
1006 1007 1008
</dd></dl>

</div>
1009
<div class="breathe-sectiondef docutils container">
Y
Yu Yang 已提交
1010 1011 1012 1013 1014 1015 1016 1017 1018 1019 1020 1021 1022 1023 1024 1025 1026 1027 1028 1029 1030 1031 1032
<p class="breathe-sectiondef-title rubric">Protected Attributes</p>
<dl class="member">
<dt id="_CPPv2N6paddle28SelectiveFullyConnectedLayer8weights_E">
<span id="paddle::SelectiveFullyConnectedLayer::weights___WeightList"></span><span class="target" id="paddleclasspaddle_1_1SelectiveFullyConnectedLayer_1a694545d7a10da2a41b4a47d9dc7c8219"></span><a class="reference internal" href="../../parameter/parameter/parameter.html#_CPPv2N6paddle10WeightListE" title="paddle::WeightList">WeightList</a> <code class="descname">weights_</code><a class="headerlink" href="#_CPPv2N6paddle28SelectiveFullyConnectedLayer8weights_E" title="Permalink to this definition">¶</a></dt>
<dd></dd></dl>

<dl class="member">
<dt id="_CPPv2N6paddle28SelectiveFullyConnectedLayer7biases_E">
<span id="paddle::SelectiveFullyConnectedLayer::biases___std::unique_ptr:Weight:"></span><span class="target" id="paddleclasspaddle_1_1SelectiveFullyConnectedLayer_1ac520613ab3eecb63f5c9c1de77a30f3b"></span>std::unique_ptr&lt;<a class="reference internal" href="../../parameter/parameter/parameter.html#_CPPv2N6paddle6WeightE" title="paddle::Weight">Weight</a>&gt; <code class="descname">biases_</code><a class="headerlink" href="#_CPPv2N6paddle28SelectiveFullyConnectedLayer7biases_E" title="Permalink to this definition">¶</a></dt>
<dd></dd></dl>

</div>
</dd></dl>

</div>
</div>
<div class="section" id="conv-layers">
<h1>Conv Layers<a class="headerlink" href="#conv-layers" title="Permalink to this headline">¶</a></h1>
<div class="section" id="convbaselayer">
<h2>ConvBaseLayer<a class="headerlink" href="#convbaselayer" title="Permalink to this headline">¶</a></h2>
<dl class="class">
<dt id="_CPPv2N6paddle13ConvBaseLayerE">
<span id="paddle::ConvBaseLayer"></span><span class="target" id="paddleclasspaddle_1_1ConvBaseLayer"></span><em class="property">class </em><code class="descclassname">paddle::</code><code class="descname">ConvBaseLayer</code><a class="headerlink" href="#_CPPv2N6paddle13ConvBaseLayerE" title="Permalink to this definition">¶</a></dt>
1033 1034
<dd><p>A Base Convolution <a class="reference internal" href="#paddleclasspaddle_1_1Layer"><span class="std std-ref">Layer</span></a>, which convolves the input image with learned filters and (optionally) adds biases. </p>
<p>Inherits from <a class="reference internal" href="#paddleclasspaddle_1_1Layer"><span class="std std-ref">paddle::Layer</span></a></p>
1035
<p>Subclassed by <a class="reference internal" href="#paddleclasspaddle_1_1CudnnConvLayer"><span class="std std-ref">paddle::CudnnConvLayer</span></a>, paddle::ExpandConvBaseLayer</p>
1036
<div class="breathe-sectiondef docutils container">
Y
Yu Yang 已提交
1037 1038 1039 1040 1041 1042 1043 1044
<p class="breathe-sectiondef-title rubric">Public Functions</p>
<dl class="function">
<dt id="_CPPv2N6paddle13ConvBaseLayer13ConvBaseLayerERK11LayerConfig">
<span id="paddle::ConvBaseLayer::ConvBaseLayer__LayerConfigCR"></span><span class="target" id="paddleclasspaddle_1_1ConvBaseLayer_1a8ca6b9ed231b469f064c1ef8eefc5067"></span><code class="descname">ConvBaseLayer</code><span class="sig-paren">(</span><em class="property">const</em> LayerConfig &amp;<em>config</em><span class="sig-paren">)</span><a class="headerlink" href="#_CPPv2N6paddle13ConvBaseLayer13ConvBaseLayerERK11LayerConfig" title="Permalink to this definition">¶</a></dt>
<dd></dd></dl>

<dl class="function">
<dt id="_CPPv2N6paddle13ConvBaseLayer4initERK8LayerMapRK12ParameterMap">
1045
<span id="paddle::ConvBaseLayer::init__LayerMapCR.ParameterMapCR"></span><span class="target" id="paddleclasspaddle_1_1ConvBaseLayer_1acd01167ed2f5e6dcb0369cae23a9d08b"></span>bool <code class="descname">init</code><span class="sig-paren">(</span><em class="property">const</em> LayerMap &amp;<em>layerMap</em>, <em class="property">const</em> <a class="reference internal" href="../../parameter/parameter/parameter.html#_CPPv2N6paddle12ParameterMapE" title="paddle::ParameterMap">ParameterMap</a> &amp;<em>parameterMap</em><span class="sig-paren">)</span><a class="headerlink" href="#_CPPv2N6paddle13ConvBaseLayer4initERK8LayerMapRK12ParameterMap" title="Permalink to this definition">¶</a></dt>
Y
Yu Yang 已提交
1046 1047 1048
<dd><p>Intialization. For example, adding input layers from layerMap and parameterMap. </p>
</dd></dl>

1049 1050 1051 1052 1053 1054
<dl class="function">
<dt id="_CPPv2N6paddle13ConvBaseLayer13calOutputSizeEv">
<span id="paddle::ConvBaseLayer::calOutputSize"></span><span class="target" id="paddleclasspaddle_1_1ConvBaseLayer_1a87360144a6cb7e67a7c1ef80ca49a56b"></span>size_t <code class="descname">calOutputSize</code><span class="sig-paren">(</span><span class="sig-paren">)</span><a class="headerlink" href="#_CPPv2N6paddle13ConvBaseLayer13calOutputSizeEv" title="Permalink to this definition">¶</a></dt>
<dd><p>imgSizeH_ and imgSizeW_ will be set according to the previous input layers in this function. Then it will calculate outputH_ and outputW_ and set them into output argument. </p>
</dd></dl>

Y
Yu Yang 已提交
1055 1056 1057 1058 1059 1060
<dl class="function">
<dt id="_CPPv2N6paddle13ConvBaseLayer9getWeightEi">
<span id="paddle::ConvBaseLayer::getWeight__i"></span><span class="target" id="paddleclasspaddle_1_1ConvBaseLayer_1a13f791a0a65b27f913d7eebb43ee9127"></span><a class="reference internal" href="../../parameter/parameter/parameter.html#_CPPv2N6paddle6WeightE" title="paddle::Weight">Weight</a> &amp;<code class="descname">getWeight</code><span class="sig-paren">(</span>int <em>idx</em><span class="sig-paren">)</span><a class="headerlink" href="#_CPPv2N6paddle13ConvBaseLayer9getWeightEi" title="Permalink to this definition">¶</a></dt>
<dd></dd></dl>

</div>
1061
<div class="breathe-sectiondef docutils container">
Y
Yu Yang 已提交
1062 1063 1064 1065 1066 1067 1068
<p class="breathe-sectiondef-title rubric">Protected Types</p>
<dl class="type">
<dt id="_CPPv2N6paddle13ConvBaseLayer4IntVE">
<span id="paddle::ConvBaseLayer::IntV"></span><span class="target" id="paddleclasspaddle_1_1ConvBaseLayer_1af3111412759a90113b563c0a6e3ea344"></span><em class="property">typedef </em>std::vector&lt;int&gt; <code class="descname">IntV</code><a class="headerlink" href="#_CPPv2N6paddle13ConvBaseLayer4IntVE" title="Permalink to this definition">¶</a></dt>
<dd></dd></dl>

</div>
1069
<div class="breathe-sectiondef docutils container">
Y
Yu Yang 已提交
1070
<p class="breathe-sectiondef-title rubric">Protected Attributes</p>
1071 1072 1073 1074 1075 1076
<dl class="member">
<dt id="_CPPv2N6paddle13ConvBaseLayer9isDeconv_E">
<span id="paddle::ConvBaseLayer::isDeconv___b"></span><span class="target" id="paddleclasspaddle_1_1ConvBaseLayer_1a665c94805986ca467e0eda075f694673"></span>bool <code class="descname">isDeconv_</code><a class="headerlink" href="#_CPPv2N6paddle13ConvBaseLayer9isDeconv_E" title="Permalink to this definition">¶</a></dt>
<dd><p>True if it&#8217;s deconv layer, false if it&#8217;s convolution layer. </p>
</dd></dl>

Y
Yu Yang 已提交
1077 1078 1079 1080 1081 1082 1083 1084 1085 1086 1087 1088 1089 1090 1091 1092 1093 1094 1095 1096 1097 1098 1099 1100 1101 1102 1103 1104 1105 1106 1107 1108 1109 1110 1111 1112 1113 1114 1115 1116 1117 1118 1119 1120 1121 1122 1123 1124 1125
<dl class="member">
<dt id="_CPPv2N6paddle13ConvBaseLayer11numFilters_E">
<span id="paddle::ConvBaseLayer::numFilters___i"></span><span class="target" id="paddleclasspaddle_1_1ConvBaseLayer_1a26581258a4b8c07ee62a183eee60e1f5"></span>int <code class="descname">numFilters_</code><a class="headerlink" href="#_CPPv2N6paddle13ConvBaseLayer11numFilters_E" title="Permalink to this definition">¶</a></dt>
<dd><p>The number of filters. </p>
</dd></dl>

<dl class="member">
<dt id="_CPPv2N6paddle13ConvBaseLayer8padding_E">
<span id="paddle::ConvBaseLayer::padding___IntV"></span><span class="target" id="paddleclasspaddle_1_1ConvBaseLayer_1ad685a10156fb18ea059ad032af260ad9"></span><a class="reference internal" href="#_CPPv2N6paddle13ConvBaseLayer4IntVE" title="paddle::ConvBaseLayer::IntV">IntV</a> <code class="descname">padding_</code><a class="headerlink" href="#_CPPv2N6paddle13ConvBaseLayer8padding_E" title="Permalink to this definition">¶</a></dt>
<dd><p>The x dimension of the padding. </p>
</dd></dl>

<dl class="member">
<dt id="_CPPv2N6paddle13ConvBaseLayer9paddingY_E">
<span id="paddle::ConvBaseLayer::paddingY___IntV"></span><span class="target" id="paddleclasspaddle_1_1ConvBaseLayer_1a23761953ec0381eeff3cecd92a93f7cf"></span><a class="reference internal" href="#_CPPv2N6paddle13ConvBaseLayer4IntVE" title="paddle::ConvBaseLayer::IntV">IntV</a> <code class="descname">paddingY_</code><a class="headerlink" href="#_CPPv2N6paddle13ConvBaseLayer9paddingY_E" title="Permalink to this definition">¶</a></dt>
<dd><p>The y dimension of the padding. </p>
</dd></dl>

<dl class="member">
<dt id="_CPPv2N6paddle13ConvBaseLayer7stride_E">
<span id="paddle::ConvBaseLayer::stride___IntV"></span><span class="target" id="paddleclasspaddle_1_1ConvBaseLayer_1a8a0e460f66cbab3c2c6c883460ac5875"></span><a class="reference internal" href="#_CPPv2N6paddle13ConvBaseLayer4IntVE" title="paddle::ConvBaseLayer::IntV">IntV</a> <code class="descname">stride_</code><a class="headerlink" href="#_CPPv2N6paddle13ConvBaseLayer7stride_E" title="Permalink to this definition">¶</a></dt>
<dd><p>The x dimension of the stride. </p>
</dd></dl>

<dl class="member">
<dt id="_CPPv2N6paddle13ConvBaseLayer8strideY_E">
<span id="paddle::ConvBaseLayer::strideY___IntV"></span><span class="target" id="paddleclasspaddle_1_1ConvBaseLayer_1abcca8dc99d1ee30cdbc19e63098c42c1"></span><a class="reference internal" href="#_CPPv2N6paddle13ConvBaseLayer4IntVE" title="paddle::ConvBaseLayer::IntV">IntV</a> <code class="descname">strideY_</code><a class="headerlink" href="#_CPPv2N6paddle13ConvBaseLayer8strideY_E" title="Permalink to this definition">¶</a></dt>
<dd><p>The y dimension of the stride. </p>
</dd></dl>

<dl class="member">
<dt id="_CPPv2N6paddle13ConvBaseLayer11filterSize_E">
<span id="paddle::ConvBaseLayer::filterSize___IntV"></span><span class="target" id="paddleclasspaddle_1_1ConvBaseLayer_1ac62acf8e350af7e2213a4bff90c23d6a"></span><a class="reference internal" href="#_CPPv2N6paddle13ConvBaseLayer4IntVE" title="paddle::ConvBaseLayer::IntV">IntV</a> <code class="descname">filterSize_</code><a class="headerlink" href="#_CPPv2N6paddle13ConvBaseLayer11filterSize_E" title="Permalink to this definition">¶</a></dt>
<dd><p>The x dimension of a filter kernel. </p>
</dd></dl>

<dl class="member">
<dt id="_CPPv2N6paddle13ConvBaseLayer12filterSizeY_E">
<span id="paddle::ConvBaseLayer::filterSizeY___IntV"></span><span class="target" id="paddleclasspaddle_1_1ConvBaseLayer_1a5203a0b43fb71efadfa625bec72e7796"></span><a class="reference internal" href="#_CPPv2N6paddle13ConvBaseLayer4IntVE" title="paddle::ConvBaseLayer::IntV">IntV</a> <code class="descname">filterSizeY_</code><a class="headerlink" href="#_CPPv2N6paddle13ConvBaseLayer12filterSizeY_E" title="Permalink to this definition">¶</a></dt>
<dd><p>The y dimension of a filter kernel. </p>
</dd></dl>

<dl class="member">
<dt id="_CPPv2N6paddle13ConvBaseLayer9channels_E">
<span id="paddle::ConvBaseLayer::channels___IntV"></span><span class="target" id="paddleclasspaddle_1_1ConvBaseLayer_1a28993ab539799f98abc8fb3fbe99f754"></span><a class="reference internal" href="#_CPPv2N6paddle13ConvBaseLayer4IntVE" title="paddle::ConvBaseLayer::IntV">IntV</a> <code class="descname">channels_</code><a class="headerlink" href="#_CPPv2N6paddle13ConvBaseLayer9channels_E" title="Permalink to this definition">¶</a></dt>
<dd><p>The spatial dimensions of the convolution input. </p>
</dd></dl>

<dl class="member">
1126 1127 1128
<dt id="_CPPv2N6paddle13ConvBaseLayer9imgSizeH_E">
<span id="paddle::ConvBaseLayer::imgSizeH___IntV"></span><span class="target" id="paddleclasspaddle_1_1ConvBaseLayer_1a4e5be7ef22ba35e47f127c38435c1a6d"></span><a class="reference internal" href="#_CPPv2N6paddle13ConvBaseLayer4IntVE" title="paddle::ConvBaseLayer::IntV">IntV</a> <code class="descname">imgSizeH_</code><a class="headerlink" href="#_CPPv2N6paddle13ConvBaseLayer9imgSizeH_E" title="Permalink to this definition">¶</a></dt>
<dd><p>The spatial dimensions of input feature map height. </p>
Y
Yu Yang 已提交
1129 1130 1131
</dd></dl>

<dl class="member">
1132 1133 1134
<dt id="_CPPv2N6paddle13ConvBaseLayer9imgSizeW_E">
<span id="paddle::ConvBaseLayer::imgSizeW___IntV"></span><span class="target" id="paddleclasspaddle_1_1ConvBaseLayer_1a79cd8868153f23a677be066a8cea97f0"></span><a class="reference internal" href="#_CPPv2N6paddle13ConvBaseLayer4IntVE" title="paddle::ConvBaseLayer::IntV">IntV</a> <code class="descname">imgSizeW_</code><a class="headerlink" href="#_CPPv2N6paddle13ConvBaseLayer9imgSizeW_E" title="Permalink to this definition">¶</a></dt>
<dd><p>The spatial dimensions of input feature map width. </p>
Y
Yu Yang 已提交
1135 1136 1137 1138 1139 1140 1141 1142 1143 1144 1145 1146 1147 1148 1149
</dd></dl>

<dl class="member">
<dt id="_CPPv2N6paddle13ConvBaseLayer13filterPixels_E">
<span id="paddle::ConvBaseLayer::filterPixels___IntV"></span><span class="target" id="paddleclasspaddle_1_1ConvBaseLayer_1a629d6a39be74c75c767bb8a97b14fd6b"></span><a class="reference internal" href="#_CPPv2N6paddle13ConvBaseLayer4IntVE" title="paddle::ConvBaseLayer::IntV">IntV</a> <code class="descname">filterPixels_</code><a class="headerlink" href="#_CPPv2N6paddle13ConvBaseLayer13filterPixels_E" title="Permalink to this definition">¶</a></dt>
<dd><p>filterPixels_ = filterSizeX_ * filterSizeY_. </p>
</dd></dl>

<dl class="member">
<dt id="_CPPv2N6paddle13ConvBaseLayer15filterChannels_E">
<span id="paddle::ConvBaseLayer::filterChannels___IntV"></span><span class="target" id="paddleclasspaddle_1_1ConvBaseLayer_1a9ba8730f1935c02668ccaa31beeb731a"></span><a class="reference internal" href="#_CPPv2N6paddle13ConvBaseLayer4IntVE" title="paddle::ConvBaseLayer::IntV">IntV</a> <code class="descname">filterChannels_</code><a class="headerlink" href="#_CPPv2N6paddle13ConvBaseLayer15filterChannels_E" title="Permalink to this definition">¶</a></dt>
<dd><p>filterChannels_ = channels_/groups_. </p>
</dd></dl>

<dl class="member">
1150 1151 1152
<dt id="_CPPv2N6paddle13ConvBaseLayer8outputH_E">
<span id="paddle::ConvBaseLayer::outputH___IntV"></span><span class="target" id="paddleclasspaddle_1_1ConvBaseLayer_1a34c29b1e3cd34025207d4a86455f2df0"></span><a class="reference internal" href="#_CPPv2N6paddle13ConvBaseLayer4IntVE" title="paddle::ConvBaseLayer::IntV">IntV</a> <code class="descname">outputH_</code><a class="headerlink" href="#_CPPv2N6paddle13ConvBaseLayer8outputH_E" title="Permalink to this definition">¶</a></dt>
<dd><p>The spatial dimensions of output feature map height. </p>
Y
Yu Yang 已提交
1153 1154 1155
</dd></dl>

<dl class="member">
1156 1157 1158
<dt id="_CPPv2N6paddle13ConvBaseLayer8outputW_E">
<span id="paddle::ConvBaseLayer::outputW___IntV"></span><span class="target" id="paddleclasspaddle_1_1ConvBaseLayer_1a37f01f7017bb0063c4f1a13c5fa92dbd"></span><a class="reference internal" href="#_CPPv2N6paddle13ConvBaseLayer4IntVE" title="paddle::ConvBaseLayer::IntV">IntV</a> <code class="descname">outputW_</code><a class="headerlink" href="#_CPPv2N6paddle13ConvBaseLayer8outputW_E" title="Permalink to this definition">¶</a></dt>
<dd><p>The spatial dimensions of output feature map width. </p>
Y
Yu Yang 已提交
1159 1160 1161 1162 1163 1164 1165 1166 1167 1168 1169 1170 1171 1172 1173 1174 1175 1176 1177 1178 1179 1180 1181 1182 1183 1184 1185 1186 1187 1188 1189 1190 1191 1192 1193 1194 1195 1196 1197 1198 1199
</dd></dl>

<dl class="member">
<dt id="_CPPv2N6paddle13ConvBaseLayer7groups_E">
<span id="paddle::ConvBaseLayer::groups___IntV"></span><span class="target" id="paddleclasspaddle_1_1ConvBaseLayer_1ae6c9da5b36ef304e55c7eb068eb39e41"></span><a class="reference internal" href="#_CPPv2N6paddle13ConvBaseLayer4IntVE" title="paddle::ConvBaseLayer::IntV">IntV</a> <code class="descname">groups_</code><a class="headerlink" href="#_CPPv2N6paddle13ConvBaseLayer7groups_E" title="Permalink to this definition">¶</a></dt>
<dd><p>Group size, refer to grouped convolution in Alex Krizhevsky&#8217;s paper: when group=2, the first half of the filters are only connected to the first half of the input channels, and the second half only connected to the second half. </p>
</dd></dl>

<dl class="member">
<dt id="_CPPv2N6paddle13ConvBaseLayer13sharedBiases_E">
<span id="paddle::ConvBaseLayer::sharedBiases___b"></span><span class="target" id="paddleclasspaddle_1_1ConvBaseLayer_1ab2e9ddc1f50be80e33a30e586e6e42a2"></span>bool <code class="descname">sharedBiases_</code><a class="headerlink" href="#_CPPv2N6paddle13ConvBaseLayer13sharedBiases_E" title="Permalink to this definition">¶</a></dt>
<dd><p>Whether the bias is shared for feature in each channel. </p>
</dd></dl>

<dl class="member">
<dt id="_CPPv2N6paddle13ConvBaseLayer8weights_E">
<span id="paddle::ConvBaseLayer::weights___WeightList"></span><span class="target" id="paddleclasspaddle_1_1ConvBaseLayer_1a87b3d27e44fb9873bd7f0158fb219e9b"></span><a class="reference internal" href="../../parameter/parameter/parameter.html#_CPPv2N6paddle10WeightListE" title="paddle::WeightList">WeightList</a> <code class="descname">weights_</code><a class="headerlink" href="#_CPPv2N6paddle13ConvBaseLayer8weights_E" title="Permalink to this definition">¶</a></dt>
<dd><p>shape of weight: (numChannels * filterPixels_, numFilters) </p>
</dd></dl>

<dl class="member">
<dt id="_CPPv2N6paddle13ConvBaseLayer7biases_E">
<span id="paddle::ConvBaseLayer::biases___std::unique_ptr:Weight:"></span><span class="target" id="paddleclasspaddle_1_1ConvBaseLayer_1a2fffdfed4e1fc8c2f3497cd68e36f2ee"></span>std::unique_ptr&lt;<a class="reference internal" href="../../parameter/parameter/parameter.html#_CPPv2N6paddle6WeightE" title="paddle::Weight">Weight</a>&gt; <code class="descname">biases_</code><a class="headerlink" href="#_CPPv2N6paddle13ConvBaseLayer7biases_E" title="Permalink to this definition">¶</a></dt>
<dd><p>If shared_biases is false shape of bias: (numFilters_, 1) If shared_biases is ture shape of bias: (numFilters_ * outputX * outputY, 1) </p>
</dd></dl>

<dl class="member">
<dt id="_CPPv2N6paddle13ConvBaseLayer10caffeMode_E">
<span id="paddle::ConvBaseLayer::caffeMode___b"></span><span class="target" id="paddleclasspaddle_1_1ConvBaseLayer_1a68eb68847b7a693f353b871971aea1b2"></span>bool <code class="descname">caffeMode_</code><a class="headerlink" href="#_CPPv2N6paddle13ConvBaseLayer10caffeMode_E" title="Permalink to this definition">¶</a></dt>
<dd><p>True by default. The only difference is the calculation of output size. </p>
</dd></dl>

</div>
</dd></dl>

</div>
<div class="section" id="convoperator">
<h2>ConvOperator<a class="headerlink" href="#convoperator" title="Permalink to this headline">¶</a></h2>
<dl class="class">
<dt id="_CPPv2N6paddle12ConvOperatorE">
<span id="paddle::ConvOperator"></span><span class="target" id="paddleclasspaddle_1_1ConvOperator"></span><em class="property">class </em><code class="descclassname">paddle::</code><code class="descname">ConvOperator</code><a class="headerlink" href="#_CPPv2N6paddle12ConvOperatorE" title="Permalink to this definition">¶</a></dt>
1200
<dd><p><a class="reference internal" href="#paddleclasspaddle_1_1ConvOperator"><span class="std std-ref">ConvOperator</span></a> takes two inputs to perform the convolution. The first input is the image, and the second input is the convolution kernel. The height of data for two inputs are the same. Each data of the first input is convolved with each data of the second input indepedently. </p>
Y
Yu Yang 已提交
1201
<p>The config file api is conv_operator. </p>
1202
<p>Inherits from <a class="reference internal" href="#paddleclasspaddle_1_1Operator"><span class="std std-ref">paddle::Operator</span></a></p>
1203
<div class="breathe-sectiondef docutils container">
Y
Yu Yang 已提交
1204 1205 1206 1207 1208 1209 1210 1211
<p class="breathe-sectiondef-title rubric">Public Functions</p>
<dl class="function">
<dt id="_CPPv2N6paddle12ConvOperator12ConvOperatorERK14OperatorConfigb">
<span id="paddle::ConvOperator::ConvOperator__OperatorConfigCR.b"></span><span class="target" id="paddleclasspaddle_1_1ConvOperator_1aa0a760a639023170114f97d39dbce076"></span><code class="descname">ConvOperator</code><span class="sig-paren">(</span><em class="property">const</em> OperatorConfig &amp;<em>config</em>, bool <em>useGpu</em><span class="sig-paren">)</span><a class="headerlink" href="#_CPPv2N6paddle12ConvOperator12ConvOperatorERK14OperatorConfigb" title="Permalink to this definition">¶</a></dt>
<dd></dd></dl>

<dl class="function">
<dt id="_CPPv2N6paddle12ConvOperatorD0Ev">
1212
<span id="paddle::ConvOperator::~ConvOperator"></span><span class="target" id="paddleclasspaddle_1_1ConvOperator_1a22b440cee906ea111c04e627fe4c2ea9"></span><em class="property">virtual</em> <code class="descname">~ConvOperator</code><span class="sig-paren">(</span><span class="sig-paren">)</span><a class="headerlink" href="#_CPPv2N6paddle12ConvOperatorD0Ev" title="Permalink to this definition">¶</a></dt>
Y
Yu Yang 已提交
1213 1214 1215 1216 1217
<dd><p>Free workspace in device and destroy cudnn tensor descriptor. </p>
</dd></dl>

<dl class="function">
<dt id="_CPPv2N6paddle12ConvOperator7forwardEv">
1218
<span id="paddle::ConvOperator::forward"></span><span class="target" id="paddleclasspaddle_1_1ConvOperator_1ad3f1055c956e28eb7017d31b3fd92d78"></span>void <code class="descname">forward</code><span class="sig-paren">(</span><span class="sig-paren">)</span><a class="headerlink" href="#_CPPv2N6paddle12ConvOperator7forwardEv" title="Permalink to this definition">¶</a></dt>
Y
Yu Yang 已提交
1219 1220 1221 1222
<dd></dd></dl>

<dl class="function">
<dt id="_CPPv2N6paddle12ConvOperator8backwardEv">
1223
<span id="paddle::ConvOperator::backward"></span><span class="target" id="paddleclasspaddle_1_1ConvOperator_1a9359ecbbe9d2f9edcb389bb8dd009397"></span>void <code class="descname">backward</code><span class="sig-paren">(</span><span class="sig-paren">)</span><a class="headerlink" href="#_CPPv2N6paddle12ConvOperator8backwardEv" title="Permalink to this definition">¶</a></dt>
Y
Yu Yang 已提交
1224 1225 1226 1227 1228 1229 1230 1231 1232 1233 1234 1235 1236 1237 1238 1239 1240 1241 1242 1243 1244 1245 1246 1247 1248 1249 1250 1251 1252 1253 1254 1255 1256 1257
<dd></dd></dl>

</div>
</dd></dl>

</div>
<div class="section" id="convshiftlayer">
<h2>ConvShiftLayer<a class="headerlink" href="#convshiftlayer" title="Permalink to this headline">¶</a></h2>
<dl class="class">
<dt id="_CPPv2N6paddle14ConvShiftLayerE">
<span id="paddle::ConvShiftLayer"></span><span class="target" id="paddleclasspaddle_1_1ConvShiftLayer"></span><em class="property">class </em><code class="descclassname">paddle::</code><code class="descname">ConvShiftLayer</code><a class="headerlink" href="#_CPPv2N6paddle14ConvShiftLayerE" title="Permalink to this definition">¶</a></dt>
<dd><p>A layer for circular convluation of two vectors, which is used in NEURAL TURING MACHINE. </p>
<p><ul>
<li><p class="first">Input: two vectors, the first is data (batchSize x dataDim) the second is shift weights (batchSize x shiftDim)</p>
</li>
<li><p class="first">Output: a vector (batchSize x dataDim) Assumed that:</p>
</li>
<li><p class="first">a[in]: contains M elements.</p>
</li>
<li><p class="first">b[in]: contains N elements (N should be odd).</p>
</li>
<li><p class="first">c[out]: contains M elements.</p>
<p><div class="math">
\[ c[i] = \sum_{j=-(N-1)/2}^{(N-1)/2}a_{i+j} * b_{j} \]</div>
</p>
</li>
</ul>
</p>
<p>In this formula:<ul class="simple">
<li>a&#8217;s index is computed modulo M.</li>
<li>b&#8217;s index is comupted modulo N.</li>
</ul>
</p>
<p>The config file api is conv_shift_layer. </p>
1258
<p>Inherits from <a class="reference internal" href="#paddleclasspaddle_1_1Layer"><span class="std std-ref">paddle::Layer</span></a></p>
1259
<div class="breathe-sectiondef docutils container">
Y
Yu Yang 已提交
1260 1261 1262 1263 1264 1265 1266 1267 1268 1269 1270 1271 1272
<p class="breathe-sectiondef-title rubric">Public Functions</p>
<dl class="function">
<dt id="_CPPv2N6paddle14ConvShiftLayer14ConvShiftLayerERK11LayerConfig">
<span id="paddle::ConvShiftLayer::ConvShiftLayer__LayerConfigCR"></span><span class="target" id="paddleclasspaddle_1_1ConvShiftLayer_1a7cd5808ef9ecc4d5ff89bb82f24e0ead"></span><code class="descname">ConvShiftLayer</code><span class="sig-paren">(</span><em class="property">const</em> LayerConfig &amp;<em>config</em><span class="sig-paren">)</span><a class="headerlink" href="#_CPPv2N6paddle14ConvShiftLayer14ConvShiftLayerERK11LayerConfig" title="Permalink to this definition">¶</a></dt>
<dd></dd></dl>

<dl class="function">
<dt id="_CPPv2N6paddle14ConvShiftLayerD0Ev">
<span id="paddle::ConvShiftLayer::~ConvShiftLayer"></span><span class="target" id="paddleclasspaddle_1_1ConvShiftLayer_1ae4bcae0419e3a77f79fb8f4202cabe47"></span><code class="descname">~ConvShiftLayer</code><span class="sig-paren">(</span><span class="sig-paren">)</span><a class="headerlink" href="#_CPPv2N6paddle14ConvShiftLayerD0Ev" title="Permalink to this definition">¶</a></dt>
<dd></dd></dl>

<dl class="function">
<dt id="_CPPv2N6paddle14ConvShiftLayer4initERK8LayerMapRK12ParameterMap">
1273
<span id="paddle::ConvShiftLayer::init__LayerMapCR.ParameterMapCR"></span><span class="target" id="paddleclasspaddle_1_1ConvShiftLayer_1ab71721fb6a3d1f59935e47da88a876c9"></span>bool <code class="descname">init</code><span class="sig-paren">(</span><em class="property">const</em> LayerMap &amp;<em>layerMap</em>, <em class="property">const</em> <a class="reference internal" href="../../parameter/parameter/parameter.html#_CPPv2N6paddle12ParameterMapE" title="paddle::ParameterMap">ParameterMap</a> &amp;<em>parameterMap</em><span class="sig-paren">)</span><a class="headerlink" href="#_CPPv2N6paddle14ConvShiftLayer4initERK8LayerMapRK12ParameterMap" title="Permalink to this definition">¶</a></dt>
Y
Yu Yang 已提交
1274 1275 1276 1277 1278
<dd><p>Intialization. For example, adding input layers from layerMap and parameterMap. </p>
</dd></dl>

<dl class="function">
<dt id="_CPPv2N6paddle14ConvShiftLayer7forwardE8PassType">
1279
<span id="paddle::ConvShiftLayer::forward__PassType"></span><span class="target" id="paddleclasspaddle_1_1ConvShiftLayer_1a86e201ab3067923dac0be8d28a7f241c"></span>void <code class="descname">forward</code><span class="sig-paren">(</span>PassType <em>passType</em><span class="sig-paren">)</span><a class="headerlink" href="#_CPPv2N6paddle14ConvShiftLayer7forwardE8PassType" title="Permalink to this definition">¶</a></dt>
Y
Yu Yang 已提交
1280 1281 1282 1283 1284
<dd><p>Forward propagation. All inherited implementation should call Layer::foward() function. </p>
</dd></dl>

<dl class="function">
<dt id="_CPPv2N6paddle14ConvShiftLayer8backwardERK14UpdateCallback">
1285
<span id="paddle::ConvShiftLayer::backward__UpdateCallbackCR"></span><span class="target" id="paddleclasspaddle_1_1ConvShiftLayer_1a38f3a55af1fcec7841f29bc59a852311"></span>void <code class="descname">backward</code><span class="sig-paren">(</span><em class="property">const</em> <a class="reference internal" href="../../parameter/parameter/parameter.html#_CPPv2N6paddle14UpdateCallbackE" title="paddle::UpdateCallback">UpdateCallback</a> &amp;<em>callback</em> = nullptr<span class="sig-paren">)</span><a class="headerlink" href="#_CPPv2N6paddle14ConvShiftLayer8backwardERK14UpdateCallback" title="Permalink to this definition">¶</a></dt>
1286
<dd><p>Backward propagation. Should only be called after <a class="reference internal" href="#paddleclasspaddle_1_1Layer_1a12386b3f20dd731e7ceaa2c61667cbe1"><span class="std std-ref">Layer::forward()</span></a> function. </p>
Y
Yu Yang 已提交
1287 1288 1289 1290 1291 1292 1293 1294 1295 1296 1297
</dd></dl>

</div>
</dd></dl>

</div>
<div class="section" id="cudnnconvlayer">
<h2>CudnnConvLayer<a class="headerlink" href="#cudnnconvlayer" title="Permalink to this headline">¶</a></h2>
<dl class="class">
<dt id="_CPPv2N6paddle14CudnnConvLayerE">
<span id="paddle::CudnnConvLayer"></span><span class="target" id="paddleclasspaddle_1_1CudnnConvLayer"></span><em class="property">class </em><code class="descclassname">paddle::</code><code class="descname">CudnnConvLayer</code><a class="headerlink" href="#_CPPv2N6paddle14CudnnConvLayerE" title="Permalink to this definition">¶</a></dt>
1298
<dd><p>A 2-dimension conv layer implemented by cuDNN. It only supports GPU mode. We automatic select <a class="reference internal" href="#paddleclasspaddle_1_1CudnnConvLayer"><span class="std std-ref">CudnnConvLayer</span></a> for GPU mode and <a class="reference internal" href="#paddleclasspaddle_1_1ExpandConvLayer"><span class="std std-ref">ExpandConvLayer</span></a> for CPU mode if you set type of &#8220;conv&#8221;. User also can specfiy type of &#8220;exconv&#8221; or &#8220;cudnn_conv&#8221; for particular type. </p>
Y
Yu Yang 已提交
1299
<p>The config file api is img_conv_layer. </p>
1300
<p>Inherits from <a class="reference internal" href="#paddleclasspaddle_1_1ConvBaseLayer"><span class="std std-ref">paddle::ConvBaseLayer</span></a></p>
1301
<div class="breathe-sectiondef docutils container">
Y
Yu Yang 已提交
1302 1303 1304 1305 1306 1307 1308 1309 1310 1311 1312 1313 1314
<p class="breathe-sectiondef-title rubric">Public Functions</p>
<dl class="function">
<dt id="_CPPv2N6paddle14CudnnConvLayer14CudnnConvLayerERK11LayerConfig">
<span id="paddle::CudnnConvLayer::CudnnConvLayer__LayerConfigCR"></span><span class="target" id="paddleclasspaddle_1_1CudnnConvLayer_1a7a5684ee940341c169e6a7ff9e6b8d71"></span><code class="descname">CudnnConvLayer</code><span class="sig-paren">(</span><em class="property">const</em> LayerConfig &amp;<em>config</em><span class="sig-paren">)</span><a class="headerlink" href="#_CPPv2N6paddle14CudnnConvLayer14CudnnConvLayerERK11LayerConfig" title="Permalink to this definition">¶</a></dt>
<dd></dd></dl>

<dl class="function">
<dt id="_CPPv2N6paddle14CudnnConvLayerD0Ev">
<span id="paddle::CudnnConvLayer::~CudnnConvLayer"></span><span class="target" id="paddleclasspaddle_1_1CudnnConvLayer_1ae6495a718e23025fb0758ecaf23a82f1"></span><code class="descname">~CudnnConvLayer</code><span class="sig-paren">(</span><span class="sig-paren">)</span><a class="headerlink" href="#_CPPv2N6paddle14CudnnConvLayerD0Ev" title="Permalink to this definition">¶</a></dt>
<dd></dd></dl>

<dl class="function">
<dt id="_CPPv2N6paddle14CudnnConvLayer4initERK8LayerMapRK12ParameterMap">
1315 1316
<span id="paddle::CudnnConvLayer::init__LayerMapCR.ParameterMapCR"></span><span class="target" id="paddleclasspaddle_1_1CudnnConvLayer_1a86474f2dbb5e3c7affeb14b5a1fc98dc"></span>bool <code class="descname">init</code><span class="sig-paren">(</span><em class="property">const</em> LayerMap &amp;<em>layerMap</em>, <em class="property">const</em> <a class="reference internal" href="../../parameter/parameter/parameter.html#_CPPv2N6paddle12ParameterMapE" title="paddle::ParameterMap">ParameterMap</a> &amp;<em>parameterMap</em><span class="sig-paren">)</span><a class="headerlink" href="#_CPPv2N6paddle14CudnnConvLayer4initERK8LayerMapRK12ParameterMap" title="Permalink to this definition">¶</a></dt>
<dd><p>Intialization. For example, adding input layers from layerMap and parameterMap. </p>
Y
Yu Yang 已提交
1317 1318 1319 1320
</dd></dl>

<dl class="function">
<dt id="_CPPv2N6paddle14CudnnConvLayer7forwardE8PassType">
1321
<span id="paddle::CudnnConvLayer::forward__PassType"></span><span class="target" id="paddleclasspaddle_1_1CudnnConvLayer_1a5e672ef382be488f09a8138bb480d09e"></span>void <code class="descname">forward</code><span class="sig-paren">(</span>PassType <em>passType</em><span class="sig-paren">)</span><a class="headerlink" href="#_CPPv2N6paddle14CudnnConvLayer7forwardE8PassType" title="Permalink to this definition">¶</a></dt>
Y
Yu Yang 已提交
1322 1323 1324 1325 1326
<dd><p>Forward propagation. All inherited implementation should call Layer::foward() function. </p>
</dd></dl>

<dl class="function">
<dt id="_CPPv2N6paddle14CudnnConvLayer8backwardERK14UpdateCallback">
1327
<span id="paddle::CudnnConvLayer::backward__UpdateCallbackCR"></span><span class="target" id="paddleclasspaddle_1_1CudnnConvLayer_1af651218b3f4c478ab334bfd9fcf73385"></span>void <code class="descname">backward</code><span class="sig-paren">(</span><em class="property">const</em> <a class="reference internal" href="../../parameter/parameter/parameter.html#_CPPv2N6paddle14UpdateCallbackE" title="paddle::UpdateCallback">UpdateCallback</a> &amp;<em>callback</em><span class="sig-paren">)</span><a class="headerlink" href="#_CPPv2N6paddle14CudnnConvLayer8backwardERK14UpdateCallback" title="Permalink to this definition">¶</a></dt>
1328
<dd><p>Backward propagation. Should only be called after <a class="reference internal" href="#paddleclasspaddle_1_1Layer_1a12386b3f20dd731e7ceaa2c61667cbe1"><span class="std std-ref">Layer::forward()</span></a> function. </p>
Y
Yu Yang 已提交
1329 1330 1331 1332 1333 1334 1335 1336 1337 1338 1339 1340 1341
</dd></dl>

<dl class="function">
<dt id="_CPPv2N6paddle14CudnnConvLayer9addBiasesEv">
<span id="paddle::CudnnConvLayer::addBiases"></span><span class="target" id="paddleclasspaddle_1_1CudnnConvLayer_1a18beba9db318a2013eee4f0b1e08a1f2"></span>void <code class="descname">addBiases</code><span class="sig-paren">(</span><span class="sig-paren">)</span><a class="headerlink" href="#_CPPv2N6paddle14CudnnConvLayer9addBiasesEv" title="Permalink to this definition">¶</a></dt>
<dd></dd></dl>

<dl class="function">
<dt id="_CPPv2N6paddle14CudnnConvLayer11bpropBiasesEv">
<span id="paddle::CudnnConvLayer::bpropBiases"></span><span class="target" id="paddleclasspaddle_1_1CudnnConvLayer_1a124b53adafeeead15d6380af2ec8e446"></span>void <code class="descname">bpropBiases</code><span class="sig-paren">(</span><span class="sig-paren">)</span><a class="headerlink" href="#_CPPv2N6paddle14CudnnConvLayer11bpropBiasesEv" title="Permalink to this definition">¶</a></dt>
<dd></dd></dl>

</div>
1342
<div class="breathe-sectiondef docutils container">
Y
Yu Yang 已提交
1343 1344
<p class="breathe-sectiondef-title rubric">Protected Attributes</p>
<dl class="member">
1345 1346
<dt id="_CPPv2N6paddle14CudnnConvLayer9projConf_E">
<span id="paddle::CudnnConvLayer::projConf___std::vector:std::unique_ptr:ProjectionConfig::"></span><span class="target" id="paddleclasspaddle_1_1CudnnConvLayer_1a84970e8fdea3d8023c625aff058131ee"></span>std::vector&lt;std::unique_ptr&lt;ProjectionConfig&gt;&gt; <code class="descname">projConf_</code><a class="headerlink" href="#_CPPv2N6paddle14CudnnConvLayer9projConf_E" title="Permalink to this definition">¶</a></dt>
Y
Yu Yang 已提交
1347 1348 1349
<dd></dd></dl>

<dl class="member">
1350 1351
<dt id="_CPPv2N6paddle14CudnnConvLayer12projections_E">
<span id="paddle::CudnnConvLayer::projections___std::vector:std::unique_ptr:Projection::"></span><span class="target" id="paddleclasspaddle_1_1CudnnConvLayer_1acdbebf7644b45bbc55dcd374b8117e5d"></span>std::vector&lt;std::unique_ptr&lt;<a class="reference internal" href="#_CPPv2N6paddle10ProjectionE" title="paddle::Projection">Projection</a>&gt;&gt; <code class="descname">projections_</code><a class="headerlink" href="#_CPPv2N6paddle14CudnnConvLayer12projections_E" title="Permalink to this definition">¶</a></dt>
Y
Yu Yang 已提交
1352 1353 1354 1355 1356
<dd></dd></dl>

<dl class="member">
<dt id="_CPPv2N6paddle14CudnnConvLayer9biasDesc_E">
<span id="paddle::CudnnConvLayer::biasDesc___hl_tensor_descriptor"></span><span class="target" id="paddleclasspaddle_1_1CudnnConvLayer_1a942f2de8279c3b518b4689f4213583a1"></span><a class="reference internal" href="../../cuda/cuda/cuda.html#_CPPv220hl_tensor_descriptor" title="hl_tensor_descriptor">hl_tensor_descriptor</a> <code class="descname">biasDesc_</code><a class="headerlink" href="#_CPPv2N6paddle14CudnnConvLayer9biasDesc_E" title="Permalink to this definition">¶</a></dt>
1357
<dd></dd></dl>
Y
Yu Yang 已提交
1358 1359 1360

<dl class="member">
<dt id="_CPPv2N6paddle14CudnnConvLayer11outputDesc_E">
1361 1362
<span id="paddle::CudnnConvLayer::outputDesc___hl_tensor_descriptor"></span><span class="target" id="paddleclasspaddle_1_1CudnnConvLayer_1aa08ac9daa92cbe29a09bdd7dfa2b7ce2"></span><a class="reference internal" href="../../cuda/cuda/cuda.html#_CPPv220hl_tensor_descriptor" title="hl_tensor_descriptor">hl_tensor_descriptor</a> <code class="descname">outputDesc_</code><a class="headerlink" href="#_CPPv2N6paddle14CudnnConvLayer11outputDesc_E" title="Permalink to this definition">¶</a></dt>
<dd></dd></dl>
Y
Yu Yang 已提交
1363 1364 1365 1366

<dl class="member">
<dt id="_CPPv2N6paddle14CudnnConvLayer11biasOffset_E">
<span id="paddle::CudnnConvLayer::biasOffset___i"></span><span class="target" id="paddleclasspaddle_1_1CudnnConvLayer_1a5ef79d1d36362c175a3fe59cd73a768c"></span>int <code class="descname">biasOffset_</code><a class="headerlink" href="#_CPPv2N6paddle14CudnnConvLayer11biasOffset_E" title="Permalink to this definition">¶</a></dt>
1367
<dd></dd></dl>
Y
Yu Yang 已提交
1368

1369
<dl class="member">
1370 1371 1372
<dt id="_CPPv2N6paddle14CudnnConvLayer13outputOffset_E">
<span id="paddle::CudnnConvLayer::outputOffset___i"></span><span class="target" id="paddleclasspaddle_1_1CudnnConvLayer_1a60498e440c9bc1674c3fc64329007feb"></span>int <code class="descname">outputOffset_</code><a class="headerlink" href="#_CPPv2N6paddle14CudnnConvLayer13outputOffset_E" title="Permalink to this definition">¶</a></dt>
<dd></dd></dl>
1373

Y
Yu Yang 已提交
1374 1375 1376 1377 1378 1379 1380 1381 1382 1383 1384
</div>
</dd></dl>

</div>
<div class="section" id="expandconvlayer">
<h2>ExpandConvLayer<a class="headerlink" href="#expandconvlayer" title="Permalink to this headline">¶</a></h2>
<dl class="class">
<dt id="_CPPv2N6paddle15ExpandConvLayerE">
<span id="paddle::ExpandConvLayer"></span><span class="target" id="paddleclasspaddle_1_1ExpandConvLayer"></span><em class="property">class </em><code class="descclassname">paddle::</code><code class="descname">ExpandConvLayer</code><a class="headerlink" href="#_CPPv2N6paddle15ExpandConvLayerE" title="Permalink to this definition">¶</a></dt>
<dd><p>A subclass of convolution layer. This layer expands input and use matrix multiplication to calculate convolution operation. </p>
<p>The config file api is img_conv_layer. </p>
1385
<p>Inherits from paddle::ExpandConvBaseLayer</p>
1386
<div class="breathe-sectiondef docutils container">
Y
Yu Yang 已提交
1387 1388 1389 1390 1391 1392 1393 1394 1395 1396 1397 1398 1399
<p class="breathe-sectiondef-title rubric">Public Functions</p>
<dl class="function">
<dt id="_CPPv2N6paddle15ExpandConvLayer15ExpandConvLayerERK11LayerConfig">
<span id="paddle::ExpandConvLayer::ExpandConvLayer__LayerConfigCR"></span><span class="target" id="paddleclasspaddle_1_1ExpandConvLayer_1afc16f139f71c37ecbeecbcdc7aa15c7d"></span><code class="descname">ExpandConvLayer</code><span class="sig-paren">(</span><em class="property">const</em> LayerConfig &amp;<em>config</em><span class="sig-paren">)</span><a class="headerlink" href="#_CPPv2N6paddle15ExpandConvLayer15ExpandConvLayerERK11LayerConfig" title="Permalink to this definition">¶</a></dt>
<dd></dd></dl>

<dl class="function">
<dt id="_CPPv2N6paddle15ExpandConvLayerD0Ev">
<span id="paddle::ExpandConvLayer::~ExpandConvLayer"></span><span class="target" id="paddleclasspaddle_1_1ExpandConvLayer_1aeb7273d6aa85fa4e3bbdb2aa0eba8e57"></span><code class="descname">~ExpandConvLayer</code><span class="sig-paren">(</span><span class="sig-paren">)</span><a class="headerlink" href="#_CPPv2N6paddle15ExpandConvLayerD0Ev" title="Permalink to this definition">¶</a></dt>
<dd></dd></dl>

<dl class="function">
<dt id="_CPPv2N6paddle15ExpandConvLayer4initERK8LayerMapRK12ParameterMap">
1400
<span id="paddle::ExpandConvLayer::init__LayerMapCR.ParameterMapCR"></span><span class="target" id="paddleclasspaddle_1_1ExpandConvLayer_1a047647d7879ec02aecdf0bef0779bdcf"></span>bool <code class="descname">init</code><span class="sig-paren">(</span><em class="property">const</em> LayerMap &amp;<em>layerMap</em>, <em class="property">const</em> <a class="reference internal" href="../../parameter/parameter/parameter.html#_CPPv2N6paddle12ParameterMapE" title="paddle::ParameterMap">ParameterMap</a> &amp;<em>parameterMap</em><span class="sig-paren">)</span><a class="headerlink" href="#_CPPv2N6paddle15ExpandConvLayer4initERK8LayerMapRK12ParameterMap" title="Permalink to this definition">¶</a></dt>
Y
Yu Yang 已提交
1401 1402 1403 1404 1405
<dd><p>Intialization. For example, adding input layers from layerMap and parameterMap. </p>
</dd></dl>

<dl class="function">
<dt id="_CPPv2N6paddle15ExpandConvLayer7forwardE8PassType">
1406
<span id="paddle::ExpandConvLayer::forward__PassType"></span><span class="target" id="paddleclasspaddle_1_1ExpandConvLayer_1afe70ec2d90ae387fb8fb50565cf81f1b"></span>void <code class="descname">forward</code><span class="sig-paren">(</span>PassType <em>passType</em><span class="sig-paren">)</span><a class="headerlink" href="#_CPPv2N6paddle15ExpandConvLayer7forwardE8PassType" title="Permalink to this definition">¶</a></dt>
Y
Yu Yang 已提交
1407 1408 1409 1410 1411
<dd><p>Forward propagation. All inherited implementation should call Layer::foward() function. </p>
</dd></dl>

<dl class="function">
<dt id="_CPPv2N6paddle15ExpandConvLayer8backwardERK14UpdateCallback">
1412
<span id="paddle::ExpandConvLayer::backward__UpdateCallbackCR"></span><span class="target" id="paddleclasspaddle_1_1ExpandConvLayer_1a99be025975257a925a91a5f5120a1238"></span>void <code class="descname">backward</code><span class="sig-paren">(</span><em class="property">const</em> <a class="reference internal" href="../../parameter/parameter/parameter.html#_CPPv2N6paddle14UpdateCallbackE" title="paddle::UpdateCallback">UpdateCallback</a> &amp;<em>callback</em><span class="sig-paren">)</span><a class="headerlink" href="#_CPPv2N6paddle15ExpandConvLayer8backwardERK14UpdateCallback" title="Permalink to this definition">¶</a></dt>
1413
<dd><p>Backward propagation. Should only be called after <a class="reference internal" href="#paddleclasspaddle_1_1Layer_1a12386b3f20dd731e7ceaa2c61667cbe1"><span class="std std-ref">Layer::forward()</span></a> function. </p>
Y
Yu Yang 已提交
1414 1415 1416 1417 1418 1419 1420 1421 1422 1423 1424 1425 1426
</dd></dl>

</div>
</dd></dl>

</div>
<div class="section" id="contextprojection">
<h2>ContextProjection<a class="headerlink" href="#contextprojection" title="Permalink to this headline">¶</a></h2>
<dl class="class">
<dt id="_CPPv2N6paddle17ContextProjectionE">
<span id="paddle::ContextProjection"></span><span class="target" id="paddleclasspaddle_1_1ContextProjection"></span><em class="property">class </em><code class="descclassname">paddle::</code><code class="descname">ContextProjection</code><a class="headerlink" href="#_CPPv2N6paddle17ContextProjectionE" title="Permalink to this definition">¶</a></dt>
<dd><p>Context projection concatenate features in adjacent time steps in a sequence. The i-th row of the output is the concatenation of context_length rows of the input. The context_length rows are the consecutive rows from the i+shift_start row. </p>
<p>For example, assumed input (x) has 4 words and the dimension of each word representation is 2. If we use zero to pad instead of learned weight to pad, and the context_lenth is 3, the output (y) is:</p>
1427 1428 1429 1430 1431 1432 1433 1434
<p><div class="highlight-default"><div class="highlight"><pre><span></span><span class="n">x</span> <span class="o">=</span> <span class="p">[</span><span class="n">a1</span><span class="p">,</span> <span class="n">a2</span><span class="p">;</span>
     <span class="n">b1</span><span class="p">,</span> <span class="n">b2</span><span class="p">;</span>
     <span class="n">c1</span><span class="p">,</span> <span class="n">c2</span><span class="p">;</span>
     <span class="n">d1</span><span class="p">,</span> <span class="n">d2</span><span class="p">]</span>
<span class="n">y</span> <span class="o">=</span> <span class="p">[</span><span class="mi">0</span><span class="p">,</span>  <span class="mi">0</span><span class="p">,</span>  <span class="n">a1</span><span class="p">,</span> <span class="n">a2</span><span class="p">,</span> <span class="n">b1</span><span class="p">,</span> <span class="n">b2</span><span class="p">;</span>
     <span class="n">a1</span><span class="p">,</span> <span class="n">a2</span><span class="p">,</span> <span class="n">b1</span><span class="p">,</span> <span class="n">b2</span><span class="p">,</span> <span class="n">c1</span><span class="p">,</span> <span class="n">c2</span><span class="p">;</span>
     <span class="n">b1</span><span class="p">,</span> <span class="n">b2</span><span class="p">,</span> <span class="n">c1</span><span class="p">,</span> <span class="n">c2</span><span class="p">,</span> <span class="n">d1</span><span class="p">,</span> <span class="n">d2</span><span class="p">;</span>
     <span class="n">c1</span><span class="p">,</span> <span class="n">c2</span><span class="p">,</span> <span class="n">d1</span><span class="p">,</span> <span class="n">d2</span><span class="p">,</span> <span class="mi">0</span><span class="p">,</span>  <span class="mi">0</span><span class="p">]</span>
Y
Yu Yang 已提交
1435 1436 1437 1438
</pre></div>
</div>
</p>
<p>The config file api is context_projection. </p>
1439
<p>Inherits from <a class="reference internal" href="#paddleclasspaddle_1_1Projection"><span class="std std-ref">paddle::Projection</span></a></p>
1440
<div class="breathe-sectiondef docutils container">
Y
Yu Yang 已提交
1441 1442 1443 1444 1445 1446 1447 1448 1449
<p class="breathe-sectiondef-title rubric">Public Functions</p>
<dl class="function">
<dt id="_CPPv2N6paddle17ContextProjection17ContextProjectionERK16ProjectionConfig12ParameterPtrb">
<span id="paddle::ContextProjection::ContextProjection__ProjectionConfigCR.ParameterPtr.b"></span><span class="target" id="paddleclasspaddle_1_1ContextProjection_1a21fdf30f1039e09d70b7a60dd8112c5f"></span><code class="descname">ContextProjection</code><span class="sig-paren">(</span><em class="property">const</em> ProjectionConfig &amp;<em>config</em>, <a class="reference internal" href="../../parameter/parameter/parameter.html#_CPPv2N6paddle12ParameterPtrE" title="paddle::ParameterPtr">ParameterPtr</a> <em>parameter</em>, bool <em>useGpu</em><span class="sig-paren">)</span><a class="headerlink" href="#_CPPv2N6paddle17ContextProjection17ContextProjectionERK16ProjectionConfig12ParameterPtrb" title="Permalink to this definition">¶</a></dt>
<dd><p>Constructor. If context_start is zero and context_lenth is one, it will set trainable_padding false. trainable_padding is an optional arguments and if it is set, constructor will set learned weight, which is used to pad output. </p>
</dd></dl>

<dl class="function">
<dt id="_CPPv2N6paddle17ContextProjection7forwardEv">
1450
<span id="paddle::ContextProjection::forward"></span><span class="target" id="paddleclasspaddle_1_1ContextProjection_1aef0d11ba3ba4a8abb11344992389feb8"></span>void <code class="descname">forward</code><span class="sig-paren">(</span><span class="sig-paren">)</span><a class="headerlink" href="#_CPPv2N6paddle17ContextProjection7forwardEv" title="Permalink to this definition">¶</a></dt>
Y
Yu Yang 已提交
1451 1452 1453 1454
<dd></dd></dl>

<dl class="function">
<dt id="_CPPv2N6paddle17ContextProjection8backwardERK14UpdateCallback">
1455
<span id="paddle::ContextProjection::backward__UpdateCallbackCR"></span><span class="target" id="paddleclasspaddle_1_1ContextProjection_1a0dcf28dc9d52a00a1ce4d9532e62a512"></span>void <code class="descname">backward</code><span class="sig-paren">(</span><em class="property">const</em> <a class="reference internal" href="../../parameter/parameter/parameter.html#_CPPv2N6paddle14UpdateCallbackE" title="paddle::UpdateCallback">UpdateCallback</a> &amp;<em>callback</em><span class="sig-paren">)</span><a class="headerlink" href="#_CPPv2N6paddle17ContextProjection8backwardERK14UpdateCallback" title="Permalink to this definition">¶</a></dt>
Y
Yu Yang 已提交
1456 1457 1458 1459
<dd></dd></dl>

<dl class="function">
<dt id="_CPPv2N6paddle17ContextProjection10resetStateEv">
1460
<span id="paddle::ContextProjection::resetState"></span><span class="target" id="paddleclasspaddle_1_1ContextProjection_1a80cdd8e8188127b4753b53ddc3f5a87d"></span>void <code class="descname">resetState</code><span class="sig-paren">(</span><span class="sig-paren">)</span><a class="headerlink" href="#_CPPv2N6paddle17ContextProjection10resetStateEv" title="Permalink to this definition">¶</a></dt>
Y
Yu Yang 已提交
1461 1462 1463 1464 1465
<dd><p>See comment in Layer.h for the function with the same name. </p>
</dd></dl>

<dl class="function">
<dt id="_CPPv2N6paddle17ContextProjection8setStateE13LayerStatePtr">
1466
<span id="paddle::ContextProjection::setState__LayerStatePtr"></span><span class="target" id="paddleclasspaddle_1_1ContextProjection_1a40732861981b3fb596913f1df4dd78d6"></span>void <code class="descname">setState</code><span class="sig-paren">(</span>LayerStatePtr <em>state</em><span class="sig-paren">)</span><a class="headerlink" href="#_CPPv2N6paddle17ContextProjection8setStateE13LayerStatePtr" title="Permalink to this definition">¶</a></dt>
Y
Yu Yang 已提交
1467 1468 1469 1470 1471
<dd><p>Set layer state. </p>
</dd></dl>

<dl class="function">
<dt id="_CPPv2N6paddle17ContextProjection8getStateEv">
1472
<span id="paddle::ContextProjection::getState"></span><span class="target" id="paddleclasspaddle_1_1ContextProjection_1a17c5468a8a29ca093672063f35d3c858"></span>LayerStatePtr <code class="descname">getState</code><span class="sig-paren">(</span><span class="sig-paren">)</span><a class="headerlink" href="#_CPPv2N6paddle17ContextProjection8getStateEv" title="Permalink to this definition">¶</a></dt>
Y
Yu Yang 已提交
1473 1474 1475 1476
<dd><p>Get layer state. A copy of internal state is returned. </p>
</dd></dl>

</div>
1477
<div class="breathe-sectiondef docutils container">
Y
Yu Yang 已提交
1478 1479 1480 1481 1482 1483 1484 1485 1486 1487 1488 1489 1490 1491 1492 1493 1494 1495 1496 1497 1498 1499 1500 1501 1502 1503 1504 1505 1506 1507 1508 1509 1510 1511 1512 1513 1514 1515 1516 1517 1518
<p class="breathe-sectiondef-title rubric">Protected Attributes</p>
<dl class="member">
<dt id="_CPPv2N6paddle17ContextProjection7weight_E">
<span id="paddle::ContextProjection::weight___std::unique_ptr:Weight:"></span><span class="target" id="paddleclasspaddle_1_1ContextProjection_1a790368ed34fc3109d3c01b64314fc991"></span>std::unique_ptr&lt;<a class="reference internal" href="../../parameter/parameter/parameter.html#_CPPv2N6paddle6WeightE" title="paddle::Weight">Weight</a>&gt; <code class="descname">weight_</code><a class="headerlink" href="#_CPPv2N6paddle17ContextProjection7weight_E" title="Permalink to this definition">¶</a></dt>
<dd></dd></dl>

<dl class="member">
<dt id="_CPPv2N6paddle17ContextProjection9beginPad_E">
<span id="paddle::ContextProjection::beginPad___s"></span><span class="target" id="paddleclasspaddle_1_1ContextProjection_1a62de14463212044c2bb65aec28f8bf19"></span>size_t <code class="descname">beginPad_</code><a class="headerlink" href="#_CPPv2N6paddle17ContextProjection9beginPad_E" title="Permalink to this definition">¶</a></dt>
<dd><p>number of extra timesteps added at the beginning </p>
</dd></dl>

<dl class="member">
<dt id="_CPPv2N6paddle17ContextProjection7endPad_E">
<span id="paddle::ContextProjection::endPad___s"></span><span class="target" id="paddleclasspaddle_1_1ContextProjection_1a35b41b56daf3b0b2f735e95c5150aa61"></span>size_t <code class="descname">endPad_</code><a class="headerlink" href="#_CPPv2N6paddle17ContextProjection7endPad_E" title="Permalink to this definition">¶</a></dt>
<dd><p>number of extra timesteps added at the end </p>
</dd></dl>

<dl class="member">
<dt id="_CPPv2N6paddle17ContextProjection6state_E">
<span id="paddle::ContextProjection::state___MatrixPtr"></span><span class="target" id="paddleclasspaddle_1_1ContextProjection_1aa52263a4813b31b3b2428dfd73cace68"></span><a class="reference internal" href="../../math/matrix/matrix.html#_CPPv2N6paddle9MatrixPtrE" title="paddle::MatrixPtr">MatrixPtr</a> <code class="descname">state_</code><a class="headerlink" href="#_CPPv2N6paddle17ContextProjection6state_E" title="Permalink to this definition">¶</a></dt>
<dd><p>state_ and state2_ are used in sequence generating and saved previous inputs. </p>
</dd></dl>

<dl class="member">
<dt id="_CPPv2N6paddle17ContextProjection7state2_E">
<span id="paddle::ContextProjection::state2___MatrixPtr"></span><span class="target" id="paddleclasspaddle_1_1ContextProjection_1a249368ba2a1cdb2e383dd70232058d2a"></span><a class="reference internal" href="../../math/matrix/matrix.html#_CPPv2N6paddle9MatrixPtrE" title="paddle::MatrixPtr">MatrixPtr</a> <code class="descname">state2_</code><a class="headerlink" href="#_CPPv2N6paddle17ContextProjection7state2_E" title="Permalink to this definition">¶</a></dt>
<dd></dd></dl>

</div>
</dd></dl>

</div>
</div>
<div class="section" id="pooling-layers">
<h1>Pooling Layers<a class="headerlink" href="#pooling-layers" title="Permalink to this headline">¶</a></h1>
<div class="section" id="poollayer">
<h2>PoolLayer<a class="headerlink" href="#poollayer" title="Permalink to this headline">¶</a></h2>
<dl class="class">
<dt id="_CPPv2N6paddle9PoolLayerE">
<span id="paddle::PoolLayer"></span><span class="target" id="paddleclasspaddle_1_1PoolLayer"></span><em class="property">class </em><code class="descclassname">paddle::</code><code class="descname">PoolLayer</code><a class="headerlink" href="#_CPPv2N6paddle9PoolLayerE" title="Permalink to this definition">¶</a></dt>
Y
Yu Yang 已提交
1519
<dd><p>Basic parent layer of pooling Pools the input within regions. </p>
1520 1521
<p>Inherits from <a class="reference internal" href="#paddleclasspaddle_1_1Layer"><span class="std std-ref">paddle::Layer</span></a></p>
<p>Subclassed by <a class="reference internal" href="#paddleclasspaddle_1_1CudnnPoolLayer"><span class="std std-ref">paddle::CudnnPoolLayer</span></a>, <a class="reference internal" href="#paddleclasspaddle_1_1PoolProjectionLayer"><span class="std std-ref">paddle::PoolProjectionLayer</span></a></p>
1522
<div class="breathe-sectiondef docutils container">
Y
Yu Yang 已提交
1523 1524 1525 1526 1527 1528 1529 1530
<p class="breathe-sectiondef-title rubric">Public Functions</p>
<dl class="function">
<dt id="_CPPv2N6paddle9PoolLayer9PoolLayerERK11LayerConfig">
<span id="paddle::PoolLayer::PoolLayer__LayerConfigCR"></span><span class="target" id="paddleclasspaddle_1_1PoolLayer_1a4b3e150709ea27a242768e83777539f8"></span><code class="descname">PoolLayer</code><span class="sig-paren">(</span><em class="property">const</em> LayerConfig &amp;<em>config</em><span class="sig-paren">)</span><a class="headerlink" href="#_CPPv2N6paddle9PoolLayer9PoolLayerERK11LayerConfig" title="Permalink to this definition">¶</a></dt>
<dd></dd></dl>

<dl class="function">
<dt id="_CPPv2N6paddle9PoolLayer4initERK8LayerMapRK12ParameterMap">
1531
<span id="paddle::PoolLayer::init__LayerMapCR.ParameterMapCR"></span><span class="target" id="paddleclasspaddle_1_1PoolLayer_1ac9e9c312be98fa3ecf488ced05bbb977"></span>bool <code class="descname">init</code><span class="sig-paren">(</span><em class="property">const</em> LayerMap &amp;<em>layerMap</em>, <em class="property">const</em> <a class="reference internal" href="../../parameter/parameter/parameter.html#_CPPv2N6paddle12ParameterMapE" title="paddle::ParameterMap">ParameterMap</a> &amp;<em>parameterMap</em><span class="sig-paren">)</span><a class="headerlink" href="#_CPPv2N6paddle9PoolLayer4initERK8LayerMapRK12ParameterMap" title="Permalink to this definition">¶</a></dt>
Y
Yu Yang 已提交
1532 1533 1534 1535
<dd><p>Intialization. For example, adding input layers from layerMap and parameterMap. </p>
</dd></dl>

</div>
1536
<div class="breathe-sectiondef docutils container">
Y
Yu Yang 已提交
1537 1538 1539 1540
<p class="breathe-sectiondef-title rubric">Public Static Functions</p>
<dl class="function">
<dt id="_CPPv2N6paddle9PoolLayer6createERK11LayerConfig">
<span id="paddle::PoolLayer::create__LayerConfigCR"></span><span class="target" id="paddleclasspaddle_1_1PoolLayer_1ad69afd6a709d60fde8a7ef8e75ea83a1"></span><a class="reference internal" href="#_CPPv2N6paddle5LayerE" title="paddle::Layer">Layer</a> *<code class="descname">create</code><span class="sig-paren">(</span><em class="property">const</em> LayerConfig &amp;<em>config</em><span class="sig-paren">)</span><a class="headerlink" href="#_CPPv2N6paddle9PoolLayer6createERK11LayerConfig" title="Permalink to this definition">¶</a></dt>
Y
Yu Yang 已提交
1541 1542
<dd><p>create pooling layer by pool_type </p>
</dd></dl>
Y
Yu Yang 已提交
1543 1544

</div>
1545
<div class="breathe-sectiondef docutils container">
Y
Yu Yang 已提交
1546 1547 1548 1549 1550 1551 1552 1553 1554 1555 1556 1557 1558 1559 1560 1561 1562 1563 1564 1565 1566 1567 1568 1569 1570 1571 1572 1573 1574 1575 1576 1577 1578 1579 1580 1581 1582 1583 1584 1585 1586 1587 1588 1589 1590 1591 1592 1593 1594 1595 1596 1597 1598 1599 1600 1601 1602 1603 1604 1605 1606 1607 1608 1609 1610 1611 1612 1613 1614 1615
<p class="breathe-sectiondef-title rubric">Protected Attributes</p>
<dl class="member">
<dt id="_CPPv2N6paddle9PoolLayer9channels_E">
<span id="paddle::PoolLayer::channels___s"></span><span class="target" id="paddleclasspaddle_1_1PoolLayer_1a31d38e37618cf4776529e38f0a099a4f"></span>size_t <code class="descname">channels_</code><a class="headerlink" href="#_CPPv2N6paddle9PoolLayer9channels_E" title="Permalink to this definition">¶</a></dt>
<dd></dd></dl>

<dl class="member">
<dt id="_CPPv2N6paddle9PoolLayer6sizeX_E">
<span id="paddle::PoolLayer::sizeX___s"></span><span class="target" id="paddleclasspaddle_1_1PoolLayer_1a7fbab065d1e9c76e47caa924ad7418db"></span>size_t <code class="descname">sizeX_</code><a class="headerlink" href="#_CPPv2N6paddle9PoolLayer6sizeX_E" title="Permalink to this definition">¶</a></dt>
<dd></dd></dl>

<dl class="member">
<dt id="_CPPv2N6paddle9PoolLayer7stride_E">
<span id="paddle::PoolLayer::stride___s"></span><span class="target" id="paddleclasspaddle_1_1PoolLayer_1a75b2745a7b3c7a3844f6864838e57923"></span>size_t <code class="descname">stride_</code><a class="headerlink" href="#_CPPv2N6paddle9PoolLayer7stride_E" title="Permalink to this definition">¶</a></dt>
<dd></dd></dl>

<dl class="member">
<dt id="_CPPv2N6paddle9PoolLayer8outputX_E">
<span id="paddle::PoolLayer::outputX___s"></span><span class="target" id="paddleclasspaddle_1_1PoolLayer_1a1655c5b737741493c8c457ca1558d330"></span>size_t <code class="descname">outputX_</code><a class="headerlink" href="#_CPPv2N6paddle9PoolLayer8outputX_E" title="Permalink to this definition">¶</a></dt>
<dd></dd></dl>

<dl class="member">
<dt id="_CPPv2N6paddle9PoolLayer8imgSize_E">
<span id="paddle::PoolLayer::imgSize___s"></span><span class="target" id="paddleclasspaddle_1_1PoolLayer_1a34f5c074e7b51c3b1c726007f995a165"></span>size_t <code class="descname">imgSize_</code><a class="headerlink" href="#_CPPv2N6paddle9PoolLayer8imgSize_E" title="Permalink to this definition">¶</a></dt>
<dd></dd></dl>

<dl class="member">
<dt id="_CPPv2N6paddle9PoolLayer12confPadding_E">
<span id="paddle::PoolLayer::confPadding___i"></span><span class="target" id="paddleclasspaddle_1_1PoolLayer_1a19e5291d78949982dc1f34380a18a6eb"></span>int <code class="descname">confPadding_</code><a class="headerlink" href="#_CPPv2N6paddle9PoolLayer12confPadding_E" title="Permalink to this definition">¶</a></dt>
<dd></dd></dl>

<dl class="member">
<dt id="_CPPv2N6paddle9PoolLayer6sizeY_E">
<span id="paddle::PoolLayer::sizeY___s"></span><span class="target" id="paddleclasspaddle_1_1PoolLayer_1ab5939dec99220612cacdedaa183c30b6"></span>size_t <code class="descname">sizeY_</code><a class="headerlink" href="#_CPPv2N6paddle9PoolLayer6sizeY_E" title="Permalink to this definition">¶</a></dt>
<dd></dd></dl>

<dl class="member">
<dt id="_CPPv2N6paddle9PoolLayer9imgSizeY_E">
<span id="paddle::PoolLayer::imgSizeY___s"></span><span class="target" id="paddleclasspaddle_1_1PoolLayer_1a7e16a82714e0f1e53aca321142117d51"></span>size_t <code class="descname">imgSizeY_</code><a class="headerlink" href="#_CPPv2N6paddle9PoolLayer9imgSizeY_E" title="Permalink to this definition">¶</a></dt>
<dd></dd></dl>

<dl class="member">
<dt id="_CPPv2N6paddle9PoolLayer8strideY_E">
<span id="paddle::PoolLayer::strideY___s"></span><span class="target" id="paddleclasspaddle_1_1PoolLayer_1a16bba2ca85415e7ec6a95d38a5198ba3"></span>size_t <code class="descname">strideY_</code><a class="headerlink" href="#_CPPv2N6paddle9PoolLayer8strideY_E" title="Permalink to this definition">¶</a></dt>
<dd></dd></dl>

<dl class="member">
<dt id="_CPPv2N6paddle9PoolLayer8outputY_E">
<span id="paddle::PoolLayer::outputY___s"></span><span class="target" id="paddleclasspaddle_1_1PoolLayer_1a287f6392713f222608f56a06c1abb7ab"></span>size_t <code class="descname">outputY_</code><a class="headerlink" href="#_CPPv2N6paddle9PoolLayer8outputY_E" title="Permalink to this definition">¶</a></dt>
<dd></dd></dl>

<dl class="member">
<dt id="_CPPv2N6paddle9PoolLayer13confPaddingY_E">
<span id="paddle::PoolLayer::confPaddingY___i"></span><span class="target" id="paddleclasspaddle_1_1PoolLayer_1a8d7e36004a3968a3b5bad59050ccf126"></span>int <code class="descname">confPaddingY_</code><a class="headerlink" href="#_CPPv2N6paddle9PoolLayer13confPaddingY_E" title="Permalink to this definition">¶</a></dt>
<dd></dd></dl>

<dl class="member">
<dt id="_CPPv2N6paddle9PoolLayer9poolType_E">
<span id="paddle::PoolLayer::poolType___ss"></span><span class="target" id="paddleclasspaddle_1_1PoolLayer_1a90f8486c1a4bc30f5c832ab1649e9b0b"></span>std::string <code class="descname">poolType_</code><a class="headerlink" href="#_CPPv2N6paddle9PoolLayer9poolType_E" title="Permalink to this definition">¶</a></dt>
<dd></dd></dl>

</div>
</dd></dl>

</div>
<div class="section" id="poolprojectionlayer">
<h2>PoolProjectionLayer<a class="headerlink" href="#poolprojectionlayer" title="Permalink to this headline">¶</a></h2>
<dl class="class">
<dt id="_CPPv2N6paddle19PoolProjectionLayerE">
<span id="paddle::PoolProjectionLayer"></span><span class="target" id="paddleclasspaddle_1_1PoolProjectionLayer"></span><em class="property">class </em><code class="descclassname">paddle::</code><code class="descname">PoolProjectionLayer</code><a class="headerlink" href="#_CPPv2N6paddle19PoolProjectionLayerE" title="Permalink to this definition">¶</a></dt>
Y
Yu Yang 已提交
1616
<dd><p>Basic parent layer of different kinds of pooling. </p>
1617
<p>Inherits from <a class="reference internal" href="#paddleclasspaddle_1_1PoolLayer"><span class="std std-ref">paddle::PoolLayer</span></a></p>
1618
<div class="breathe-sectiondef docutils container">
Y
Yu Yang 已提交
1619
<p class="breathe-sectiondef-title rubric">Public Functions</p>
1620 1621 1622 1623 1624
<dl class="function">
<dt id="_CPPv2N6paddle19PoolProjectionLayer19PoolProjectionLayerERK11LayerConfig">
<span id="paddle::PoolProjectionLayer::PoolProjectionLayer__LayerConfigCR"></span><span class="target" id="paddleclasspaddle_1_1PoolProjectionLayer_1af46e7f9cd3553967c6a3a64b1716a005"></span><code class="descname">PoolProjectionLayer</code><span class="sig-paren">(</span><em class="property">const</em> LayerConfig &amp;<em>config</em><span class="sig-paren">)</span><a class="headerlink" href="#_CPPv2N6paddle19PoolProjectionLayer19PoolProjectionLayerERK11LayerConfig" title="Permalink to this definition">¶</a></dt>
<dd></dd></dl>

Y
Yu Yang 已提交
1625 1626 1627 1628 1629 1630
<dl class="function">
<dt id="_CPPv2N6paddle19PoolProjectionLayer7getSizeEv">
<span id="paddle::PoolProjectionLayer::getSize"></span><span class="target" id="paddleclasspaddle_1_1PoolProjectionLayer_1ac306bb96802d0d0593880c5074cf5aaa"></span>size_t <code class="descname">getSize</code><span class="sig-paren">(</span><span class="sig-paren">)</span><a class="headerlink" href="#_CPPv2N6paddle19PoolProjectionLayer7getSizeEv" title="Permalink to this definition">¶</a></dt>
<dd></dd></dl>

<dl class="function">
1631 1632 1633 1634 1635 1636 1637 1638 1639 1640
<dt id="_CPPv2N6paddle19PoolProjectionLayer7forwardE8PassType">
<span id="paddle::PoolProjectionLayer::forward__PassType"></span><span class="target" id="paddleclasspaddle_1_1PoolProjectionLayer_1a99a71b042eed74988c355517c6e94f96"></span>void <code class="descname">forward</code><span class="sig-paren">(</span>PassType <em>passType</em><span class="sig-paren">)</span><a class="headerlink" href="#_CPPv2N6paddle19PoolProjectionLayer7forwardE8PassType" title="Permalink to this definition">¶</a></dt>
<dd><p>Forward propagation. All inherited implementation should call Layer::foward() function. </p>
</dd></dl>

<dl class="function">
<dt id="_CPPv2N6paddle19PoolProjectionLayer8backwardERK14UpdateCallback">
<span id="paddle::PoolProjectionLayer::backward__UpdateCallbackCR"></span><span class="target" id="paddleclasspaddle_1_1PoolProjectionLayer_1a393516f9f30850e06181682a3df9763d"></span>void <code class="descname">backward</code><span class="sig-paren">(</span><em class="property">const</em> <a class="reference internal" href="../../parameter/parameter/parameter.html#_CPPv2N6paddle14UpdateCallbackE" title="paddle::UpdateCallback">UpdateCallback</a> &amp;<em>callback</em> = nullptr<span class="sig-paren">)</span><a class="headerlink" href="#_CPPv2N6paddle19PoolProjectionLayer8backwardERK14UpdateCallback" title="Permalink to this definition">¶</a></dt>
<dd><p>Backward propagation. Should only be called after <a class="reference internal" href="#paddleclasspaddle_1_1Layer_1a12386b3f20dd731e7ceaa2c61667cbe1"><span class="std std-ref">Layer::forward()</span></a> function. </p>
</dd></dl>
Y
Yu Yang 已提交
1641 1642

</div>
1643
<div class="breathe-sectiondef docutils container">
Y
Yu Yang 已提交
1644 1645 1646 1647 1648 1649 1650 1651 1652 1653 1654 1655 1656 1657 1658 1659 1660 1661 1662 1663 1664
<p class="breathe-sectiondef-title rubric">Protected Attributes</p>
<dl class="member">
<dt id="_CPPv2N6paddle19PoolProjectionLayer9imgSizeH_E">
<span id="paddle::PoolProjectionLayer::imgSizeH___s"></span><span class="target" id="paddleclasspaddle_1_1PoolProjectionLayer_1a17021c1f996a09d557a5339efeaa5793"></span>size_t <code class="descname">imgSizeH_</code><a class="headerlink" href="#_CPPv2N6paddle19PoolProjectionLayer9imgSizeH_E" title="Permalink to this definition">¶</a></dt>
<dd></dd></dl>

<dl class="member">
<dt id="_CPPv2N6paddle19PoolProjectionLayer9imgSizeW_E">
<span id="paddle::PoolProjectionLayer::imgSizeW___s"></span><span class="target" id="paddleclasspaddle_1_1PoolProjectionLayer_1ae1b5fde48f09a89cb265104b7b701391"></span>size_t <code class="descname">imgSizeW_</code><a class="headerlink" href="#_CPPv2N6paddle19PoolProjectionLayer9imgSizeW_E" title="Permalink to this definition">¶</a></dt>
<dd></dd></dl>

<dl class="member">
<dt id="_CPPv2N6paddle19PoolProjectionLayer8outputH_E">
<span id="paddle::PoolProjectionLayer::outputH___s"></span><span class="target" id="paddleclasspaddle_1_1PoolProjectionLayer_1a3b0a5d7eff13f01bc3215dce6ad60a0c"></span>size_t <code class="descname">outputH_</code><a class="headerlink" href="#_CPPv2N6paddle19PoolProjectionLayer8outputH_E" title="Permalink to this definition">¶</a></dt>
<dd></dd></dl>

<dl class="member">
<dt id="_CPPv2N6paddle19PoolProjectionLayer8outputW_E">
<span id="paddle::PoolProjectionLayer::outputW___s"></span><span class="target" id="paddleclasspaddle_1_1PoolProjectionLayer_1a1632e7adfe9d71bc2478e29fd701140d"></span>size_t <code class="descname">outputW_</code><a class="headerlink" href="#_CPPv2N6paddle19PoolProjectionLayer8outputW_E" title="Permalink to this definition">¶</a></dt>
<dd></dd></dl>

1665 1666 1667 1668 1669 1670 1671 1672 1673 1674
<dl class="member">
<dt id="_CPPv2N6paddle19PoolProjectionLayer15poolProjection_E">
<span id="paddle::PoolProjectionLayer::poolProjection___std::unique_ptr:PoolProjection:"></span><span class="target" id="paddleclasspaddle_1_1PoolProjectionLayer_1ab50eafa70ac490d3bb69533c6c377f2d"></span>std::unique_ptr&lt;PoolProjection&gt; <code class="descname">poolProjection_</code><a class="headerlink" href="#_CPPv2N6paddle19PoolProjectionLayer15poolProjection_E" title="Permalink to this definition">¶</a></dt>
<dd></dd></dl>

<dl class="member">
<dt id="_CPPv2N6paddle19PoolProjectionLayer17projectionConfig_E">
<span id="paddle::PoolProjectionLayer::projectionConfig___ProjectionConfig"></span><span class="target" id="paddleclasspaddle_1_1PoolProjectionLayer_1af004ec42a1a61bb17a6244e571f28da0"></span>ProjectionConfig <code class="descname">projectionConfig_</code><a class="headerlink" href="#_CPPv2N6paddle19PoolProjectionLayer17projectionConfig_E" title="Permalink to this definition">¶</a></dt>
<dd></dd></dl>

Y
Yu Yang 已提交
1675 1676 1677 1678 1679 1680 1681 1682 1683
</div>
</dd></dl>

</div>
<div class="section" id="cudnnpoollayer">
<h2>CudnnPoolLayer<a class="headerlink" href="#cudnnpoollayer" title="Permalink to this headline">¶</a></h2>
<dl class="class">
<dt id="_CPPv2N6paddle14CudnnPoolLayerE">
<span id="paddle::CudnnPoolLayer"></span><span class="target" id="paddleclasspaddle_1_1CudnnPoolLayer"></span><em class="property">class </em><code class="descclassname">paddle::</code><code class="descname">CudnnPoolLayer</code><a class="headerlink" href="#_CPPv2N6paddle14CudnnPoolLayerE" title="Permalink to this definition">¶</a></dt>
1684
<dd><p><a class="reference internal" href="#paddleclasspaddle_1_1CudnnPoolLayer"><span class="std std-ref">CudnnPoolLayer</span></a> is subclass of <a class="reference internal" href="#paddleclasspaddle_1_1PoolLayer"><span class="std std-ref">PoolLayer</span></a>, which is implemented by cudnn api and only supports GPU. </p>
Y
Yu Yang 已提交
1685
<p>The config file api is img_pool_layer. </p>
1686
<p>Inherits from <a class="reference internal" href="#paddleclasspaddle_1_1PoolLayer"><span class="std std-ref">paddle::PoolLayer</span></a></p>
1687
<div class="breathe-sectiondef docutils container">
Y
Yu Yang 已提交
1688 1689 1690 1691 1692 1693 1694 1695 1696 1697 1698 1699 1700
<p class="breathe-sectiondef-title rubric">Public Functions</p>
<dl class="function">
<dt id="_CPPv2N6paddle14CudnnPoolLayer14CudnnPoolLayerERK11LayerConfig">
<span id="paddle::CudnnPoolLayer::CudnnPoolLayer__LayerConfigCR"></span><span class="target" id="paddleclasspaddle_1_1CudnnPoolLayer_1a9a6428f2818a6b81b3c684c080eef873"></span><code class="descname">CudnnPoolLayer</code><span class="sig-paren">(</span><em class="property">const</em> LayerConfig &amp;<em>config</em><span class="sig-paren">)</span><a class="headerlink" href="#_CPPv2N6paddle14CudnnPoolLayer14CudnnPoolLayerERK11LayerConfig" title="Permalink to this definition">¶</a></dt>
<dd></dd></dl>

<dl class="function">
<dt id="_CPPv2N6paddle14CudnnPoolLayerD0Ev">
<span id="paddle::CudnnPoolLayer::~CudnnPoolLayer"></span><span class="target" id="paddleclasspaddle_1_1CudnnPoolLayer_1a08166c02732c3a1264bb21f53b61699b"></span><code class="descname">~CudnnPoolLayer</code><span class="sig-paren">(</span><span class="sig-paren">)</span><a class="headerlink" href="#_CPPv2N6paddle14CudnnPoolLayerD0Ev" title="Permalink to this definition">¶</a></dt>
<dd></dd></dl>

<dl class="function">
<dt id="_CPPv2N6paddle14CudnnPoolLayer4initERK8LayerMapRK12ParameterMap">
1701
<span id="paddle::CudnnPoolLayer::init__LayerMapCR.ParameterMapCR"></span><span class="target" id="paddleclasspaddle_1_1CudnnPoolLayer_1af6aff9ec69cc2d0e176dd5ac7942ff84"></span>bool <code class="descname">init</code><span class="sig-paren">(</span><em class="property">const</em> LayerMap &amp;<em>layerMap</em>, <em class="property">const</em> <a class="reference internal" href="../../parameter/parameter/parameter.html#_CPPv2N6paddle12ParameterMapE" title="paddle::ParameterMap">ParameterMap</a> &amp;<em>parameterMap</em><span class="sig-paren">)</span><a class="headerlink" href="#_CPPv2N6paddle14CudnnPoolLayer4initERK8LayerMapRK12ParameterMap" title="Permalink to this definition">¶</a></dt>
Y
Yu Yang 已提交
1702 1703 1704 1705 1706 1707 1708 1709 1710 1711 1712
<dd><p>Intialization. For example, adding input layers from layerMap and parameterMap. </p>
</dd></dl>

<dl class="function">
<dt id="_CPPv2N6paddle14CudnnPoolLayer7reshapeEi">
<span id="paddle::CudnnPoolLayer::reshape__i"></span><span class="target" id="paddleclasspaddle_1_1CudnnPoolLayer_1ae7a012b45bfa54d4c03ecbee4ba57067"></span>void <code class="descname">reshape</code><span class="sig-paren">(</span>int <em>batchSize</em><span class="sig-paren">)</span><a class="headerlink" href="#_CPPv2N6paddle14CudnnPoolLayer7reshapeEi" title="Permalink to this definition">¶</a></dt>
<dd><p>Reshape input and output tensor descriptor. The batch size maybe change during training in last batch of each pass. So reshaping is needed. </p>
</dd></dl>

<dl class="function">
<dt id="_CPPv2N6paddle14CudnnPoolLayer7forwardE8PassType">
1713
<span id="paddle::CudnnPoolLayer::forward__PassType"></span><span class="target" id="paddleclasspaddle_1_1CudnnPoolLayer_1a38e20f0170b3be4a6c51b8e10c1ef8d0"></span>void <code class="descname">forward</code><span class="sig-paren">(</span>PassType <em>passType</em><span class="sig-paren">)</span><a class="headerlink" href="#_CPPv2N6paddle14CudnnPoolLayer7forwardE8PassType" title="Permalink to this definition">¶</a></dt>
Y
Yu Yang 已提交
1714 1715 1716 1717 1718
<dd><p>Forward propagation. All inherited implementation should call Layer::foward() function. </p>
</dd></dl>

<dl class="function">
<dt id="_CPPv2N6paddle14CudnnPoolLayer8backwardERK14UpdateCallback">
1719
<span id="paddle::CudnnPoolLayer::backward__UpdateCallbackCR"></span><span class="target" id="paddleclasspaddle_1_1CudnnPoolLayer_1affeb9d7a007856660977078c58a00b1a"></span>void <code class="descname">backward</code><span class="sig-paren">(</span><em class="property">const</em> <a class="reference internal" href="../../parameter/parameter/parameter.html#_CPPv2N6paddle14UpdateCallbackE" title="paddle::UpdateCallback">UpdateCallback</a> &amp;<em>callback</em> = nullptr<span class="sig-paren">)</span><a class="headerlink" href="#_CPPv2N6paddle14CudnnPoolLayer8backwardERK14UpdateCallback" title="Permalink to this definition">¶</a></dt>
1720
<dd><p>Backward propagation. Should only be called after <a class="reference internal" href="#paddleclasspaddle_1_1Layer_1a12386b3f20dd731e7ceaa2c61667cbe1"><span class="std std-ref">Layer::forward()</span></a> function. </p>
Y
Yu Yang 已提交
1721 1722 1723
</dd></dl>

</div>
1724
<div class="breathe-sectiondef docutils container">
Y
Yu Yang 已提交
1725 1726 1727 1728 1729 1730 1731
<p class="breathe-sectiondef-title rubric">Public Static Functions</p>
<dl class="function">
<dt id="_CPPv2N6paddle14CudnnPoolLayer9typeCheckERKNSt6stringEP17hl_pooling_mode_t">
<span id="paddle::CudnnPoolLayer::typeCheck__ssCR.hl_pooling_mode_tP"></span><span class="target" id="paddleclasspaddle_1_1CudnnPoolLayer_1a9cb284d7cc6f1cf26d670f4fa8d9c6ca"></span>bool <code class="descname">typeCheck</code><span class="sig-paren">(</span><em class="property">const</em> std::string &amp;<em>poolType</em>, <a class="reference internal" href="../../cuda/cuda/cuda.html#_CPPv217hl_pooling_mode_t" title="hl_pooling_mode_t">hl_pooling_mode_t</a> *<em>mode</em> = nullptr<span class="sig-paren">)</span><a class="headerlink" href="#_CPPv2N6paddle14CudnnPoolLayer9typeCheckERKNSt6stringEP17hl_pooling_mode_t" title="Permalink to this definition">¶</a></dt>
<dd></dd></dl>

</div>
1732
<div class="breathe-sectiondef docutils container">
Y
Yu Yang 已提交
1733 1734 1735 1736 1737 1738 1739 1740 1741 1742 1743 1744 1745 1746 1747 1748 1749 1750 1751 1752 1753 1754 1755 1756 1757 1758 1759 1760 1761 1762 1763 1764 1765 1766 1767 1768 1769 1770 1771 1772 1773 1774 1775 1776 1777 1778 1779 1780 1781 1782 1783 1784 1785 1786 1787 1788 1789 1790 1791 1792 1793 1794 1795 1796 1797 1798 1799 1800 1801 1802 1803 1804 1805 1806 1807 1808 1809 1810 1811 1812 1813 1814 1815 1816 1817 1818 1819
<p class="breathe-sectiondef-title rubric">Protected Attributes</p>
<dl class="member">
<dt id="_CPPv2N6paddle14CudnnPoolLayer12windowHeightE">
<span id="paddle::CudnnPoolLayer::windowHeight__i"></span><span class="target" id="paddleclasspaddle_1_1CudnnPoolLayer_1a78ac69a7dffb621ad913cfbd1697813b"></span>int <code class="descname">windowHeight</code><a class="headerlink" href="#_CPPv2N6paddle14CudnnPoolLayer12windowHeightE" title="Permalink to this definition">¶</a></dt>
<dd></dd></dl>

<dl class="member">
<dt id="_CPPv2N6paddle14CudnnPoolLayer11windowWidthE">
<span id="paddle::CudnnPoolLayer::windowWidth__i"></span><span class="target" id="paddleclasspaddle_1_1CudnnPoolLayer_1a708157ba91e51ad2ba6543375fa54b53"></span>int <code class="descname">windowWidth</code><a class="headerlink" href="#_CPPv2N6paddle14CudnnPoolLayer11windowWidthE" title="Permalink to this definition">¶</a></dt>
<dd></dd></dl>

<dl class="member">
<dt id="_CPPv2N6paddle14CudnnPoolLayer13heightPaddingE">
<span id="paddle::CudnnPoolLayer::heightPadding__i"></span><span class="target" id="paddleclasspaddle_1_1CudnnPoolLayer_1a0235cbc3812ca494d90d61698cf8d284"></span>int <code class="descname">heightPadding</code><a class="headerlink" href="#_CPPv2N6paddle14CudnnPoolLayer13heightPaddingE" title="Permalink to this definition">¶</a></dt>
<dd></dd></dl>

<dl class="member">
<dt id="_CPPv2N6paddle14CudnnPoolLayer12widthPaddingE">
<span id="paddle::CudnnPoolLayer::widthPadding__i"></span><span class="target" id="paddleclasspaddle_1_1CudnnPoolLayer_1a46f1de94d3b376f6407ae464a09b6d53"></span>int <code class="descname">widthPadding</code><a class="headerlink" href="#_CPPv2N6paddle14CudnnPoolLayer12widthPaddingE" title="Permalink to this definition">¶</a></dt>
<dd></dd></dl>

<dl class="member">
<dt id="_CPPv2N6paddle14CudnnPoolLayer12strideHeightE">
<span id="paddle::CudnnPoolLayer::strideHeight__i"></span><span class="target" id="paddleclasspaddle_1_1CudnnPoolLayer_1a27fbdabf4c2f07fc65e9f8b029587bf6"></span>int <code class="descname">strideHeight</code><a class="headerlink" href="#_CPPv2N6paddle14CudnnPoolLayer12strideHeightE" title="Permalink to this definition">¶</a></dt>
<dd></dd></dl>

<dl class="member">
<dt id="_CPPv2N6paddle14CudnnPoolLayer11strideWidthE">
<span id="paddle::CudnnPoolLayer::strideWidth__i"></span><span class="target" id="paddleclasspaddle_1_1CudnnPoolLayer_1a4405ea2b98e926cb6f27d211918a3692"></span>int <code class="descname">strideWidth</code><a class="headerlink" href="#_CPPv2N6paddle14CudnnPoolLayer11strideWidthE" title="Permalink to this definition">¶</a></dt>
<dd></dd></dl>

<dl class="member">
<dt id="_CPPv2N6paddle14CudnnPoolLayer7imageH_E">
<span id="paddle::CudnnPoolLayer::imageH___i"></span><span class="target" id="paddleclasspaddle_1_1CudnnPoolLayer_1a96a3a7fd3ed851d96a0fffb6f0409c21"></span>int <code class="descname">imageH_</code><a class="headerlink" href="#_CPPv2N6paddle14CudnnPoolLayer7imageH_E" title="Permalink to this definition">¶</a></dt>
<dd></dd></dl>

<dl class="member">
<dt id="_CPPv2N6paddle14CudnnPoolLayer7imageW_E">
<span id="paddle::CudnnPoolLayer::imageW___i"></span><span class="target" id="paddleclasspaddle_1_1CudnnPoolLayer_1a99dc2b3c45b732e08f7fb4c20f66d632"></span>int <code class="descname">imageW_</code><a class="headerlink" href="#_CPPv2N6paddle14CudnnPoolLayer7imageW_E" title="Permalink to this definition">¶</a></dt>
<dd></dd></dl>

<dl class="member">
<dt id="_CPPv2N6paddle14CudnnPoolLayer8outputH_E">
<span id="paddle::CudnnPoolLayer::outputH___i"></span><span class="target" id="paddleclasspaddle_1_1CudnnPoolLayer_1aebfb6275eb493e6e85f6be785ab53196"></span>int <code class="descname">outputH_</code><a class="headerlink" href="#_CPPv2N6paddle14CudnnPoolLayer8outputH_E" title="Permalink to this definition">¶</a></dt>
<dd></dd></dl>

<dl class="member">
<dt id="_CPPv2N6paddle14CudnnPoolLayer8outputW_E">
<span id="paddle::CudnnPoolLayer::outputW___i"></span><span class="target" id="paddleclasspaddle_1_1CudnnPoolLayer_1a47dcb10eebad67cb13d6f9e2d10d73e5"></span>int <code class="descname">outputW_</code><a class="headerlink" href="#_CPPv2N6paddle14CudnnPoolLayer8outputW_E" title="Permalink to this definition">¶</a></dt>
<dd></dd></dl>

<dl class="member">
<dt id="_CPPv2N6paddle14CudnnPoolLayer5mode_E">
<span id="paddle::CudnnPoolLayer::mode___hl_pooling_mode_t"></span><span class="target" id="paddleclasspaddle_1_1CudnnPoolLayer_1a6c4ddcf77f9aa2eb39f1c0cd972f3da7"></span><a class="reference internal" href="../../cuda/cuda/cuda.html#_CPPv217hl_pooling_mode_t" title="hl_pooling_mode_t">hl_pooling_mode_t</a> <code class="descname">mode_</code><a class="headerlink" href="#_CPPv2N6paddle14CudnnPoolLayer5mode_E" title="Permalink to this definition">¶</a></dt>
<dd><p>mode_ is poolint type, inlcuding &#8220;cudnn-max-pool&#8221;, &#8220;cudnn-avg-pool&#8221; &#8220;cudnn-avg-excl-pad-pool&#8221;. </p>
</dd></dl>

<dl class="member">
<dt id="_CPPv2N6paddle14CudnnPoolLayer10inputDesc_E">
<span id="paddle::CudnnPoolLayer::inputDesc___hl_tensor_descriptor"></span><span class="target" id="paddleclasspaddle_1_1CudnnPoolLayer_1afc9d2cb10982c9e3fd2a16c83c8748c8"></span><a class="reference internal" href="../../cuda/cuda/cuda.html#_CPPv220hl_tensor_descriptor" title="hl_tensor_descriptor">hl_tensor_descriptor</a> <code class="descname">inputDesc_</code><a class="headerlink" href="#_CPPv2N6paddle14CudnnPoolLayer10inputDesc_E" title="Permalink to this definition">¶</a></dt>
<dd><p>cudnn tensor descriptor for input. </p>
</dd></dl>

<dl class="member">
<dt id="_CPPv2N6paddle14CudnnPoolLayer11outputDesc_E">
<span id="paddle::CudnnPoolLayer::outputDesc___hl_tensor_descriptor"></span><span class="target" id="paddleclasspaddle_1_1CudnnPoolLayer_1a4f1892d83ebe3a6203957735bae69f72"></span><a class="reference internal" href="../../cuda/cuda/cuda.html#_CPPv220hl_tensor_descriptor" title="hl_tensor_descriptor">hl_tensor_descriptor</a> <code class="descname">outputDesc_</code><a class="headerlink" href="#_CPPv2N6paddle14CudnnPoolLayer11outputDesc_E" title="Permalink to this definition">¶</a></dt>
<dd><p>cudnn tensor descriptor for output. </p>
</dd></dl>

<dl class="member">
<dt id="_CPPv2N6paddle14CudnnPoolLayer12poolingDesc_E">
<span id="paddle::CudnnPoolLayer::poolingDesc___hl_pooling_descriptor"></span><span class="target" id="paddleclasspaddle_1_1CudnnPoolLayer_1a72771ddd292a4670436c9b2d1cbef102"></span><a class="reference internal" href="../../cuda/cuda/cuda.html#_CPPv221hl_pooling_descriptor" title="hl_pooling_descriptor">hl_pooling_descriptor</a> <code class="descname">poolingDesc_</code><a class="headerlink" href="#_CPPv2N6paddle14CudnnPoolLayer12poolingDesc_E" title="Permalink to this definition">¶</a></dt>
<dd><p>A description of a pooling operation. </p>
</dd></dl>

</div>
</dd></dl>

</div>
</div>
<div class="section" id="norm-layers">
<h1>Norm Layers<a class="headerlink" href="#norm-layers" title="Permalink to this headline">¶</a></h1>
<div class="section" id="normlayer">
<h2>NormLayer<a class="headerlink" href="#normlayer" title="Permalink to this headline">¶</a></h2>
<dl class="class">
<dt id="_CPPv2N6paddle9NormLayerE">
<span id="paddle::NormLayer"></span><span class="target" id="paddleclasspaddle_1_1NormLayer"></span><em class="property">class </em><code class="descclassname">paddle::</code><code class="descname">NormLayer</code><a class="headerlink" href="#_CPPv2N6paddle9NormLayerE" title="Permalink to this definition">¶</a></dt>
Y
Yu Yang 已提交
1820 1821 1822 1823 1824 1825
<dd><p>Basic parent layer of normalization. </p>
<p><dl class="docutils">
<dt><strong>Note</strong></dt>
<dd>Normalize the input in local region </dd>
</dl>
</p>
1826 1827
<p>Inherits from <a class="reference internal" href="#paddleclasspaddle_1_1Layer"><span class="std std-ref">paddle::Layer</span></a></p>
<p>Subclassed by <a class="reference internal" href="#paddleclasspaddle_1_1ResponseNormLayer"><span class="std std-ref">paddle::ResponseNormLayer</span></a></p>
1828
<div class="breathe-sectiondef docutils container">
Y
Yu Yang 已提交
1829 1830 1831 1832 1833 1834 1835 1836
<p class="breathe-sectiondef-title rubric">Public Functions</p>
<dl class="function">
<dt id="_CPPv2N6paddle9NormLayer9NormLayerERK11LayerConfig">
<span id="paddle::NormLayer::NormLayer__LayerConfigCR"></span><span class="target" id="paddleclasspaddle_1_1NormLayer_1a4e885116a77dc19e8d395113eb3e3911"></span><code class="descname">NormLayer</code><span class="sig-paren">(</span><em class="property">const</em> LayerConfig &amp;<em>config</em><span class="sig-paren">)</span><a class="headerlink" href="#_CPPv2N6paddle9NormLayer9NormLayerERK11LayerConfig" title="Permalink to this definition">¶</a></dt>
<dd></dd></dl>

<dl class="function">
<dt id="_CPPv2N6paddle9NormLayer4initERK8LayerMapRK12ParameterMap">
1837
<span id="paddle::NormLayer::init__LayerMapCR.ParameterMapCR"></span><span class="target" id="paddleclasspaddle_1_1NormLayer_1a025d26036f9e2d1f33e59609ecf8b065"></span>bool <code class="descname">init</code><span class="sig-paren">(</span><em class="property">const</em> LayerMap &amp;<em>layerMap</em>, <em class="property">const</em> <a class="reference internal" href="../../parameter/parameter/parameter.html#_CPPv2N6paddle12ParameterMapE" title="paddle::ParameterMap">ParameterMap</a> &amp;<em>parameterMap</em><span class="sig-paren">)</span><a class="headerlink" href="#_CPPv2N6paddle9NormLayer4initERK8LayerMapRK12ParameterMap" title="Permalink to this definition">¶</a></dt>
Y
Yu Yang 已提交
1838 1839 1840 1841
<dd><p>Intialization. For example, adding input layers from layerMap and parameterMap. </p>
</dd></dl>

</div>
1842
<div class="breathe-sectiondef docutils container">
Y
Yu Yang 已提交
1843 1844 1845 1846
<p class="breathe-sectiondef-title rubric">Public Static Functions</p>
<dl class="function">
<dt id="_CPPv2N6paddle9NormLayer6createERK11LayerConfig">
<span id="paddle::NormLayer::create__LayerConfigCR"></span><span class="target" id="paddleclasspaddle_1_1NormLayer_1a9f2c69926802b77b0ffa66d2c076210e"></span><a class="reference internal" href="#_CPPv2N6paddle5LayerE" title="paddle::Layer">Layer</a> *<code class="descname">create</code><span class="sig-paren">(</span><em class="property">const</em> LayerConfig &amp;<em>config</em><span class="sig-paren">)</span><a class="headerlink" href="#_CPPv2N6paddle9NormLayer6createERK11LayerConfig" title="Permalink to this definition">¶</a></dt>
Y
Yu Yang 已提交
1847 1848
<dd><p>create norm layer by norm_type </p>
</dd></dl>
Y
Yu Yang 已提交
1849 1850 1851 1852 1853 1854 1855 1856 1857 1858 1859

</div>
</dd></dl>

</div>
<div class="section" id="cmrprojectionnormlayer">
<h2>CMRProjectionNormLayer<a class="headerlink" href="#cmrprojectionnormlayer" title="Permalink to this headline">¶</a></h2>
<dl class="class">
<dt id="_CPPv2N6paddle22CMRProjectionNormLayerE">
<span id="paddle::CMRProjectionNormLayer"></span><span class="target" id="paddleclasspaddle_1_1CMRProjectionNormLayer"></span><em class="property">class </em><code class="descclassname">paddle::</code><code class="descname">CMRProjectionNormLayer</code><a class="headerlink" href="#_CPPv2N6paddle22CMRProjectionNormLayerE" title="Permalink to this definition">¶</a></dt>
<dd><p>response normalization across feature maps namely normalize in number of size_ channels </p>
1860
<p>Inherits from <a class="reference internal" href="#paddleclasspaddle_1_1ResponseNormLayer"><span class="std std-ref">paddle::ResponseNormLayer</span></a></p>
1861
<div class="breathe-sectiondef docutils container">
Y
Yu Yang 已提交
1862 1863 1864 1865 1866 1867 1868 1869 1870 1871 1872 1873 1874 1875 1876 1877 1878 1879
<p class="breathe-sectiondef-title rubric">Public Functions</p>
<dl class="function">
<dt id="_CPPv2N6paddle22CMRProjectionNormLayer22CMRProjectionNormLayerERK11LayerConfig">
<span id="paddle::CMRProjectionNormLayer::CMRProjectionNormLayer__LayerConfigCR"></span><span class="target" id="paddleclasspaddle_1_1CMRProjectionNormLayer_1a625bbf7c72344945d9c03e13a64c1789"></span><code class="descname">CMRProjectionNormLayer</code><span class="sig-paren">(</span><em class="property">const</em> LayerConfig &amp;<em>config</em><span class="sig-paren">)</span><a class="headerlink" href="#_CPPv2N6paddle22CMRProjectionNormLayer22CMRProjectionNormLayerERK11LayerConfig" title="Permalink to this definition">¶</a></dt>
<dd></dd></dl>

<dl class="function">
<dt id="_CPPv2N6paddle22CMRProjectionNormLayerD0Ev">
<span id="paddle::CMRProjectionNormLayer::~CMRProjectionNormLayer"></span><span class="target" id="paddleclasspaddle_1_1CMRProjectionNormLayer_1a6b37bb539fa1770dcc66100a1f075a86"></span><code class="descname">~CMRProjectionNormLayer</code><span class="sig-paren">(</span><span class="sig-paren">)</span><a class="headerlink" href="#_CPPv2N6paddle22CMRProjectionNormLayerD0Ev" title="Permalink to this definition">¶</a></dt>
<dd></dd></dl>

<dl class="function">
<dt id="_CPPv2N6paddle22CMRProjectionNormLayer7getSizeEv">
<span id="paddle::CMRProjectionNormLayer::getSize"></span><span class="target" id="paddleclasspaddle_1_1CMRProjectionNormLayer_1aa8d61e88bae094ee2e35560878963d59"></span>size_t <code class="descname">getSize</code><span class="sig-paren">(</span><span class="sig-paren">)</span><a class="headerlink" href="#_CPPv2N6paddle22CMRProjectionNormLayer7getSizeEv" title="Permalink to this definition">¶</a></dt>
<dd></dd></dl>

<dl class="function">
<dt id="_CPPv2N6paddle22CMRProjectionNormLayer4initERK8LayerMapRK12ParameterMap">
1880
<span id="paddle::CMRProjectionNormLayer::init__LayerMapCR.ParameterMapCR"></span><span class="target" id="paddleclasspaddle_1_1CMRProjectionNormLayer_1a3a38af8ae7aeb4ff42033025ac6bf0c8"></span>bool <code class="descname">init</code><span class="sig-paren">(</span><em class="property">const</em> LayerMap &amp;<em>layerMap</em>, <em class="property">const</em> <a class="reference internal" href="../../parameter/parameter/parameter.html#_CPPv2N6paddle12ParameterMapE" title="paddle::ParameterMap">ParameterMap</a> &amp;<em>parameterMap</em><span class="sig-paren">)</span><a class="headerlink" href="#_CPPv2N6paddle22CMRProjectionNormLayer4initERK8LayerMapRK12ParameterMap" title="Permalink to this definition">¶</a></dt>
Y
Yu Yang 已提交
1881 1882 1883 1884 1885
<dd><p>Intialization. For example, adding input layers from layerMap and parameterMap. </p>
</dd></dl>

<dl class="function">
<dt id="_CPPv2N6paddle22CMRProjectionNormLayer7forwardE8PassType">
1886
<span id="paddle::CMRProjectionNormLayer::forward__PassType"></span><span class="target" id="paddleclasspaddle_1_1CMRProjectionNormLayer_1a6ea79cd51a852723bce9b06442108f6b"></span>void <code class="descname">forward</code><span class="sig-paren">(</span>PassType <em>passType</em><span class="sig-paren">)</span><a class="headerlink" href="#_CPPv2N6paddle22CMRProjectionNormLayer7forwardE8PassType" title="Permalink to this definition">¶</a></dt>
Y
Yu Yang 已提交
1887 1888 1889 1890 1891
<dd><p>Forward propagation. All inherited implementation should call Layer::foward() function. </p>
</dd></dl>

<dl class="function">
<dt id="_CPPv2N6paddle22CMRProjectionNormLayer8backwardERK14UpdateCallback">
1892
<span id="paddle::CMRProjectionNormLayer::backward__UpdateCallbackCR"></span><span class="target" id="paddleclasspaddle_1_1CMRProjectionNormLayer_1a8b9e55ca5ae723e98eeac4eea8af34ba"></span>void <code class="descname">backward</code><span class="sig-paren">(</span><em class="property">const</em> <a class="reference internal" href="../../parameter/parameter/parameter.html#_CPPv2N6paddle14UpdateCallbackE" title="paddle::UpdateCallback">UpdateCallback</a> &amp;<em>callback</em> = nullptr<span class="sig-paren">)</span><a class="headerlink" href="#_CPPv2N6paddle22CMRProjectionNormLayer8backwardERK14UpdateCallback" title="Permalink to this definition">¶</a></dt>
1893
<dd><p>Backward propagation. Should only be called after <a class="reference internal" href="#paddleclasspaddle_1_1Layer_1a12386b3f20dd731e7ceaa2c61667cbe1"><span class="std std-ref">Layer::forward()</span></a> function. </p>
Y
Yu Yang 已提交
1894 1895 1896 1897 1898 1899 1900 1901 1902 1903 1904
</dd></dl>

</div>
</dd></dl>

</div>
<div class="section" id="datanormlayer">
<h2>DataNormLayer<a class="headerlink" href="#datanormlayer" title="Permalink to this headline">¶</a></h2>
<dl class="class">
<dt id="_CPPv2N6paddle13DataNormLayerE">
<span id="paddle::DataNormLayer"></span><span class="target" id="paddleclasspaddle_1_1DataNormLayer"></span><em class="property">class </em><code class="descclassname">paddle::</code><code class="descname">DataNormLayer</code><a class="headerlink" href="#_CPPv2N6paddle13DataNormLayerE" title="Permalink to this definition">¶</a></dt>
Y
Yu Yang 已提交
1905 1906
<dd><p>A layer for data normalization. </p>
<p><ul class="simple">
1907
<li>Input: One and only one input layer is accepted. The input layer must be <a class="reference internal" href="#paddleclasspaddle_1_1DataLayer"><span class="std std-ref">DataLayer</span></a> with dense data type.</li>
Y
Yu Yang 已提交
1908 1909 1910
<li>Output: The normalization of the input data</li>
</ul>
</p>
Y
Yu Yang 已提交
1911
<p>Reference: LA Shalabi, Z Shaaban, B Kasasbeh. Data mining: A preprocessing engine</p>
Y
Yu Yang 已提交
1912 1913 1914 1915 1916 1917
<p>Three data normalization methoeds are considered<ul class="simple">
<li>z-score: y = (x-mean)/std</li>
<li>min-max: y = (x-min)/(max-min)</li>
<li>decimal-scaling: y = x/10^j, where j is the smallest integer such that max(|y|)&lt;1 </li>
</ul>
</p>
1918
<p>Inherits from <a class="reference internal" href="#paddleclasspaddle_1_1Layer"><span class="std std-ref">paddle::Layer</span></a></p>
1919
<div class="breathe-sectiondef docutils container">
Y
Yu Yang 已提交
1920 1921 1922 1923 1924 1925 1926 1927 1928 1929 1930 1931 1932 1933 1934 1935 1936 1937 1938 1939 1940 1941 1942
<p class="breathe-sectiondef-title rubric">Public Types</p>
<dl class="type">
<dt id="_CPPv2N6paddle13DataNormLayer21NormalizationStrategyE">
<span id="paddle::DataNormLayer::NormalizationStrategy"></span><span class="target" id="paddleclasspaddle_1_1DataNormLayer_1ab121c7bcab217a1752c04be07868de01"></span><em class="property">enum </em><code class="descname">NormalizationStrategy</code><a class="headerlink" href="#_CPPv2N6paddle13DataNormLayer21NormalizationStrategyE" title="Permalink to this definition">¶</a></dt>
<dd><p><em>Values:</em></p>
<dl class="member">
<dt id="_CPPv2N6paddle13DataNormLayer7kZScoreE">
<span id="paddle::DataNormLayer::kZScore"></span><span class="target" id="paddleclasspaddle_1_1DataNormLayer_1ab121c7bcab217a1752c04be07868de01abb75d9472ac61829e3cae5fcc1c0110c"></span><code class="descname">kZScore</code> = 0<a class="headerlink" href="#_CPPv2N6paddle13DataNormLayer7kZScoreE" title="Permalink to this definition">¶</a></dt>
<dd></dd></dl>

<dl class="member">
<dt id="_CPPv2N6paddle13DataNormLayer7kMinMaxE">
<span id="paddle::DataNormLayer::kMinMax"></span><span class="target" id="paddleclasspaddle_1_1DataNormLayer_1ab121c7bcab217a1752c04be07868de01a93526d48241a9a59bbdba8f37fabfd81"></span><code class="descname">kMinMax</code> = 1<a class="headerlink" href="#_CPPv2N6paddle13DataNormLayer7kMinMaxE" title="Permalink to this definition">¶</a></dt>
<dd></dd></dl>

<dl class="member">
<dt id="_CPPv2N6paddle13DataNormLayer15kDecimalScalingE">
<span id="paddle::DataNormLayer::kDecimalScaling"></span><span class="target" id="paddleclasspaddle_1_1DataNormLayer_1ab121c7bcab217a1752c04be07868de01ae52892db2a3d579bec5ba6ea49800fea"></span><code class="descname">kDecimalScaling</code> = 2<a class="headerlink" href="#_CPPv2N6paddle13DataNormLayer15kDecimalScalingE" title="Permalink to this definition">¶</a></dt>
<dd></dd></dl>

</dd></dl>

</div>
1943
<div class="breathe-sectiondef docutils container">
Y
Yu Yang 已提交
1944 1945 1946 1947 1948 1949 1950 1951 1952 1953 1954 1955 1956
<p class="breathe-sectiondef-title rubric">Public Functions</p>
<dl class="function">
<dt id="_CPPv2N6paddle13DataNormLayer13DataNormLayerERK11LayerConfig">
<span id="paddle::DataNormLayer::DataNormLayer__LayerConfigCR"></span><span class="target" id="paddleclasspaddle_1_1DataNormLayer_1a624abef89a478b482210cda76f784c5d"></span><code class="descname">DataNormLayer</code><span class="sig-paren">(</span><em class="property">const</em> LayerConfig &amp;<em>config</em><span class="sig-paren">)</span><a class="headerlink" href="#_CPPv2N6paddle13DataNormLayer13DataNormLayerERK11LayerConfig" title="Permalink to this definition">¶</a></dt>
<dd></dd></dl>

<dl class="function">
<dt id="_CPPv2N6paddle13DataNormLayerD0Ev">
<span id="paddle::DataNormLayer::~DataNormLayer"></span><span class="target" id="paddleclasspaddle_1_1DataNormLayer_1ae82492ea406a21e939b687311cb27ddd"></span><code class="descname">~DataNormLayer</code><span class="sig-paren">(</span><span class="sig-paren">)</span><a class="headerlink" href="#_CPPv2N6paddle13DataNormLayerD0Ev" title="Permalink to this definition">¶</a></dt>
<dd></dd></dl>

<dl class="function">
<dt id="_CPPv2N6paddle13DataNormLayer4initERK8LayerMapRK12ParameterMap">
1957
<span id="paddle::DataNormLayer::init__LayerMapCR.ParameterMapCR"></span><span class="target" id="paddleclasspaddle_1_1DataNormLayer_1a2914e9d137538fed1ac55ffa6f091509"></span>bool <code class="descname">init</code><span class="sig-paren">(</span><em class="property">const</em> LayerMap &amp;<em>layerMap</em>, <em class="property">const</em> <a class="reference internal" href="../../parameter/parameter/parameter.html#_CPPv2N6paddle12ParameterMapE" title="paddle::ParameterMap">ParameterMap</a> &amp;<em>parameterMap</em><span class="sig-paren">)</span><a class="headerlink" href="#_CPPv2N6paddle13DataNormLayer4initERK8LayerMapRK12ParameterMap" title="Permalink to this definition">¶</a></dt>
Y
Yu Yang 已提交
1958 1959 1960 1961 1962
<dd><p>Intialization. For example, adding input layers from layerMap and parameterMap. </p>
</dd></dl>

<dl class="function">
<dt id="_CPPv2N6paddle13DataNormLayer7forwardE8PassType">
1963
<span id="paddle::DataNormLayer::forward__PassType"></span><span class="target" id="paddleclasspaddle_1_1DataNormLayer_1aa2fdfc0a29fe2915db6f6eac4ebd30ed"></span>void <code class="descname">forward</code><span class="sig-paren">(</span>PassType <em>passType</em><span class="sig-paren">)</span><a class="headerlink" href="#_CPPv2N6paddle13DataNormLayer7forwardE8PassType" title="Permalink to this definition">¶</a></dt>
Y
Yu Yang 已提交
1964 1965 1966 1967 1968
<dd><p>Forward propagation. All inherited implementation should call Layer::foward() function. </p>
</dd></dl>

<dl class="function">
<dt id="_CPPv2N6paddle13DataNormLayer8backwardERK14UpdateCallback">
1969
<span id="paddle::DataNormLayer::backward__UpdateCallbackCR"></span><span class="target" id="paddleclasspaddle_1_1DataNormLayer_1ad35b356e2f9f73f02ae4dd3133d5a988"></span>void <code class="descname">backward</code><span class="sig-paren">(</span><em class="property">const</em> <a class="reference internal" href="../../parameter/parameter/parameter.html#_CPPv2N6paddle14UpdateCallbackE" title="paddle::UpdateCallback">UpdateCallback</a> &amp;<em>callback</em> = nullptr<span class="sig-paren">)</span><a class="headerlink" href="#_CPPv2N6paddle13DataNormLayer8backwardERK14UpdateCallback" title="Permalink to this definition">¶</a></dt>
1970
<dd><p>Backward propagation. Should only be called after <a class="reference internal" href="#paddleclasspaddle_1_1Layer_1a12386b3f20dd731e7ceaa2c61667cbe1"><span class="std std-ref">Layer::forward()</span></a> function. </p>
Y
Yu Yang 已提交
1971 1972 1973
</dd></dl>

</div>
1974
<div class="breathe-sectiondef docutils container">
Y
Yu Yang 已提交
1975 1976 1977 1978 1979 1980 1981 1982 1983 1984 1985 1986 1987 1988 1989 1990 1991 1992 1993 1994 1995 1996 1997 1998 1999 2000 2001 2002 2003 2004 2005 2006 2007 2008 2009 2010 2011 2012 2013 2014 2015 2016 2017 2018 2019 2020
<p class="breathe-sectiondef-title rubric">Protected Attributes</p>
<dl class="member">
<dt id="_CPPv2N6paddle13DataNormLayer5mode_E">
<span id="paddle::DataNormLayer::mode___i"></span><span class="target" id="paddleclasspaddle_1_1DataNormLayer_1a3365969ca156c0ab1f9878cf626b9c4a"></span>int <code class="descname">mode_</code><a class="headerlink" href="#_CPPv2N6paddle13DataNormLayer5mode_E" title="Permalink to this definition">¶</a></dt>
<dd></dd></dl>

<dl class="member">
<dt id="_CPPv2N6paddle13DataNormLayer7weight_E">
<span id="paddle::DataNormLayer::weight___std::unique_ptr:Weight:"></span><span class="target" id="paddleclasspaddle_1_1DataNormLayer_1a4aaf965175948e20183cd57f29960b65"></span>std::unique_ptr&lt;<a class="reference internal" href="../../parameter/parameter/parameter.html#_CPPv2N6paddle6WeightE" title="paddle::Weight">Weight</a>&gt; <code class="descname">weight_</code><a class="headerlink" href="#_CPPv2N6paddle13DataNormLayer7weight_E" title="Permalink to this definition">¶</a></dt>
<dd></dd></dl>

<dl class="member">
<dt id="_CPPv2N6paddle13DataNormLayer4min_E">
<span id="paddle::DataNormLayer::min___MatrixPtr"></span><span class="target" id="paddleclasspaddle_1_1DataNormLayer_1af31f85c2e566211fa6709af26b538c62"></span><a class="reference internal" href="../../math/matrix/matrix.html#_CPPv2N6paddle9MatrixPtrE" title="paddle::MatrixPtr">MatrixPtr</a> <code class="descname">min_</code><a class="headerlink" href="#_CPPv2N6paddle13DataNormLayer4min_E" title="Permalink to this definition">¶</a></dt>
<dd></dd></dl>

<dl class="member">
<dt id="_CPPv2N6paddle13DataNormLayer16rangeReciprocal_E">
<span id="paddle::DataNormLayer::rangeReciprocal___MatrixPtr"></span><span class="target" id="paddleclasspaddle_1_1DataNormLayer_1a93118c1db842c2651ff3275d86b55a5a"></span><a class="reference internal" href="../../math/matrix/matrix.html#_CPPv2N6paddle9MatrixPtrE" title="paddle::MatrixPtr">MatrixPtr</a> <code class="descname">rangeReciprocal_</code><a class="headerlink" href="#_CPPv2N6paddle13DataNormLayer16rangeReciprocal_E" title="Permalink to this definition">¶</a></dt>
<dd></dd></dl>

<dl class="member">
<dt id="_CPPv2N6paddle13DataNormLayer5mean_E">
<span id="paddle::DataNormLayer::mean___MatrixPtr"></span><span class="target" id="paddleclasspaddle_1_1DataNormLayer_1a6571364ab0a6408010bf33749f7b8fee"></span><a class="reference internal" href="../../math/matrix/matrix.html#_CPPv2N6paddle9MatrixPtrE" title="paddle::MatrixPtr">MatrixPtr</a> <code class="descname">mean_</code><a class="headerlink" href="#_CPPv2N6paddle13DataNormLayer5mean_E" title="Permalink to this definition">¶</a></dt>
<dd></dd></dl>

<dl class="member">
<dt id="_CPPv2N6paddle13DataNormLayer14stdReciprocal_E">
<span id="paddle::DataNormLayer::stdReciprocal___MatrixPtr"></span><span class="target" id="paddleclasspaddle_1_1DataNormLayer_1a6c4abdf413037a9f8030f1d4fcd7bced"></span><a class="reference internal" href="../../math/matrix/matrix.html#_CPPv2N6paddle9MatrixPtrE" title="paddle::MatrixPtr">MatrixPtr</a> <code class="descname">stdReciprocal_</code><a class="headerlink" href="#_CPPv2N6paddle13DataNormLayer14stdReciprocal_E" title="Permalink to this definition">¶</a></dt>
<dd></dd></dl>

<dl class="member">
<dt id="_CPPv2N6paddle13DataNormLayer18decimalReciprocal_E">
<span id="paddle::DataNormLayer::decimalReciprocal___MatrixPtr"></span><span class="target" id="paddleclasspaddle_1_1DataNormLayer_1acbfe9aebcc49dbca6de0be1b76ae9d94"></span><a class="reference internal" href="../../math/matrix/matrix.html#_CPPv2N6paddle9MatrixPtrE" title="paddle::MatrixPtr">MatrixPtr</a> <code class="descname">decimalReciprocal_</code><a class="headerlink" href="#_CPPv2N6paddle13DataNormLayer18decimalReciprocal_E" title="Permalink to this definition">¶</a></dt>
<dd></dd></dl>

</div>
</dd></dl>

</div>
<div class="section" id="responsenormlayer">
<h2>ResponseNormLayer<a class="headerlink" href="#responsenormlayer" title="Permalink to this headline">¶</a></h2>
<dl class="class">
<dt id="_CPPv2N6paddle17ResponseNormLayerE">
<span id="paddle::ResponseNormLayer"></span><span class="target" id="paddleclasspaddle_1_1ResponseNormLayer"></span><em class="property">class </em><code class="descclassname">paddle::</code><code class="descname">ResponseNormLayer</code><a class="headerlink" href="#_CPPv2N6paddle17ResponseNormLayerE" title="Permalink to this definition">¶</a></dt>
<dd><p>response normalization within feature maps namely normalize in independent channel When code refactoring, we delete the original implementation. Need to implement in the futrue. </p>
2021 2022
<p>Inherits from <a class="reference internal" href="#paddleclasspaddle_1_1NormLayer"><span class="std std-ref">paddle::NormLayer</span></a></p>
<p>Subclassed by <a class="reference internal" href="#paddleclasspaddle_1_1CMRProjectionNormLayer"><span class="std std-ref">paddle::CMRProjectionNormLayer</span></a></p>
2023
<div class="breathe-sectiondef docutils container">
Y
Yu Yang 已提交
2024 2025 2026 2027 2028 2029 2030 2031
<p class="breathe-sectiondef-title rubric">Public Functions</p>
<dl class="function">
<dt id="_CPPv2N6paddle17ResponseNormLayer17ResponseNormLayerERK11LayerConfig">
<span id="paddle::ResponseNormLayer::ResponseNormLayer__LayerConfigCR"></span><span class="target" id="paddleclasspaddle_1_1ResponseNormLayer_1abd7ce981b0ac81ba7a5f1d8a2352e86d"></span><code class="descname">ResponseNormLayer</code><span class="sig-paren">(</span><em class="property">const</em> LayerConfig &amp;<em>config</em><span class="sig-paren">)</span><a class="headerlink" href="#_CPPv2N6paddle17ResponseNormLayer17ResponseNormLayerERK11LayerConfig" title="Permalink to this definition">¶</a></dt>
<dd></dd></dl>

<dl class="function">
<dt id="_CPPv2N6paddle17ResponseNormLayer4initERK8LayerMapRK12ParameterMap">
2032
<span id="paddle::ResponseNormLayer::init__LayerMapCR.ParameterMapCR"></span><span class="target" id="paddleclasspaddle_1_1ResponseNormLayer_1af2df968587c7982df9a138004f9a5683"></span>bool <code class="descname">init</code><span class="sig-paren">(</span><em class="property">const</em> LayerMap &amp;<em>layerMap</em>, <em class="property">const</em> <a class="reference internal" href="../../parameter/parameter/parameter.html#_CPPv2N6paddle12ParameterMapE" title="paddle::ParameterMap">ParameterMap</a> &amp;<em>parameterMap</em><span class="sig-paren">)</span><a class="headerlink" href="#_CPPv2N6paddle17ResponseNormLayer4initERK8LayerMapRK12ParameterMap" title="Permalink to this definition">¶</a></dt>
Y
Yu Yang 已提交
2033 2034 2035 2036 2037
<dd><p>Intialization. For example, adding input layers from layerMap and parameterMap. </p>
</dd></dl>

<dl class="function">
<dt id="_CPPv2N6paddle17ResponseNormLayer7forwardE8PassType">
2038
<span id="paddle::ResponseNormLayer::forward__PassType"></span><span class="target" id="paddleclasspaddle_1_1ResponseNormLayer_1a60c7484303bef1b1e70c0ee735ef09a7"></span>void <code class="descname">forward</code><span class="sig-paren">(</span>PassType <em>passType</em><span class="sig-paren">)</span><a class="headerlink" href="#_CPPv2N6paddle17ResponseNormLayer7forwardE8PassType" title="Permalink to this definition">¶</a></dt>
Y
Yu Yang 已提交
2039 2040 2041 2042 2043
<dd><p>Forward propagation. All inherited implementation should call Layer::foward() function. </p>
</dd></dl>

<dl class="function">
<dt id="_CPPv2N6paddle17ResponseNormLayer8backwardERK14UpdateCallback">
2044
<span id="paddle::ResponseNormLayer::backward__UpdateCallbackCR"></span><span class="target" id="paddleclasspaddle_1_1ResponseNormLayer_1a3e729246aae29ce23a9e958420f01bfd"></span>void <code class="descname">backward</code><span class="sig-paren">(</span><em class="property">const</em> <a class="reference internal" href="../../parameter/parameter/parameter.html#_CPPv2N6paddle14UpdateCallbackE" title="paddle::UpdateCallback">UpdateCallback</a> &amp;<em>callback</em> = nullptr<span class="sig-paren">)</span><a class="headerlink" href="#_CPPv2N6paddle17ResponseNormLayer8backwardERK14UpdateCallback" title="Permalink to this definition">¶</a></dt>
2045
<dd><p>Backward propagation. Should only be called after <a class="reference internal" href="#paddleclasspaddle_1_1Layer_1a12386b3f20dd731e7ceaa2c61667cbe1"><span class="std std-ref">Layer::forward()</span></a> function. </p>
Y
Yu Yang 已提交
2046 2047 2048
</dd></dl>

</div>
2049
<div class="breathe-sectiondef docutils container">
Y
Yu Yang 已提交
2050 2051 2052 2053 2054 2055 2056 2057 2058 2059 2060 2061 2062 2063 2064 2065 2066 2067 2068 2069 2070 2071 2072 2073 2074 2075 2076 2077 2078 2079 2080 2081 2082 2083 2084 2085 2086 2087 2088 2089 2090 2091 2092 2093 2094 2095 2096
<p class="breathe-sectiondef-title rubric">Protected Attributes</p>
<dl class="member">
<dt id="_CPPv2N6paddle17ResponseNormLayer9channels_E">
<span id="paddle::ResponseNormLayer::channels___s"></span><span class="target" id="paddleclasspaddle_1_1ResponseNormLayer_1a45f0a5427d5d8ee93b9bd9730b33fc1b"></span>size_t <code class="descname">channels_</code><a class="headerlink" href="#_CPPv2N6paddle17ResponseNormLayer9channels_E" title="Permalink to this definition">¶</a></dt>
<dd></dd></dl>

<dl class="member">
<dt id="_CPPv2N6paddle17ResponseNormLayer5size_E">
<span id="paddle::ResponseNormLayer::size___s"></span><span class="target" id="paddleclasspaddle_1_1ResponseNormLayer_1a1ac00a547cc7b8b9e0062966ff50c33e"></span>size_t <code class="descname">size_</code><a class="headerlink" href="#_CPPv2N6paddle17ResponseNormLayer5size_E" title="Permalink to this definition">¶</a></dt>
<dd></dd></dl>

<dl class="member">
<dt id="_CPPv2N6paddle17ResponseNormLayer8outputX_E">
<span id="paddle::ResponseNormLayer::outputX___s"></span><span class="target" id="paddleclasspaddle_1_1ResponseNormLayer_1a9829279a9cf0ce34a25e941cea49955d"></span>size_t <code class="descname">outputX_</code><a class="headerlink" href="#_CPPv2N6paddle17ResponseNormLayer8outputX_E" title="Permalink to this definition">¶</a></dt>
<dd></dd></dl>

<dl class="member">
<dt id="_CPPv2N6paddle17ResponseNormLayer8imgSize_E">
<span id="paddle::ResponseNormLayer::imgSize___s"></span><span class="target" id="paddleclasspaddle_1_1ResponseNormLayer_1aba80dace8a7bfb8c01c5bbdf9e60ef21"></span>size_t <code class="descname">imgSize_</code><a class="headerlink" href="#_CPPv2N6paddle17ResponseNormLayer8imgSize_E" title="Permalink to this definition">¶</a></dt>
<dd></dd></dl>

<dl class="member">
<dt id="_CPPv2N6paddle17ResponseNormLayer6scale_E">
<span id="paddle::ResponseNormLayer::scale___float"></span><span class="target" id="paddleclasspaddle_1_1ResponseNormLayer_1aa163ffa3ed15d6a86bcaff8f60f57e09"></span>float <code class="descname">scale_</code><a class="headerlink" href="#_CPPv2N6paddle17ResponseNormLayer6scale_E" title="Permalink to this definition">¶</a></dt>
<dd></dd></dl>

<dl class="member">
<dt id="_CPPv2N6paddle17ResponseNormLayer4pow_E">
<span id="paddle::ResponseNormLayer::pow___float"></span><span class="target" id="paddleclasspaddle_1_1ResponseNormLayer_1ab376e51a1209d1afff2f6fcfb941069d"></span>float <code class="descname">pow_</code><a class="headerlink" href="#_CPPv2N6paddle17ResponseNormLayer4pow_E" title="Permalink to this definition">¶</a></dt>
<dd></dd></dl>

<dl class="member">
<dt id="_CPPv2N6paddle17ResponseNormLayer7denoms_E">
<span id="paddle::ResponseNormLayer::denoms___MatrixPtr"></span><span class="target" id="paddleclasspaddle_1_1ResponseNormLayer_1aea037fc649f257f21aaa67fab845d6b2"></span><a class="reference internal" href="../../math/matrix/matrix.html#_CPPv2N6paddle9MatrixPtrE" title="paddle::MatrixPtr">MatrixPtr</a> <code class="descname">denoms_</code><a class="headerlink" href="#_CPPv2N6paddle17ResponseNormLayer7denoms_E" title="Permalink to this definition">¶</a></dt>
<dd></dd></dl>

</div>
</dd></dl>

</div>
<div class="section" id="batchnormbaselayer">
<h2>BatchNormBaseLayer<a class="headerlink" href="#batchnormbaselayer" title="Permalink to this headline">¶</a></h2>
<dl class="class">
<dt id="_CPPv2N6paddle18BatchNormBaseLayerE">
<span id="paddle::BatchNormBaseLayer"></span><span class="target" id="paddleclasspaddle_1_1BatchNormBaseLayer"></span><em class="property">class </em><code class="descclassname">paddle::</code><code class="descname">BatchNormBaseLayer</code><a class="headerlink" href="#_CPPv2N6paddle18BatchNormBaseLayerE" title="Permalink to this definition">¶</a></dt>
<dd><p>Batch normalization layer use to normalizes the input to across the batch. </p>
<p>By default, calculating global mean and variance statistics via a running average in the training peroid. Then the pre-calculated global mean and variance are used for testing.</p>
2097
<p>Moving mean and variance are located in <a class="reference internal" href="../../parameter/parameter/parameter.html#paddleclasspaddle_1_1Parameter"><span class="std std-ref">Parameter</span></a> object when constructing and the calculation will change them. Now we only save global mean and variance of one thread in first node for GPU. But the calculation in CPU is different, because parameters are shared by multiple threads. Here using ShareCpuMatrix with lock to calculate. We still save global mean and variance in first node in CPU when multi machine.</p>
Y
Yu Yang 已提交
2098 2099
<p>[1] S. Ioffe and C. Szegedy, &#8220;Batch Normalization: Accelerating Deep Network
    Training by Reducing Internal Covariate Shift.&#8221; arXiv preprint arXiv:1502.03167 (2015). </p>
2100 2101
<p>Inherits from <a class="reference internal" href="#paddleclasspaddle_1_1Layer"><span class="std std-ref">paddle::Layer</span></a></p>
<p>Subclassed by <a class="reference internal" href="#paddleclasspaddle_1_1BatchNormalizationLayer"><span class="std std-ref">paddle::BatchNormalizationLayer</span></a>, <a class="reference internal" href="#paddleclasspaddle_1_1CudnnBatchNormLayer"><span class="std std-ref">paddle::CudnnBatchNormLayer</span></a></p>
2102
<div class="breathe-sectiondef docutils container">
Y
Yu Yang 已提交
2103 2104 2105 2106 2107 2108 2109 2110 2111 2112 2113 2114 2115
<p class="breathe-sectiondef-title rubric">Public Functions</p>
<dl class="function">
<dt id="_CPPv2N6paddle18BatchNormBaseLayer18BatchNormBaseLayerERK11LayerConfig">
<span id="paddle::BatchNormBaseLayer::BatchNormBaseLayer__LayerConfigCR"></span><span class="target" id="paddleclasspaddle_1_1BatchNormBaseLayer_1aeafdfa95129d94092cec2aadaf88391c"></span><code class="descname">BatchNormBaseLayer</code><span class="sig-paren">(</span><em class="property">const</em> LayerConfig &amp;<em>config</em><span class="sig-paren">)</span><a class="headerlink" href="#_CPPv2N6paddle18BatchNormBaseLayer18BatchNormBaseLayerERK11LayerConfig" title="Permalink to this definition">¶</a></dt>
<dd></dd></dl>

<dl class="function">
<dt id="_CPPv2N6paddle18BatchNormBaseLayerD0Ev">
<span id="paddle::BatchNormBaseLayer::~BatchNormBaseLayer"></span><span class="target" id="paddleclasspaddle_1_1BatchNormBaseLayer_1a2845e4e286e445d189245d5841a576bd"></span><code class="descname">~BatchNormBaseLayer</code><span class="sig-paren">(</span><span class="sig-paren">)</span><a class="headerlink" href="#_CPPv2N6paddle18BatchNormBaseLayerD0Ev" title="Permalink to this definition">¶</a></dt>
<dd></dd></dl>

<dl class="function">
<dt id="_CPPv2N6paddle18BatchNormBaseLayer4initERK8LayerMapRK12ParameterMap">
2116
<span id="paddle::BatchNormBaseLayer::init__LayerMapCR.ParameterMapCR"></span><span class="target" id="paddleclasspaddle_1_1BatchNormBaseLayer_1a5142e9300404bc416dc445660433a53a"></span>bool <code class="descname">init</code><span class="sig-paren">(</span><em class="property">const</em> LayerMap &amp;<em>layerMap</em>, <em class="property">const</em> <a class="reference internal" href="../../parameter/parameter/parameter.html#_CPPv2N6paddle12ParameterMapE" title="paddle::ParameterMap">ParameterMap</a> &amp;<em>parameterMap</em><span class="sig-paren">)</span><a class="headerlink" href="#_CPPv2N6paddle18BatchNormBaseLayer4initERK8LayerMapRK12ParameterMap" title="Permalink to this definition">¶</a></dt>
Y
Yu Yang 已提交
2117 2118 2119 2120 2121 2122 2123 2124 2125 2126
<dd><p>Intialization. For example, adding input layers from layerMap and parameterMap. </p>
</dd></dl>

<dl class="function">
<dt id="_CPPv2N6paddle18BatchNormBaseLayer17calFeatureMapSizeEv">
<span id="paddle::BatchNormBaseLayer::calFeatureMapSize"></span><span class="target" id="paddleclasspaddle_1_1BatchNormBaseLayer_1abe864ddecdd9eeed559e7f150800e256"></span>void <code class="descname">calFeatureMapSize</code><span class="sig-paren">(</span><span class="sig-paren">)</span><a class="headerlink" href="#_CPPv2N6paddle18BatchNormBaseLayer17calFeatureMapSizeEv" title="Permalink to this definition">¶</a></dt>
<dd><p>Calculate feature map size. Some input uses frameHeight and frameWidth to store feature size. </p>
</dd></dl>

</div>
2127
<div class="breathe-sectiondef docutils container">
Y
Yu Yang 已提交
2128 2129 2130 2131 2132 2133 2134 2135
<p class="breathe-sectiondef-title rubric">Public Static Functions</p>
<dl class="function">
<dt id="_CPPv2N6paddle18BatchNormBaseLayer6createERK11LayerConfig">
<span id="paddle::BatchNormBaseLayer::create__LayerConfigCR"></span><span class="target" id="paddleclasspaddle_1_1BatchNormBaseLayer_1a86cf95fcb8f7f3098469dddf8a5ab9b3"></span><em class="property">static</em> <a class="reference internal" href="#_CPPv2N6paddle5LayerE" title="paddle::Layer">Layer</a> *<code class="descname">create</code><span class="sig-paren">(</span><em class="property">const</em> LayerConfig &amp;<em>config</em><span class="sig-paren">)</span><a class="headerlink" href="#_CPPv2N6paddle18BatchNormBaseLayer6createERK11LayerConfig" title="Permalink to this definition">¶</a></dt>
<dd><p>Create BatchNorm layer by norm_type, including batch_norm and cudnn_batch_norm. If do not set norm_type, it will automatically select cudnn_batch_norm for GPU and batch_norm for CPU. </p>
</dd></dl>

</div>
2136
<div class="breathe-sectiondef docutils container">
Y
Yu Yang 已提交
2137 2138 2139 2140 2141 2142 2143 2144 2145 2146 2147 2148 2149 2150 2151 2152 2153 2154 2155 2156 2157 2158 2159 2160 2161 2162 2163 2164 2165 2166 2167 2168 2169 2170 2171 2172 2173 2174 2175 2176 2177 2178 2179 2180 2181 2182 2183 2184 2185 2186 2187 2188 2189 2190 2191 2192 2193 2194 2195 2196 2197 2198 2199 2200 2201 2202 2203 2204 2205 2206 2207 2208 2209 2210 2211 2212 2213 2214 2215 2216 2217 2218 2219 2220 2221
<p class="breathe-sectiondef-title rubric">Protected Attributes</p>
<dl class="member">
<dt id="_CPPv2N6paddle18BatchNormBaseLayer7weight_E">
<span id="paddle::BatchNormBaseLayer::weight___std::unique_ptr:Weight:"></span><span class="target" id="paddleclasspaddle_1_1BatchNormBaseLayer_1a0933169637b57f1930ce7d41cbcd8ceb"></span>std::unique_ptr&lt;<a class="reference internal" href="../../parameter/parameter/parameter.html#_CPPv2N6paddle6WeightE" title="paddle::Weight">Weight</a>&gt; <code class="descname">weight_</code><a class="headerlink" href="#_CPPv2N6paddle18BatchNormBaseLayer7weight_E" title="Permalink to this definition">¶</a></dt>
<dd><p>Batch normalization scale parameter, which is referred to as gamma in in original paper. </p>
</dd></dl>

<dl class="member">
<dt id="_CPPv2N6paddle18BatchNormBaseLayer11movingMean_E">
<span id="paddle::BatchNormBaseLayer::movingMean___std::unique_ptr:Weight:"></span><span class="target" id="paddleclasspaddle_1_1BatchNormBaseLayer_1a757efbdc8d7890b185ceb14cd08e3e90"></span>std::unique_ptr&lt;<a class="reference internal" href="../../parameter/parameter/parameter.html#_CPPv2N6paddle6WeightE" title="paddle::Weight">Weight</a>&gt; <code class="descname">movingMean_</code><a class="headerlink" href="#_CPPv2N6paddle18BatchNormBaseLayer11movingMean_E" title="Permalink to this definition">¶</a></dt>
<dd><p>Moving average of mean. </p>
</dd></dl>

<dl class="member">
<dt id="_CPPv2N6paddle18BatchNormBaseLayer10movingVar_E">
<span id="paddle::BatchNormBaseLayer::movingVar___std::unique_ptr:Weight:"></span><span class="target" id="paddleclasspaddle_1_1BatchNormBaseLayer_1acc5a0fb63f749b0f288bd13c9f7e085c"></span>std::unique_ptr&lt;<a class="reference internal" href="../../parameter/parameter/parameter.html#_CPPv2N6paddle6WeightE" title="paddle::Weight">Weight</a>&gt; <code class="descname">movingVar_</code><a class="headerlink" href="#_CPPv2N6paddle18BatchNormBaseLayer10movingVar_E" title="Permalink to this definition">¶</a></dt>
<dd><p>Moving average of variance. </p>
</dd></dl>

<dl class="member">
<dt id="_CPPv2N6paddle18BatchNormBaseLayer7biases_E">
<span id="paddle::BatchNormBaseLayer::biases___std::unique_ptr:Weight:"></span><span class="target" id="paddleclasspaddle_1_1BatchNormBaseLayer_1aa74dc394ea925fa87a6ef51f34bed4e5"></span>std::unique_ptr&lt;<a class="reference internal" href="../../parameter/parameter/parameter.html#_CPPv2N6paddle6WeightE" title="paddle::Weight">Weight</a>&gt; <code class="descname">biases_</code><a class="headerlink" href="#_CPPv2N6paddle18BatchNormBaseLayer7biases_E" title="Permalink to this definition">¶</a></dt>
<dd><p>Batch normalization bias parameter, which is referred to as beta in in original paper. </p>
</dd></dl>

<dl class="member">
<dt id="_CPPv2N6paddle18BatchNormBaseLayer10savedMean_E">
<span id="paddle::BatchNormBaseLayer::savedMean___MatrixPtr"></span><span class="target" id="paddleclasspaddle_1_1BatchNormBaseLayer_1a69e2baa220fb4cab1577b23f5e75447f"></span><a class="reference internal" href="../../math/matrix/matrix.html#_CPPv2N6paddle9MatrixPtrE" title="paddle::MatrixPtr">MatrixPtr</a> <code class="descname">savedMean_</code><a class="headerlink" href="#_CPPv2N6paddle18BatchNormBaseLayer10savedMean_E" title="Permalink to this definition">¶</a></dt>
<dd><p>Save intermediate results computed during the forward pass, these can then be reused to speed up the backward pass. </p>
</dd></dl>

<dl class="member">
<dt id="_CPPv2N6paddle18BatchNormBaseLayer12savedInvVar_E">
<span id="paddle::BatchNormBaseLayer::savedInvVar___MatrixPtr"></span><span class="target" id="paddleclasspaddle_1_1BatchNormBaseLayer_1a2660b7213380b1964e3b7e69d0dcf671"></span><a class="reference internal" href="../../math/matrix/matrix.html#_CPPv2N6paddle9MatrixPtrE" title="paddle::MatrixPtr">MatrixPtr</a> <code class="descname">savedInvVar_</code><a class="headerlink" href="#_CPPv2N6paddle18BatchNormBaseLayer12savedInvVar_E" title="Permalink to this definition">¶</a></dt>
<dd></dd></dl>

<dl class="member">
<dt id="_CPPv2N6paddle18BatchNormBaseLayer8imgSize_E">
<span id="paddle::BatchNormBaseLayer::imgSize___i"></span><span class="target" id="paddleclasspaddle_1_1BatchNormBaseLayer_1ac4d6f0b01378a57ac6d5388acd4cf1f8"></span>int <code class="descname">imgSize_</code><a class="headerlink" href="#_CPPv2N6paddle18BatchNormBaseLayer8imgSize_E" title="Permalink to this definition">¶</a></dt>
<dd><p>Height or width of input image feature, now height is equal to width. imgSize is 1 if the input is fully-connected layer. </p>
</dd></dl>

<dl class="member">
<dt id="_CPPv2N6paddle18BatchNormBaseLayer7imageH_E">
<span id="paddle::BatchNormBaseLayer::imageH___i"></span><span class="target" id="paddleclasspaddle_1_1BatchNormBaseLayer_1a89597861641e1a8ef9a386b56e2b7e91"></span>int <code class="descname">imageH_</code><a class="headerlink" href="#_CPPv2N6paddle18BatchNormBaseLayer7imageH_E" title="Permalink to this definition">¶</a></dt>
<dd></dd></dl>

<dl class="member">
<dt id="_CPPv2N6paddle18BatchNormBaseLayer7imageW_E">
<span id="paddle::BatchNormBaseLayer::imageW___i"></span><span class="target" id="paddleclasspaddle_1_1BatchNormBaseLayer_1a076dbff07e4a413343a325e04515f298"></span>int <code class="descname">imageW_</code><a class="headerlink" href="#_CPPv2N6paddle18BatchNormBaseLayer7imageW_E" title="Permalink to this definition">¶</a></dt>
<dd></dd></dl>

<dl class="member">
<dt id="_CPPv2N6paddle18BatchNormBaseLayer10imgPixels_E">
<span id="paddle::BatchNormBaseLayer::imgPixels___i"></span><span class="target" id="paddleclasspaddle_1_1BatchNormBaseLayer_1acb3372cfd0172297b15ae227283f6296"></span>int <code class="descname">imgPixels_</code><a class="headerlink" href="#_CPPv2N6paddle18BatchNormBaseLayer10imgPixels_E" title="Permalink to this definition">¶</a></dt>
<dd><p>Height * Width. </p>
</dd></dl>

<dl class="member">
<dt id="_CPPv2N6paddle18BatchNormBaseLayer9channels_E">
<span id="paddle::BatchNormBaseLayer::channels___i"></span><span class="target" id="paddleclasspaddle_1_1BatchNormBaseLayer_1a62978d632f56ae9c595fb274d0fd6e6c"></span>int <code class="descname">channels_</code><a class="headerlink" href="#_CPPv2N6paddle18BatchNormBaseLayer9channels_E" title="Permalink to this definition">¶</a></dt>
<dd><p>Feature dimension. If the input layer is conv layer, it is the channels of feature map of the conv layer. If the input layer is fully-connected layer, it is the dimension of fc layer. </p>
</dd></dl>

<dl class="member">
<dt id="_CPPv2N6paddle18BatchNormBaseLayer15useGlobalStats_E">
<span id="paddle::BatchNormBaseLayer::useGlobalStats___b"></span><span class="target" id="paddleclasspaddle_1_1BatchNormBaseLayer_1acad5d010c6800ef2e7995380151f48ac"></span>bool <code class="descname">useGlobalStats_</code><a class="headerlink" href="#_CPPv2N6paddle18BatchNormBaseLayer15useGlobalStats_E" title="Permalink to this definition">¶</a></dt>
<dd></dd></dl>

<dl class="member">
<dt id="_CPPv2N6paddle18BatchNormBaseLayer18movingAvgFraction_E">
<span id="paddle::BatchNormBaseLayer::movingAvgFraction___real"></span><span class="target" id="paddleclasspaddle_1_1BatchNormBaseLayer_1a96cb0862744a9443f76ecb41429817dd"></span>real <code class="descname">movingAvgFraction_</code><a class="headerlink" href="#_CPPv2N6paddle18BatchNormBaseLayer18movingAvgFraction_E" title="Permalink to this definition">¶</a></dt>
<dd></dd></dl>

</div>
</dd></dl>

</div>
<div class="section" id="batchnormalizationlayer">
<h2>BatchNormalizationLayer<a class="headerlink" href="#batchnormalizationlayer" title="Permalink to this headline">¶</a></h2>
<dl class="class">
<dt id="_CPPv2N6paddle23BatchNormalizationLayerE">
<span id="paddle::BatchNormalizationLayer"></span><span class="target" id="paddleclasspaddle_1_1BatchNormalizationLayer"></span><em class="property">class </em><code class="descclassname">paddle::</code><code class="descname">BatchNormalizationLayer</code><a class="headerlink" href="#_CPPv2N6paddle23BatchNormalizationLayerE" title="Permalink to this definition">¶</a></dt>
<dd><p>A Inheritance class of Batch normalization layer. It supports both CPU and GPU. </p>
<p>The config file api is batch_norm_layer. </p>
2222
<p>Inherits from <a class="reference internal" href="#paddleclasspaddle_1_1BatchNormBaseLayer"><span class="std std-ref">paddle::BatchNormBaseLayer</span></a></p>
2223
<div class="breathe-sectiondef docutils container">
Y
Yu Yang 已提交
2224 2225 2226 2227 2228 2229 2230 2231 2232 2233 2234 2235 2236
<p class="breathe-sectiondef-title rubric">Public Functions</p>
<dl class="function">
<dt id="_CPPv2N6paddle23BatchNormalizationLayer23BatchNormalizationLayerERK11LayerConfig">
<span id="paddle::BatchNormalizationLayer::BatchNormalizationLayer__LayerConfigCR"></span><span class="target" id="paddleclasspaddle_1_1BatchNormalizationLayer_1a4c12778e3c027c41927ca0d5fb4de204"></span><code class="descname">BatchNormalizationLayer</code><span class="sig-paren">(</span><em class="property">const</em> LayerConfig &amp;<em>config</em><span class="sig-paren">)</span><a class="headerlink" href="#_CPPv2N6paddle23BatchNormalizationLayer23BatchNormalizationLayerERK11LayerConfig" title="Permalink to this definition">¶</a></dt>
<dd></dd></dl>

<dl class="function">
<dt id="_CPPv2N6paddle23BatchNormalizationLayerD0Ev">
<span id="paddle::BatchNormalizationLayer::~BatchNormalizationLayer"></span><span class="target" id="paddleclasspaddle_1_1BatchNormalizationLayer_1a81c0a5c19e8bf771eccb9ac9404114ad"></span><code class="descname">~BatchNormalizationLayer</code><span class="sig-paren">(</span><span class="sig-paren">)</span><a class="headerlink" href="#_CPPv2N6paddle23BatchNormalizationLayerD0Ev" title="Permalink to this definition">¶</a></dt>
<dd></dd></dl>

<dl class="function">
<dt id="_CPPv2N6paddle23BatchNormalizationLayer4initERK8LayerMapRK12ParameterMap">
2237
<span id="paddle::BatchNormalizationLayer::init__LayerMapCR.ParameterMapCR"></span><span class="target" id="paddleclasspaddle_1_1BatchNormalizationLayer_1af4b5c21268a18b888f6248bb75bb6655"></span>bool <code class="descname">init</code><span class="sig-paren">(</span><em class="property">const</em> LayerMap &amp;<em>layerMap</em>, <em class="property">const</em> <a class="reference internal" href="../../parameter/parameter/parameter.html#_CPPv2N6paddle12ParameterMapE" title="paddle::ParameterMap">ParameterMap</a> &amp;<em>parameterMap</em><span class="sig-paren">)</span><a class="headerlink" href="#_CPPv2N6paddle23BatchNormalizationLayer4initERK8LayerMapRK12ParameterMap" title="Permalink to this definition">¶</a></dt>
Y
Yu Yang 已提交
2238 2239 2240 2241 2242
<dd><p>Intialization. For example, adding input layers from layerMap and parameterMap. </p>
</dd></dl>

<dl class="function">
<dt id="_CPPv2N6paddle23BatchNormalizationLayer7forwardE8PassType">
2243
<span id="paddle::BatchNormalizationLayer::forward__PassType"></span><span class="target" id="paddleclasspaddle_1_1BatchNormalizationLayer_1af7f66d4c00cf7f6b744601846a87e0c6"></span>void <code class="descname">forward</code><span class="sig-paren">(</span>PassType <em>passType</em><span class="sig-paren">)</span><a class="headerlink" href="#_CPPv2N6paddle23BatchNormalizationLayer7forwardE8PassType" title="Permalink to this definition">¶</a></dt>
Y
Yu Yang 已提交
2244 2245 2246 2247 2248
<dd><p>Forward propagation. All inherited implementation should call Layer::foward() function. </p>
</dd></dl>

<dl class="function">
<dt id="_CPPv2N6paddle23BatchNormalizationLayer8backwardERK14UpdateCallback">
2249
<span id="paddle::BatchNormalizationLayer::backward__UpdateCallbackCR"></span><span class="target" id="paddleclasspaddle_1_1BatchNormalizationLayer_1a814181a10c546c560f416da9a8ef2c63"></span>void <code class="descname">backward</code><span class="sig-paren">(</span><em class="property">const</em> <a class="reference internal" href="../../parameter/parameter/parameter.html#_CPPv2N6paddle14UpdateCallbackE" title="paddle::UpdateCallback">UpdateCallback</a> &amp;<em>callback</em> = nullptr<span class="sig-paren">)</span><a class="headerlink" href="#_CPPv2N6paddle23BatchNormalizationLayer8backwardERK14UpdateCallback" title="Permalink to this definition">¶</a></dt>
2250
<dd><p>Backward propagation. Should only be called after <a class="reference internal" href="#paddleclasspaddle_1_1Layer_1a12386b3f20dd731e7ceaa2c61667cbe1"><span class="std std-ref">Layer::forward()</span></a> function. </p>
Y
Yu Yang 已提交
2251 2252 2253
</dd></dl>

</div>
2254
<div class="breathe-sectiondef docutils container">
Y
Yu Yang 已提交
2255 2256 2257 2258 2259 2260 2261 2262 2263 2264 2265 2266 2267 2268 2269 2270 2271 2272 2273 2274 2275 2276
<p class="breathe-sectiondef-title rubric">Protected Functions</p>
<dl class="function">
<dt id="_CPPv2N6paddle23BatchNormalizationLayer13setMeanAndStdEv">
<span id="paddle::BatchNormalizationLayer::setMeanAndStd"></span><span class="target" id="paddleclasspaddle_1_1BatchNormalizationLayer_1afc002f3d656902a92671572b8d7eea4d"></span>void <code class="descname">setMeanAndStd</code><span class="sig-paren">(</span><span class="sig-paren">)</span><a class="headerlink" href="#_CPPv2N6paddle23BatchNormalizationLayer13setMeanAndStdEv" title="Permalink to this definition">¶</a></dt>
<dd><p>Load pre-calculated mean and std. </p>
</dd></dl>

<dl class="function">
<dt id="_CPPv2N6paddle23BatchNormalizationLayer13calMeanAndStdERK9MatrixPtr">
<span id="paddle::BatchNormalizationLayer::calMeanAndStd__MatrixPtrCR"></span><span class="target" id="paddleclasspaddle_1_1BatchNormalizationLayer_1a47e4074acfaa4b44c09b275fd56aa136"></span>void <code class="descname">calMeanAndStd</code><span class="sig-paren">(</span><em class="property">const</em> <a class="reference internal" href="../../math/matrix/matrix.html#_CPPv2N6paddle9MatrixPtrE" title="paddle::MatrixPtr">MatrixPtr</a> &amp;<em>mat</em><span class="sig-paren">)</span><a class="headerlink" href="#_CPPv2N6paddle23BatchNormalizationLayer13calMeanAndStdERK9MatrixPtr" title="Permalink to this definition">¶</a></dt>
<dd><p>Calculate mean and std. </p>
</dd></dl>

<dl class="function">
<dt id="_CPPv2N6paddle23BatchNormalizationLayer19calMovingMeanAndVarEv">
<span id="paddle::BatchNormalizationLayer::calMovingMeanAndVar"></span><span class="target" id="paddleclasspaddle_1_1BatchNormalizationLayer_1ac025dbf03ab90bd8213f52b431e2f8c4"></span>void <code class="descname">calMovingMeanAndVar</code><span class="sig-paren">(</span><span class="sig-paren">)</span><a class="headerlink" href="#_CPPv2N6paddle23BatchNormalizationLayer19calMovingMeanAndVarEv" title="Permalink to this definition">¶</a></dt>
<dd><p>Calculate moving mean and variance. </p>
</dd></dl>

<dl class="function">
<dt id="_CPPv2N6paddle23BatchNormalizationLayer9expandMatERK9MatrixPtrR9MatrixPtr">
<span id="paddle::BatchNormalizationLayer::expandMat__MatrixPtrCR.MatrixPtrR"></span><span class="target" id="paddleclasspaddle_1_1BatchNormalizationLayer_1a88f1ab5a45a312223509feb97cd00b85"></span>void <code class="descname">expandMat</code><span class="sig-paren">(</span><em class="property">const</em> <a class="reference internal" href="../../math/matrix/matrix.html#_CPPv2N6paddle9MatrixPtrE" title="paddle::MatrixPtr">MatrixPtr</a> &amp;<em>in</em>, <a class="reference internal" href="../../math/matrix/matrix.html#_CPPv2N6paddle9MatrixPtrE" title="paddle::MatrixPtr">MatrixPtr</a> &amp;<em>out</em><span class="sig-paren">)</span><a class="headerlink" href="#_CPPv2N6paddle23BatchNormalizationLayer9expandMatERK9MatrixPtrR9MatrixPtr" title="Permalink to this definition">¶</a></dt>
2277
<dd><p>expand a <a class="reference internal" href="../../math/matrix/matrix.html#paddleclasspaddle_1_1Matrix"><span class="std std-ref">Matrix</span></a> from batch, channels* imagePixels to batch * ImagePixels * channels. </p>
Y
Yu Yang 已提交
2278 2279 2280 2281 2282
</dd></dl>

<dl class="function">
<dt id="_CPPv2N6paddle23BatchNormalizationLayer9shrinkMatERK9MatrixPtrR9MatrixPtr">
<span id="paddle::BatchNormalizationLayer::shrinkMat__MatrixPtrCR.MatrixPtrR"></span><span class="target" id="paddleclasspaddle_1_1BatchNormalizationLayer_1a24575bb6a59434f9f54f8a343ad8a676"></span>void <code class="descname">shrinkMat</code><span class="sig-paren">(</span><em class="property">const</em> <a class="reference internal" href="../../math/matrix/matrix.html#_CPPv2N6paddle9MatrixPtrE" title="paddle::MatrixPtr">MatrixPtr</a> &amp;<em>in</em>, <a class="reference internal" href="../../math/matrix/matrix.html#_CPPv2N6paddle9MatrixPtrE" title="paddle::MatrixPtr">MatrixPtr</a> &amp;<em>out</em><span class="sig-paren">)</span><a class="headerlink" href="#_CPPv2N6paddle23BatchNormalizationLayer9shrinkMatERK9MatrixPtrR9MatrixPtr" title="Permalink to this definition">¶</a></dt>
2283
<dd><p>Shrink a <a class="reference internal" href="../../math/matrix/matrix.html#paddleclasspaddle_1_1Matrix"><span class="std std-ref">Matrix</span></a> from from batch * ImagePixels * channels to batch, channels* imagePixels. </p>
Y
Yu Yang 已提交
2284 2285 2286
</dd></dl>

</div>
2287
<div class="breathe-sectiondef docutils container">
Y
Yu Yang 已提交
2288 2289 2290 2291 2292 2293 2294 2295 2296 2297 2298 2299 2300 2301 2302 2303 2304 2305 2306 2307 2308 2309 2310 2311 2312 2313 2314 2315 2316 2317 2318 2319 2320 2321 2322 2323 2324 2325 2326 2327 2328 2329 2330 2331 2332 2333 2334 2335 2336 2337 2338 2339 2340 2341 2342 2343 2344 2345 2346 2347 2348 2349 2350
<p class="breathe-sectiondef-title rubric">Protected Attributes</p>
<dl class="member">
<dt id="_CPPv2N6paddle23BatchNormalizationLayer7tmpMat_E">
<span id="paddle::BatchNormalizationLayer::tmpMat___MatrixPtr"></span><span class="target" id="paddleclasspaddle_1_1BatchNormalizationLayer_1a360c9e8718dcd0d28b5f447239e8e5db"></span><a class="reference internal" href="../../math/matrix/matrix.html#_CPPv2N6paddle9MatrixPtrE" title="paddle::MatrixPtr">MatrixPtr</a> <code class="descname">tmpMat_</code><a class="headerlink" href="#_CPPv2N6paddle23BatchNormalizationLayer7tmpMat_E" title="Permalink to this definition">¶</a></dt>
<dd></dd></dl>

<dl class="member">
<dt id="_CPPv2N6paddle23BatchNormalizationLayer8tmpGrad_E">
<span id="paddle::BatchNormalizationLayer::tmpGrad___MatrixPtr"></span><span class="target" id="paddleclasspaddle_1_1BatchNormalizationLayer_1a7b4f9acb68a62042562d9e0659548f4b"></span><a class="reference internal" href="../../math/matrix/matrix.html#_CPPv2N6paddle9MatrixPtrE" title="paddle::MatrixPtr">MatrixPtr</a> <code class="descname">tmpGrad_</code><a class="headerlink" href="#_CPPv2N6paddle23BatchNormalizationLayer8tmpGrad_E" title="Permalink to this definition">¶</a></dt>
<dd></dd></dl>

<dl class="member">
<dt id="_CPPv2N6paddle23BatchNormalizationLayer11expandedIn_E">
<span id="paddle::BatchNormalizationLayer::expandedIn___MatrixPtr"></span><span class="target" id="paddleclasspaddle_1_1BatchNormalizationLayer_1a048e21f90b77f272b416d39cbba17d01"></span><a class="reference internal" href="../../math/matrix/matrix.html#_CPPv2N6paddle9MatrixPtrE" title="paddle::MatrixPtr">MatrixPtr</a> <code class="descname">expandedIn_</code><a class="headerlink" href="#_CPPv2N6paddle23BatchNormalizationLayer11expandedIn_E" title="Permalink to this definition">¶</a></dt>
<dd></dd></dl>

<dl class="member">
<dt id="_CPPv2N6paddle23BatchNormalizationLayer12expandedOut_E">
<span id="paddle::BatchNormalizationLayer::expandedOut___MatrixPtr"></span><span class="target" id="paddleclasspaddle_1_1BatchNormalizationLayer_1a6e4f88bd2f604af577f72576ed1b5885"></span><a class="reference internal" href="../../math/matrix/matrix.html#_CPPv2N6paddle9MatrixPtrE" title="paddle::MatrixPtr">MatrixPtr</a> <code class="descname">expandedOut_</code><a class="headerlink" href="#_CPPv2N6paddle23BatchNormalizationLayer12expandedOut_E" title="Permalink to this definition">¶</a></dt>
<dd></dd></dl>

<dl class="member">
<dt id="_CPPv2N6paddle23BatchNormalizationLayer15expandedInGrad_E">
<span id="paddle::BatchNormalizationLayer::expandedInGrad___MatrixPtr"></span><span class="target" id="paddleclasspaddle_1_1BatchNormalizationLayer_1a3066bf7d8a68eff79217736acf5eacff"></span><a class="reference internal" href="../../math/matrix/matrix.html#_CPPv2N6paddle9MatrixPtrE" title="paddle::MatrixPtr">MatrixPtr</a> <code class="descname">expandedInGrad_</code><a class="headerlink" href="#_CPPv2N6paddle23BatchNormalizationLayer15expandedInGrad_E" title="Permalink to this definition">¶</a></dt>
<dd></dd></dl>

<dl class="member">
<dt id="_CPPv2N6paddle23BatchNormalizationLayer16expandedOutGrad_E">
<span id="paddle::BatchNormalizationLayer::expandedOutGrad___MatrixPtr"></span><span class="target" id="paddleclasspaddle_1_1BatchNormalizationLayer_1a3e102171e909986d1575af48db065b35"></span><a class="reference internal" href="../../math/matrix/matrix.html#_CPPv2N6paddle9MatrixPtrE" title="paddle::MatrixPtr">MatrixPtr</a> <code class="descname">expandedOutGrad_</code><a class="headerlink" href="#_CPPv2N6paddle23BatchNormalizationLayer16expandedOutGrad_E" title="Permalink to this definition">¶</a></dt>
<dd></dd></dl>

<dl class="member">
<dt id="_CPPv2N6paddle23BatchNormalizationLayer7inGrad_E">
<span id="paddle::BatchNormalizationLayer::inGrad___MatrixPtr"></span><span class="target" id="paddleclasspaddle_1_1BatchNormalizationLayer_1af12f24899a7e0232af7b5c172c996742"></span><a class="reference internal" href="../../math/matrix/matrix.html#_CPPv2N6paddle9MatrixPtrE" title="paddle::MatrixPtr">MatrixPtr</a> <code class="descname">inGrad_</code><a class="headerlink" href="#_CPPv2N6paddle23BatchNormalizationLayer7inGrad_E" title="Permalink to this definition">¶</a></dt>
<dd></dd></dl>

<dl class="member">
<dt id="_CPPv2N6paddle23BatchNormalizationLayer7normIn_E">
<span id="paddle::BatchNormalizationLayer::normIn___MatrixPtr"></span><span class="target" id="paddleclasspaddle_1_1BatchNormalizationLayer_1acbe0f8c87c77e03bfb413283152cb4c2"></span><a class="reference internal" href="../../math/matrix/matrix.html#_CPPv2N6paddle9MatrixPtrE" title="paddle::MatrixPtr">MatrixPtr</a> <code class="descname">normIn_</code><a class="headerlink" href="#_CPPv2N6paddle23BatchNormalizationLayer7normIn_E" title="Permalink to this definition">¶</a></dt>
<dd></dd></dl>

<dl class="member">
<dt id="_CPPv2N6paddle23BatchNormalizationLayer11normInGrad_E">
<span id="paddle::BatchNormalizationLayer::normInGrad___MatrixPtr"></span><span class="target" id="paddleclasspaddle_1_1BatchNormalizationLayer_1a78fc77b066e4716c12ee416265fa8e84"></span><a class="reference internal" href="../../math/matrix/matrix.html#_CPPv2N6paddle9MatrixPtrE" title="paddle::MatrixPtr">MatrixPtr</a> <code class="descname">normInGrad_</code><a class="headerlink" href="#_CPPv2N6paddle23BatchNormalizationLayer11normInGrad_E" title="Permalink to this definition">¶</a></dt>
<dd></dd></dl>

<dl class="member">
<dt id="_CPPv2N6paddle23BatchNormalizationLayer9meanGrad_E">
<span id="paddle::BatchNormalizationLayer::meanGrad___MatrixPtr"></span><span class="target" id="paddleclasspaddle_1_1BatchNormalizationLayer_1a8a8fb768c0624a17a77ce52f15184d6d"></span><a class="reference internal" href="../../math/matrix/matrix.html#_CPPv2N6paddle9MatrixPtrE" title="paddle::MatrixPtr">MatrixPtr</a> <code class="descname">meanGrad_</code><a class="headerlink" href="#_CPPv2N6paddle23BatchNormalizationLayer9meanGrad_E" title="Permalink to this definition">¶</a></dt>
<dd></dd></dl>

<dl class="member">
<dt id="_CPPv2N6paddle23BatchNormalizationLayer8stdGrad_E">
<span id="paddle::BatchNormalizationLayer::stdGrad___MatrixPtr"></span><span class="target" id="paddleclasspaddle_1_1BatchNormalizationLayer_1abb8b426b1784ffede415e346c2373a8b"></span><a class="reference internal" href="../../math/matrix/matrix.html#_CPPv2N6paddle9MatrixPtrE" title="paddle::MatrixPtr">MatrixPtr</a> <code class="descname">stdGrad_</code><a class="headerlink" href="#_CPPv2N6paddle23BatchNormalizationLayer8stdGrad_E" title="Permalink to this definition">¶</a></dt>
<dd></dd></dl>

<dl class="member">
<dt id="_CPPv2N6paddle23BatchNormalizationLayer10firstTest_E">
<span id="paddle::BatchNormalizationLayer::firstTest___b"></span><span class="target" id="paddleclasspaddle_1_1BatchNormalizationLayer_1af18a5c0a28950217353b2cbd3147a6ea"></span>bool <code class="descname">firstTest_</code><a class="headerlink" href="#_CPPv2N6paddle23BatchNormalizationLayer10firstTest_E" title="Permalink to this definition">¶</a></dt>
<dd><p>Load mean and variance only once flag. </p>
</dd></dl>

</div>
2351
<div class="breathe-sectiondef docutils container">
Y
Yu Yang 已提交
2352 2353 2354 2355 2356 2357 2358 2359 2360 2361 2362 2363 2364 2365 2366 2367 2368 2369 2370 2371 2372 2373 2374
<p class="breathe-sectiondef-title rubric">Protected Static Attributes</p>
<dl class="member">
<dt id="_CPPv2N6paddle23BatchNormalizationLayer3EPSE">
<span id="paddle::BatchNormalizationLayer::EPS__realC"></span><span class="target" id="paddleclasspaddle_1_1BatchNormalizationLayer_1ab076f40aa2180cfb78f7097e6cf56e02"></span><em class="property">const</em> real <code class="descname">EPS</code><a class="headerlink" href="#_CPPv2N6paddle23BatchNormalizationLayer3EPSE" title="Permalink to this definition">¶</a></dt>
<dd><p>Epsilon value used in the batch normalization formula. </p>
</dd></dl>

</div>
</dd></dl>

</div>
<div class="section" id="cudnnbatchnormlayer">
<h2>CudnnBatchNormLayer<a class="headerlink" href="#cudnnbatchnormlayer" title="Permalink to this headline">¶</a></h2>
<dl class="class">
<dt id="_CPPv2N6paddle19CudnnBatchNormLayerE">
<span id="paddle::CudnnBatchNormLayer"></span><span class="target" id="paddleclasspaddle_1_1CudnnBatchNormLayer"></span><em class="property">class </em><code class="descclassname">paddle::</code><code class="descname">CudnnBatchNormLayer</code><a class="headerlink" href="#_CPPv2N6paddle19CudnnBatchNormLayerE" title="Permalink to this definition">¶</a></dt>
<dd><p>Cudnn Batch normalization layer use to cuDNN lib to implentment. </p>
<p>
The config file api is batch_norm_layer. <dl class="docutils">
<dt><strong>Note</strong></dt>
<dd>Cudnn version must &gt;= v4.0, and better to use the latest version (v5.1).</dd>
</dl>
</p>
2375
<p>Inherits from <a class="reference internal" href="#paddleclasspaddle_1_1BatchNormBaseLayer"><span class="std std-ref">paddle::BatchNormBaseLayer</span></a></p>
2376
<div class="breathe-sectiondef docutils container">
Y
Yu Yang 已提交
2377 2378 2379 2380 2381 2382 2383 2384 2385 2386 2387 2388 2389
<p class="breathe-sectiondef-title rubric">Public Functions</p>
<dl class="function">
<dt id="_CPPv2N6paddle19CudnnBatchNormLayer19CudnnBatchNormLayerERK11LayerConfig">
<span id="paddle::CudnnBatchNormLayer::CudnnBatchNormLayer__LayerConfigCR"></span><span class="target" id="paddleclasspaddle_1_1CudnnBatchNormLayer_1a30f2908bde1d8f7c35186b7d0cdec0f0"></span><code class="descname">CudnnBatchNormLayer</code><span class="sig-paren">(</span><em class="property">const</em> LayerConfig &amp;<em>config</em><span class="sig-paren">)</span><a class="headerlink" href="#_CPPv2N6paddle19CudnnBatchNormLayer19CudnnBatchNormLayerERK11LayerConfig" title="Permalink to this definition">¶</a></dt>
<dd></dd></dl>

<dl class="function">
<dt id="_CPPv2N6paddle19CudnnBatchNormLayerD0Ev">
<span id="paddle::CudnnBatchNormLayer::~CudnnBatchNormLayer"></span><span class="target" id="paddleclasspaddle_1_1CudnnBatchNormLayer_1ad75d8bc9eb3ef758578ec49922ecee06"></span><code class="descname">~CudnnBatchNormLayer</code><span class="sig-paren">(</span><span class="sig-paren">)</span><a class="headerlink" href="#_CPPv2N6paddle19CudnnBatchNormLayerD0Ev" title="Permalink to this definition">¶</a></dt>
<dd></dd></dl>

<dl class="function">
<dt id="_CPPv2N6paddle19CudnnBatchNormLayer4initERK8LayerMapRK12ParameterMap">
2390
<span id="paddle::CudnnBatchNormLayer::init__LayerMapCR.ParameterMapCR"></span><span class="target" id="paddleclasspaddle_1_1CudnnBatchNormLayer_1a1db3a0756ee65c1834c28996fe099fe2"></span>bool <code class="descname">init</code><span class="sig-paren">(</span><em class="property">const</em> LayerMap &amp;<em>layerMap</em>, <em class="property">const</em> <a class="reference internal" href="../../parameter/parameter/parameter.html#_CPPv2N6paddle12ParameterMapE" title="paddle::ParameterMap">ParameterMap</a> &amp;<em>parameterMap</em><span class="sig-paren">)</span><a class="headerlink" href="#_CPPv2N6paddle19CudnnBatchNormLayer4initERK8LayerMapRK12ParameterMap" title="Permalink to this definition">¶</a></dt>
Y
Yu Yang 已提交
2391 2392 2393 2394 2395 2396 2397 2398 2399 2400 2401
<dd><p>Intialization. For example, adding input layers from layerMap and parameterMap. </p>
</dd></dl>

<dl class="function">
<dt id="_CPPv2N6paddle19CudnnBatchNormLayer7reshapeEi">
<span id="paddle::CudnnBatchNormLayer::reshape__i"></span><span class="target" id="paddleclasspaddle_1_1CudnnBatchNormLayer_1a38f57ebd4af36499b1c9da2d7d7ac700"></span>void <code class="descname">reshape</code><span class="sig-paren">(</span>int <em>batchSize</em><span class="sig-paren">)</span><a class="headerlink" href="#_CPPv2N6paddle19CudnnBatchNormLayer7reshapeEi" title="Permalink to this definition">¶</a></dt>
<dd><p>reshape tensor of ioDesc_. </p>
</dd></dl>

<dl class="function">
<dt id="_CPPv2N6paddle19CudnnBatchNormLayer7forwardE8PassType">
2402
<span id="paddle::CudnnBatchNormLayer::forward__PassType"></span><span class="target" id="paddleclasspaddle_1_1CudnnBatchNormLayer_1a70a44ed9e782bf901eaca534fa5dab84"></span>void <code class="descname">forward</code><span class="sig-paren">(</span>PassType <em>passType</em><span class="sig-paren">)</span><a class="headerlink" href="#_CPPv2N6paddle19CudnnBatchNormLayer7forwardE8PassType" title="Permalink to this definition">¶</a></dt>
Y
Yu Yang 已提交
2403 2404 2405 2406 2407
<dd><p>Forward propagation. All inherited implementation should call Layer::foward() function. </p>
</dd></dl>

<dl class="function">
<dt id="_CPPv2N6paddle19CudnnBatchNormLayer8backwardERK14UpdateCallback">
2408
<span id="paddle::CudnnBatchNormLayer::backward__UpdateCallbackCR"></span><span class="target" id="paddleclasspaddle_1_1CudnnBatchNormLayer_1ac69cefa3504bae2165c71b30745a71c5"></span>void <code class="descname">backward</code><span class="sig-paren">(</span><em class="property">const</em> <a class="reference internal" href="../../parameter/parameter/parameter.html#_CPPv2N6paddle14UpdateCallbackE" title="paddle::UpdateCallback">UpdateCallback</a> &amp;<em>callback</em> = nullptr<span class="sig-paren">)</span><a class="headerlink" href="#_CPPv2N6paddle19CudnnBatchNormLayer8backwardERK14UpdateCallback" title="Permalink to this definition">¶</a></dt>
2409
<dd><p>Backward propagation. Should only be called after <a class="reference internal" href="#paddleclasspaddle_1_1Layer_1a12386b3f20dd731e7ceaa2c61667cbe1"><span class="std std-ref">Layer::forward()</span></a> function. </p>
Y
Yu Yang 已提交
2410 2411 2412
</dd></dl>

</div>
2413
<div class="breathe-sectiondef docutils container">
Y
Yu Yang 已提交
2414 2415 2416 2417 2418 2419 2420 2421 2422 2423 2424 2425 2426 2427 2428 2429 2430 2431 2432 2433 2434 2435 2436 2437 2438
<p class="breathe-sectiondef-title rubric">Protected Attributes</p>
<dl class="member">
<dt id="_CPPv2N6paddle19CudnnBatchNormLayer7ioDesc_E">
<span id="paddle::CudnnBatchNormLayer::ioDesc___hl_tensor_descriptor"></span><span class="target" id="paddleclasspaddle_1_1CudnnBatchNormLayer_1a116994f92af22a796763858220a9e22c"></span><a class="reference internal" href="../../cuda/cuda/cuda.html#_CPPv220hl_tensor_descriptor" title="hl_tensor_descriptor">hl_tensor_descriptor</a> <code class="descname">ioDesc_</code><a class="headerlink" href="#_CPPv2N6paddle19CudnnBatchNormLayer7ioDesc_E" title="Permalink to this definition">¶</a></dt>
<dd><p>Input/output tensor descriptor desc. </p>
</dd></dl>

<dl class="member">
<dt id="_CPPv2N6paddle19CudnnBatchNormLayer12bnParamDesc_E">
<span id="paddle::CudnnBatchNormLayer::bnParamDesc___hl_tensor_descriptor"></span><span class="target" id="paddleclasspaddle_1_1CudnnBatchNormLayer_1adc70603f6fe5e5863762a9d6128a751c"></span><a class="reference internal" href="../../cuda/cuda/cuda.html#_CPPv220hl_tensor_descriptor" title="hl_tensor_descriptor">hl_tensor_descriptor</a> <code class="descname">bnParamDesc_</code><a class="headerlink" href="#_CPPv2N6paddle19CudnnBatchNormLayer12bnParamDesc_E" title="Permalink to this definition">¶</a></dt>
<dd><p>Shared tensor descriptor desc for the 6 tenros: bnScale, bnBias, running mean/var, save_mean/var </p>
</dd></dl>

<dl class="member">
<dt id="_CPPv2N6paddle19CudnnBatchNormLayer9tmpWGrad_E">
<span id="paddle::CudnnBatchNormLayer::tmpWGrad___MatrixPtr"></span><span class="target" id="paddleclasspaddle_1_1CudnnBatchNormLayer_1a94ec97abaf3182c4d555a39339313fc2"></span><a class="reference internal" href="../../math/matrix/matrix.html#_CPPv2N6paddle9MatrixPtrE" title="paddle::MatrixPtr">MatrixPtr</a> <code class="descname">tmpWGrad_</code><a class="headerlink" href="#_CPPv2N6paddle19CudnnBatchNormLayer9tmpWGrad_E" title="Permalink to this definition">¶</a></dt>
<dd><p>The gradient of weight and bias in cudnn api can not be empty. If set is_static for weight or bias, it will not allocate memory for them, and the gradient is NULL. In this case, will use two matrix. </p>
</dd></dl>

<dl class="member">
<dt id="_CPPv2N6paddle19CudnnBatchNormLayer12tmpBiasGrad_E">
<span id="paddle::CudnnBatchNormLayer::tmpBiasGrad___MatrixPtr"></span><span class="target" id="paddleclasspaddle_1_1CudnnBatchNormLayer_1a595cfde46cd354fde7200813c80366e2"></span><a class="reference internal" href="../../math/matrix/matrix.html#_CPPv2N6paddle9MatrixPtrE" title="paddle::MatrixPtr">MatrixPtr</a> <code class="descname">tmpBiasGrad_</code><a class="headerlink" href="#_CPPv2N6paddle19CudnnBatchNormLayer12tmpBiasGrad_E" title="Permalink to this definition">¶</a></dt>
<dd></dd></dl>

</div>
2439
<div class="breathe-sectiondef docutils container">
Y
Yu Yang 已提交
2440 2441 2442 2443 2444 2445 2446 2447 2448 2449 2450 2451 2452 2453 2454 2455 2456 2457 2458 2459
<p class="breathe-sectiondef-title rubric">Protected Static Attributes</p>
<dl class="member">
<dt id="_CPPv2N6paddle19CudnnBatchNormLayer3EPSE">
<span id="paddle::CudnnBatchNormLayer::EPS__doubleC"></span><span class="target" id="paddleclasspaddle_1_1CudnnBatchNormLayer_1a77b024b9588c7c871b0efcc4d9a2c529"></span><em class="property">const</em> double <code class="descname">EPS</code><a class="headerlink" href="#_CPPv2N6paddle19CudnnBatchNormLayer3EPSE" title="Permalink to this definition">¶</a></dt>
<dd><p>Epsilon value used in the batch normalization formula. Minimum allowed value is CUDNN_BN_MIN_EPSILON defined in cudnn.h. Same epsilon value should be used in forward and backward functions. </p>
</dd></dl>

</div>
</dd></dl>

</div>
<div class="section" id="sumtoonenormlayer">
<h2>SumToOneNormLayer<a class="headerlink" href="#sumtoonenormlayer" title="Permalink to this headline">¶</a></h2>
<dl class="class">
<dt id="_CPPv2N6paddle17SumToOneNormLayerE">
<span id="paddle::SumToOneNormLayer"></span><span class="target" id="paddleclasspaddle_1_1SumToOneNormLayer"></span><em class="property">class </em><code class="descclassname">paddle::</code><code class="descname">SumToOneNormLayer</code><a class="headerlink" href="#_CPPv2N6paddle17SumToOneNormLayerE" title="Permalink to this definition">¶</a></dt>
<dd><p>A layer for sum-to-one normalization, which is used in NEURAL TURING MACHINE. <div class="math">
\[ out[i] = \frac {in[i]} {\sum_{k=1}^N in[k]} \]</div>
 where <span class="math">\(in\)</span> is a (batchSize x dataDim) input vector, and <span class="math">\(out\)</span> is a (batchSize x dataDim) output vector.</p>
<p>The config file api is sum_to_one_norm_layer. </p>
2460
<p>Inherits from <a class="reference internal" href="#paddleclasspaddle_1_1Layer"><span class="std std-ref">paddle::Layer</span></a></p>
2461
<div class="breathe-sectiondef docutils container">
Y
Yu Yang 已提交
2462 2463 2464 2465 2466 2467 2468 2469 2470 2471 2472 2473 2474
<p class="breathe-sectiondef-title rubric">Public Functions</p>
<dl class="function">
<dt id="_CPPv2N6paddle17SumToOneNormLayer17SumToOneNormLayerERK11LayerConfig">
<span id="paddle::SumToOneNormLayer::SumToOneNormLayer__LayerConfigCR"></span><span class="target" id="paddleclasspaddle_1_1SumToOneNormLayer_1a6d8c303e58dff6cf3ab8a8782412c4e8"></span><code class="descname">SumToOneNormLayer</code><span class="sig-paren">(</span><em class="property">const</em> LayerConfig &amp;<em>config</em><span class="sig-paren">)</span><a class="headerlink" href="#_CPPv2N6paddle17SumToOneNormLayer17SumToOneNormLayerERK11LayerConfig" title="Permalink to this definition">¶</a></dt>
<dd></dd></dl>

<dl class="function">
<dt id="_CPPv2N6paddle17SumToOneNormLayerD0Ev">
<span id="paddle::SumToOneNormLayer::~SumToOneNormLayer"></span><span class="target" id="paddleclasspaddle_1_1SumToOneNormLayer_1a102ec10b07ae56ef954656f3bb2e7599"></span><code class="descname">~SumToOneNormLayer</code><span class="sig-paren">(</span><span class="sig-paren">)</span><a class="headerlink" href="#_CPPv2N6paddle17SumToOneNormLayerD0Ev" title="Permalink to this definition">¶</a></dt>
<dd></dd></dl>

<dl class="function">
<dt id="_CPPv2N6paddle17SumToOneNormLayer4initERK8LayerMapRK12ParameterMap">
2475
<span id="paddle::SumToOneNormLayer::init__LayerMapCR.ParameterMapCR"></span><span class="target" id="paddleclasspaddle_1_1SumToOneNormLayer_1acb6ec9f3ac60b6926dd6f66e81d6f474"></span>bool <code class="descname">init</code><span class="sig-paren">(</span><em class="property">const</em> LayerMap &amp;<em>layerMap</em>, <em class="property">const</em> <a class="reference internal" href="../../parameter/parameter/parameter.html#_CPPv2N6paddle12ParameterMapE" title="paddle::ParameterMap">ParameterMap</a> &amp;<em>parameterMap</em><span class="sig-paren">)</span><a class="headerlink" href="#_CPPv2N6paddle17SumToOneNormLayer4initERK8LayerMapRK12ParameterMap" title="Permalink to this definition">¶</a></dt>
Y
Yu Yang 已提交
2476 2477 2478 2479 2480
<dd><p>Intialization. For example, adding input layers from layerMap and parameterMap. </p>
</dd></dl>

<dl class="function">
<dt id="_CPPv2N6paddle17SumToOneNormLayer7forwardE8PassType">
2481
<span id="paddle::SumToOneNormLayer::forward__PassType"></span><span class="target" id="paddleclasspaddle_1_1SumToOneNormLayer_1a7092e518e3edceca74997a545b438dfe"></span>void <code class="descname">forward</code><span class="sig-paren">(</span>PassType <em>passType</em><span class="sig-paren">)</span><a class="headerlink" href="#_CPPv2N6paddle17SumToOneNormLayer7forwardE8PassType" title="Permalink to this definition">¶</a></dt>
Y
Yu Yang 已提交
2482 2483 2484 2485 2486
<dd><p>Forward propagation. All inherited implementation should call Layer::foward() function. </p>
</dd></dl>

<dl class="function">
<dt id="_CPPv2N6paddle17SumToOneNormLayer8backwardERK14UpdateCallback">
2487
<span id="paddle::SumToOneNormLayer::backward__UpdateCallbackCR"></span><span class="target" id="paddleclasspaddle_1_1SumToOneNormLayer_1ad34e2c481a5cee61e059ac026765a567"></span>void <code class="descname">backward</code><span class="sig-paren">(</span><em class="property">const</em> <a class="reference internal" href="../../parameter/parameter/parameter.html#_CPPv2N6paddle14UpdateCallbackE" title="paddle::UpdateCallback">UpdateCallback</a> &amp;<em>callback</em> = nullptr<span class="sig-paren">)</span><a class="headerlink" href="#_CPPv2N6paddle17SumToOneNormLayer8backwardERK14UpdateCallback" title="Permalink to this definition">¶</a></dt>
2488
<dd><p>Backward propagation. Should only be called after <a class="reference internal" href="#paddleclasspaddle_1_1Layer_1a12386b3f20dd731e7ceaa2c61667cbe1"><span class="std std-ref">Layer::forward()</span></a> function. </p>
Y
Yu Yang 已提交
2489 2490 2491
</dd></dl>

</div>
2492
<div class="breathe-sectiondef docutils container">
Y
Yu Yang 已提交
2493 2494 2495 2496 2497 2498 2499 2500 2501 2502 2503 2504 2505 2506 2507 2508 2509 2510 2511 2512 2513 2514 2515 2516 2517
<p class="breathe-sectiondef-title rubric">Protected Attributes</p>
<dl class="member">
<dt id="_CPPv2N6paddle17SumToOneNormLayer17reciprocalRowSum_E">
<span id="paddle::SumToOneNormLayer::reciprocalRowSum___MatrixPtr"></span><span class="target" id="paddleclasspaddle_1_1SumToOneNormLayer_1a9d822e1a4d4d9aac2ed3028f2ed3c809"></span><a class="reference internal" href="../../math/matrix/matrix.html#_CPPv2N6paddle9MatrixPtrE" title="paddle::MatrixPtr">MatrixPtr</a> <code class="descname">reciprocalRowSum_</code><a class="headerlink" href="#_CPPv2N6paddle17SumToOneNormLayer17reciprocalRowSum_E" title="Permalink to this definition">¶</a></dt>
<dd><p>reciprocalRowSum_ = <span class="math">\(1 / \sum_{k=1}^N in[k]\)</span> </p>
</dd></dl>

<dl class="member">
<dt id="_CPPv2N6paddle17SumToOneNormLayer7dotSum_E">
<span id="paddle::SumToOneNormLayer::dotSum___MatrixPtr"></span><span class="target" id="paddleclasspaddle_1_1SumToOneNormLayer_1af2ae1db64f71abe865bc55b9d04e6bd9"></span><a class="reference internal" href="../../math/matrix/matrix.html#_CPPv2N6paddle9MatrixPtrE" title="paddle::MatrixPtr">MatrixPtr</a> <code class="descname">dotSum_</code><a class="headerlink" href="#_CPPv2N6paddle17SumToOneNormLayer7dotSum_E" title="Permalink to this definition">¶</a></dt>
<dd><p>dotSum = output_.grad <span class="math">\(.*\)</span> output_.value </p>
</dd></dl>

</div>
</dd></dl>

</div>
</div>
<div class="section" id="activation-layer">
<h1>Activation Layer<a class="headerlink" href="#activation-layer" title="Permalink to this headline">¶</a></h1>
<div class="section" id="parameterrelulayer">
<h2>ParameterReluLayer<a class="headerlink" href="#parameterrelulayer" title="Permalink to this headline">¶</a></h2>
<dl class="class">
<dt id="_CPPv2N6paddle18ParameterReluLayerE">
<span id="paddle::ParameterReluLayer"></span><span class="target" id="paddleclasspaddle_1_1ParameterReluLayer"></span><em class="property">class </em><code class="descclassname">paddle::</code><code class="descname">ParameterReluLayer</code><a class="headerlink" href="#_CPPv2N6paddle18ParameterReluLayerE" title="Permalink to this definition">¶</a></dt>
2518 2519
<dd><p><a class="reference internal" href="#paddleclasspaddle_1_1ParameterReluLayer"><span class="std std-ref">ParameterReluLayer</span></a> active inputs with learnable parameter weight_. forward: <div class="math">
\[ y = x &gt; 0 ? x : w .* x \]</div>
Y
Yu Yang 已提交
2520 2521 2522
 backward: <div class="math">
\[\begin{split} dx = x &gt; 0 ? dy : w .* dy \\ dw = x &gt; 0 ? 0 : dy.*x \end{split}\]</div>
 Here, x is the input, w is the weight, y is the output. dx, dw, dy is the gradient. </p>
2523
<p>Inherits from <a class="reference internal" href="#paddleclasspaddle_1_1Layer"><span class="std std-ref">paddle::Layer</span></a></p>
2524
<div class="breathe-sectiondef docutils container">
Y
Yu Yang 已提交
2525 2526 2527 2528 2529 2530 2531 2532 2533 2534 2535 2536 2537
<p class="breathe-sectiondef-title rubric">Public Functions</p>
<dl class="function">
<dt id="_CPPv2N6paddle18ParameterReluLayer18ParameterReluLayerERK11LayerConfig">
<span id="paddle::ParameterReluLayer::ParameterReluLayer__LayerConfigCR"></span><span class="target" id="paddleclasspaddle_1_1ParameterReluLayer_1a0ac9c34b2882d97b758783ca47551cb6"></span><code class="descname">ParameterReluLayer</code><span class="sig-paren">(</span><em class="property">const</em> LayerConfig &amp;<em>config</em><span class="sig-paren">)</span><a class="headerlink" href="#_CPPv2N6paddle18ParameterReluLayer18ParameterReluLayerERK11LayerConfig" title="Permalink to this definition">¶</a></dt>
<dd></dd></dl>

<dl class="function">
<dt id="_CPPv2N6paddle18ParameterReluLayerD0Ev">
<span id="paddle::ParameterReluLayer::~ParameterReluLayer"></span><span class="target" id="paddleclasspaddle_1_1ParameterReluLayer_1a7544b57e57adacdefa17ecb917eb0d7f"></span><code class="descname">~ParameterReluLayer</code><span class="sig-paren">(</span><span class="sig-paren">)</span><a class="headerlink" href="#_CPPv2N6paddle18ParameterReluLayerD0Ev" title="Permalink to this definition">¶</a></dt>
<dd></dd></dl>

<dl class="function">
<dt id="_CPPv2N6paddle18ParameterReluLayer4initERK8LayerMapRK12ParameterMap">
2538
<span id="paddle::ParameterReluLayer::init__LayerMapCR.ParameterMapCR"></span><span class="target" id="paddleclasspaddle_1_1ParameterReluLayer_1afce30da21f9c2b9ed23afc7782f0033c"></span>bool <code class="descname">init</code><span class="sig-paren">(</span><em class="property">const</em> LayerMap &amp;<em>layerMap</em>, <em class="property">const</em> <a class="reference internal" href="../../parameter/parameter/parameter.html#_CPPv2N6paddle12ParameterMapE" title="paddle::ParameterMap">ParameterMap</a> &amp;<em>parameterMap</em><span class="sig-paren">)</span><a class="headerlink" href="#_CPPv2N6paddle18ParameterReluLayer4initERK8LayerMapRK12ParameterMap" title="Permalink to this definition">¶</a></dt>
Y
Yu Yang 已提交
2539 2540 2541 2542 2543
<dd><p>Intialization. For example, adding input layers from layerMap and parameterMap. </p>
</dd></dl>

<dl class="function">
<dt id="_CPPv2N6paddle18ParameterReluLayer7forwardE8PassType">
2544
<span id="paddle::ParameterReluLayer::forward__PassType"></span><span class="target" id="paddleclasspaddle_1_1ParameterReluLayer_1a1db2ca1711e5f6ce5ee26b332e2c2000"></span>void <code class="descname">forward</code><span class="sig-paren">(</span>PassType <em>passType</em><span class="sig-paren">)</span><a class="headerlink" href="#_CPPv2N6paddle18ParameterReluLayer7forwardE8PassType" title="Permalink to this definition">¶</a></dt>
Y
Yu Yang 已提交
2545 2546 2547 2548 2549
<dd><p>Forward propagation. All inherited implementation should call Layer::foward() function. </p>
</dd></dl>

<dl class="function">
<dt id="_CPPv2N6paddle18ParameterReluLayer8backwardERK14UpdateCallback">
2550
<span id="paddle::ParameterReluLayer::backward__UpdateCallbackCR"></span><span class="target" id="paddleclasspaddle_1_1ParameterReluLayer_1a2ae1c4aceaabcf5d78ae0222af9494c6"></span>void <code class="descname">backward</code><span class="sig-paren">(</span><em class="property">const</em> <a class="reference internal" href="../../parameter/parameter/parameter.html#_CPPv2N6paddle14UpdateCallbackE" title="paddle::UpdateCallback">UpdateCallback</a> &amp;<em>callback</em> = nullptr<span class="sig-paren">)</span><a class="headerlink" href="#_CPPv2N6paddle18ParameterReluLayer8backwardERK14UpdateCallback" title="Permalink to this definition">¶</a></dt>
2551
<dd><p>Backward propagation. Should only be called after <a class="reference internal" href="#paddleclasspaddle_1_1Layer_1a12386b3f20dd731e7ceaa2c61667cbe1"><span class="std std-ref">Layer::forward()</span></a> function. </p>
Y
Yu Yang 已提交
2552 2553 2554
</dd></dl>

</div>
2555
<div class="breathe-sectiondef docutils container">
Y
Yu Yang 已提交
2556 2557 2558 2559 2560 2561 2562 2563 2564 2565 2566 2567 2568 2569 2570 2571 2572 2573 2574 2575 2576 2577 2578 2579 2580 2581 2582 2583 2584 2585
<p class="breathe-sectiondef-title rubric">Protected Attributes</p>
<dl class="member">
<dt id="_CPPv2N6paddle18ParameterReluLayer7weight_E">
<span id="paddle::ParameterReluLayer::weight___std::unique_ptr:Weight:"></span><span class="target" id="paddleclasspaddle_1_1ParameterReluLayer_1a0d086bbce408a879c17e49d81abbb890"></span>std::unique_ptr&lt;<a class="reference internal" href="../../parameter/parameter/parameter.html#_CPPv2N6paddle6WeightE" title="paddle::Weight">Weight</a>&gt; <code class="descname">weight_</code><a class="headerlink" href="#_CPPv2N6paddle18ParameterReluLayer7weight_E" title="Permalink to this definition">¶</a></dt>
<dd></dd></dl>

<dl class="member">
<dt id="_CPPv2N6paddle18ParameterReluLayer11partialSum_E">
<span id="paddle::ParameterReluLayer::partialSum___s"></span><span class="target" id="paddleclasspaddle_1_1ParameterReluLayer_1a22f3d3d5e12a21bc6382d51f96307560"></span>size_t <code class="descname">partialSum_</code><a class="headerlink" href="#_CPPv2N6paddle18ParameterReluLayer11partialSum_E" title="Permalink to this definition">¶</a></dt>
<dd><p>partialSum_ makes a group of inputs share same weights, </p>
<p><ul class="simple">
<li>partialSum_ = 1: element wise activation: each element has a weight_,</li>
<li>partialSum_ = number of elements in one channel, channels wise parameter activation, elements in a channel share same weight_,</li>
<li>partialSum_ = number of outputs all elements share same weight_, </li>
</ul>
</p>
</dd></dl>

</div>
</dd></dl>

</div>
</div>
<div class="section" id="recurrent-layers">
<h1>Recurrent Layers<a class="headerlink" href="#recurrent-layers" title="Permalink to this headline">¶</a></h1>
<div class="section" id="recurrentlayer">
<h2>RecurrentLayer<a class="headerlink" href="#recurrentlayer" title="Permalink to this headline">¶</a></h2>
<dl class="class">
<dt id="_CPPv2N6paddle14RecurrentLayerE">
<span id="paddle::RecurrentLayer"></span><span class="target" id="paddleclasspaddle_1_1RecurrentLayer"></span><em class="property">class </em><code class="descclassname">paddle::</code><code class="descname">RecurrentLayer</code><a class="headerlink" href="#_CPPv2N6paddle14RecurrentLayerE" title="Permalink to this definition">¶</a></dt>
2586
<dd><p><a class="reference internal" href="#paddleclasspaddle_1_1RecurrentLayer"><span class="std std-ref">RecurrentLayer</span></a> takes 1 input layer. The output size is the same with input layer. For each sequence [start, end] it performs the following computation: <div class="math">
Y
Yu Yang 已提交
2587 2588 2589 2590
\[\begin{split} out_{i} = act(in_{i}) \ \ \text{for} \ i = start \\ out_{i} = act(in_{i} + out_{i-1} * W) \ \ \text{for} \ start &lt; i &lt;= end \end{split}\]</div>
 If reversed is true, the order is reversed: <div class="math">
\[\begin{split} out_{i} = act(in_{i}) \ \ \text{for} \ i = end \\ out_{i} = act(in_{i} + out_{i+1} * W) \ \ \text{for} \ start &lt;= i &lt; end \end{split}\]</div>
 There are two methods to calculate rnn. One way is to compute rnn one sequence by one sequence. The other way is to reorganize the input into batches, then compute rnn one batch by one batch. Users can select them by rnn_use_batch flag. </p>
2591
<p>Inherits from <a class="reference internal" href="#paddleclasspaddle_1_1Layer"><span class="std std-ref">paddle::Layer</span></a></p>
2592
<div class="breathe-sectiondef docutils container">
Y
Yu Yang 已提交
2593 2594 2595 2596 2597 2598 2599 2600
<p class="breathe-sectiondef-title rubric">Public Functions</p>
<dl class="function">
<dt id="_CPPv2N6paddle14RecurrentLayer14RecurrentLayerERK11LayerConfig">
<span id="paddle::RecurrentLayer::RecurrentLayer__LayerConfigCR"></span><span class="target" id="paddleclasspaddle_1_1RecurrentLayer_1a63b77781725525b2414c823ad9f95feb"></span><code class="descname">RecurrentLayer</code><span class="sig-paren">(</span><em class="property">const</em> LayerConfig &amp;<em>config</em><span class="sig-paren">)</span><a class="headerlink" href="#_CPPv2N6paddle14RecurrentLayer14RecurrentLayerERK11LayerConfig" title="Permalink to this definition">¶</a></dt>
<dd></dd></dl>

<dl class="function">
<dt id="_CPPv2N6paddle14RecurrentLayer4initERK8LayerMapRK12ParameterMap">
2601
<span id="paddle::RecurrentLayer::init__LayerMapCR.ParameterMapCR"></span><span class="target" id="paddleclasspaddle_1_1RecurrentLayer_1a99f001c21cba60340f7c0238a559eaaa"></span>bool <code class="descname">init</code><span class="sig-paren">(</span><em class="property">const</em> LayerMap &amp;<em>layerMap</em>, <em class="property">const</em> <a class="reference internal" href="../../parameter/parameter/parameter.html#_CPPv2N6paddle12ParameterMapE" title="paddle::ParameterMap">ParameterMap</a> &amp;<em>parameterMap</em><span class="sig-paren">)</span><a class="headerlink" href="#_CPPv2N6paddle14RecurrentLayer4initERK8LayerMapRK12ParameterMap" title="Permalink to this definition">¶</a></dt>
Y
Yu Yang 已提交
2602 2603 2604 2605 2606
<dd><p>Intialization. For example, adding input layers from layerMap and parameterMap. </p>
</dd></dl>

<dl class="function">
<dt id="_CPPv2N6paddle14RecurrentLayer7forwardE8PassType">
2607
<span id="paddle::RecurrentLayer::forward__PassType"></span><span class="target" id="paddleclasspaddle_1_1RecurrentLayer_1a9d1232412ae739901d4c5795e469d6f2"></span>void <code class="descname">forward</code><span class="sig-paren">(</span>PassType <em>passType</em><span class="sig-paren">)</span><a class="headerlink" href="#_CPPv2N6paddle14RecurrentLayer7forwardE8PassType" title="Permalink to this definition">¶</a></dt>
Y
Yu Yang 已提交
2608 2609 2610 2611 2612
<dd><p>Forward propagation. All inherited implementation should call Layer::foward() function. </p>
</dd></dl>

<dl class="function">
<dt id="_CPPv2N6paddle14RecurrentLayer8backwardERK14UpdateCallback">
2613
<span id="paddle::RecurrentLayer::backward__UpdateCallbackCR"></span><span class="target" id="paddleclasspaddle_1_1RecurrentLayer_1a3146f87e0c7be24471f324f8de280cd7"></span>void <code class="descname">backward</code><span class="sig-paren">(</span><em class="property">const</em> <a class="reference internal" href="../../parameter/parameter/parameter.html#_CPPv2N6paddle14UpdateCallbackE" title="paddle::UpdateCallback">UpdateCallback</a> &amp;<em>callback</em><span class="sig-paren">)</span><a class="headerlink" href="#_CPPv2N6paddle14RecurrentLayer8backwardERK14UpdateCallback" title="Permalink to this definition">¶</a></dt>
2614
<dd><p>Backward propagation. Should only be called after <a class="reference internal" href="#paddleclasspaddle_1_1Layer_1a12386b3f20dd731e7ceaa2c61667cbe1"><span class="std std-ref">Layer::forward()</span></a> function. </p>
Y
Yu Yang 已提交
2615 2616 2617 2618
</dd></dl>

<dl class="function">
<dt id="_CPPv2N6paddle14RecurrentLayer10resetStateEv">
2619
<span id="paddle::RecurrentLayer::resetState"></span><span class="target" id="paddleclasspaddle_1_1RecurrentLayer_1a18ca63523ed33cf8608d04cfb0136634"></span>void <code class="descname">resetState</code><span class="sig-paren">(</span><span class="sig-paren">)</span><a class="headerlink" href="#_CPPv2N6paddle14RecurrentLayer10resetStateEv" title="Permalink to this definition">¶</a></dt>
2620 2621
<dd><p>Reset the internal state variables. Allocate them if they have not been allocated. This function need to called before <a class="reference internal" href="#paddleclasspaddle_1_1Layer_1a12386b3f20dd731e7ceaa2c61667cbe1"><span class="std std-ref">Layer::forward()</span></a> for generating sequence.</p>
<p>This is used for sequence generation. When generating sequence, the calculation at current timestamp depends on the state from previous timestamp. The model needs to keep the information about the previous timestamp in the state variables. Layers such as <a class="reference internal" href="#paddleclasspaddle_1_1RecurrentLayer"><span class="std std-ref">RecurrentLayer</span></a>, <a class="reference internal" href="#paddleclasspaddle_1_1LstmLayer"><span class="std std-ref">LstmLayer</span></a> and ContextLayer have state variables. </p>
Y
Yu Yang 已提交
2622 2623 2624 2625
</dd></dl>

<dl class="function">
<dt id="_CPPv2N6paddle14RecurrentLayer8setStateE13LayerStatePtr">
2626
<span id="paddle::RecurrentLayer::setState__LayerStatePtr"></span><span class="target" id="paddleclasspaddle_1_1RecurrentLayer_1a84679de9a0354667e78911bf06912f9f"></span>void <code class="descname">setState</code><span class="sig-paren">(</span>LayerStatePtr <em>state</em><span class="sig-paren">)</span><a class="headerlink" href="#_CPPv2N6paddle14RecurrentLayer8setStateE13LayerStatePtr" title="Permalink to this definition">¶</a></dt>
Y
Yu Yang 已提交
2627 2628 2629 2630 2631
<dd><p>Set layer state. </p>
</dd></dl>

<dl class="function">
<dt id="_CPPv2N6paddle14RecurrentLayer8getStateEv">
2632
<span id="paddle::RecurrentLayer::getState"></span><span class="target" id="paddleclasspaddle_1_1RecurrentLayer_1ab506ee6ae00d3a727ff8049e279a04a9"></span>LayerStatePtr <code class="descname">getState</code><span class="sig-paren">(</span><span class="sig-paren">)</span><a class="headerlink" href="#_CPPv2N6paddle14RecurrentLayer8getStateEv" title="Permalink to this definition">¶</a></dt>
Y
Yu Yang 已提交
2633 2634 2635 2636 2637 2638 2639 2640
<dd><p>Get layer state. <dl class="docutils">
<dt><strong>Return</strong></dt>
<dd>A copy of internal state. </dd>
</dl>
</p>
</dd></dl>

</div>
2641
<div class="breathe-sectiondef docutils container">
Y
Yu Yang 已提交
2642 2643 2644 2645
<p class="breathe-sectiondef-title rubric">Protected Functions</p>
<dl class="function">
<dt id="_CPPv2N6paddle14RecurrentLayer15forwardSequenceEi6size_tPKi">
<span id="paddle::RecurrentLayer::forwardSequence__i.s.iCP"></span><span class="target" id="paddleclasspaddle_1_1RecurrentLayer_1a90c7839371bfd614ebc123783d404c6e"></span>void <code class="descname">forwardSequence</code><span class="sig-paren">(</span>int <em>batchSize</em>, size_t <em>numSequences</em>, <em class="property">const</em> int *<em>starts</em><span class="sig-paren">)</span><a class="headerlink" href="#_CPPv2N6paddle14RecurrentLayer15forwardSequenceEi6size_tPKi" title="Permalink to this definition">¶</a></dt>
Y
Yu Yang 已提交
2646 2647 2648
<dd><p>If user do not set rnn_use_batch=true, it will compute rnn forward one sequence by one sequence in default. </p>
<p><dl class="docutils">
<dt><strong>Parameters</strong></dt>
2649 2650 2651 2652
<dd><ul class="breatheparameterlist first last simple">
<li><code class="docutils literal"><span class="pre">batchSize</span></code>: Total words number of all samples in this batch. </li>
<li><code class="docutils literal"><span class="pre">numSequences</span></code>: The sample number. </li>
<li><code class="docutils literal"><span class="pre">starts</span></code>: Each start position of each samples. </li>
Y
Yu Yang 已提交
2653 2654 2655 2656 2657
</ul>
</dd>
</dl>
</p>
</dd></dl>
Y
Yu Yang 已提交
2658 2659 2660 2661

<dl class="function">
<dt id="_CPPv2N6paddle14RecurrentLayer18forwardOneSequenceEii">
<span id="paddle::RecurrentLayer::forwardOneSequence__i.i"></span><span class="target" id="paddleclasspaddle_1_1RecurrentLayer_1a30cd10d03d577a2525d540499a9cdd9e"></span>void <code class="descname">forwardOneSequence</code><span class="sig-paren">(</span>int <em>start</em>, int <em>length</em><span class="sig-paren">)</span><a class="headerlink" href="#_CPPv2N6paddle14RecurrentLayer18forwardOneSequenceEii" title="Permalink to this definition">¶</a></dt>
Y
Yu Yang 已提交
2662 2663 2664
<dd><p>Compute rnn forward by one sequence. </p>
<p><dl class="docutils">
<dt><strong>Parameters</strong></dt>
2665 2666 2667
<dd><ul class="breatheparameterlist first last simple">
<li><code class="docutils literal"><span class="pre">start</span></code>: The start position of this sequence (or sample). </li>
<li><code class="docutils literal"><span class="pre">length</span></code>: The length of this sequence (or sample), namely the words number of this sequence. </li>
Y
Yu Yang 已提交
2668 2669 2670 2671 2672
</ul>
</dd>
</dl>
</p>
</dd></dl>
Y
Yu Yang 已提交
2673 2674 2675 2676

<dl class="function">
<dt id="_CPPv2N6paddle14RecurrentLayer16backwardSequenceEi6size_tPKi">
<span id="paddle::RecurrentLayer::backwardSequence__i.s.iCP"></span><span class="target" id="paddleclasspaddle_1_1RecurrentLayer_1adcbb881ce7785dc4afe080a4dfb33543"></span>void <code class="descname">backwardSequence</code><span class="sig-paren">(</span>int <em>batchSize</em>, size_t <em>numSequences</em>, <em class="property">const</em> int *<em>starts</em><span class="sig-paren">)</span><a class="headerlink" href="#_CPPv2N6paddle14RecurrentLayer16backwardSequenceEi6size_tPKi" title="Permalink to this definition">¶</a></dt>
Y
Yu Yang 已提交
2677 2678 2679
<dd><p>Compute rnn backward one sequence by onesequence. </p>
<p><dl class="docutils">
<dt><strong>Parameters</strong></dt>
2680 2681 2682 2683
<dd><ul class="breatheparameterlist first last simple">
<li><code class="docutils literal"><span class="pre">batchSize</span></code>: Total words number of all samples in this batch. </li>
<li><code class="docutils literal"><span class="pre">numSequences</span></code>: The sample number. </li>
<li><code class="docutils literal"><span class="pre">starts</span></code>: Each start position of each samples. </li>
Y
Yu Yang 已提交
2684 2685 2686 2687 2688
</ul>
</dd>
</dl>
</p>
</dd></dl>
Y
Yu Yang 已提交
2689 2690 2691 2692

<dl class="function">
<dt id="_CPPv2N6paddle14RecurrentLayer19backwardOneSequenceEii">
<span id="paddle::RecurrentLayer::backwardOneSequence__i.i"></span><span class="target" id="paddleclasspaddle_1_1RecurrentLayer_1a257c8ff72854f1897e07683b5d3c3c55"></span>void <code class="descname">backwardOneSequence</code><span class="sig-paren">(</span>int <em>start</em>, int <em>length</em><span class="sig-paren">)</span><a class="headerlink" href="#_CPPv2N6paddle14RecurrentLayer19backwardOneSequenceEii" title="Permalink to this definition">¶</a></dt>
Y
Yu Yang 已提交
2693 2694 2695
<dd><p>Compute rnn backward by one sequence. </p>
<p><dl class="docutils">
<dt><strong>Parameters</strong></dt>
2696 2697 2698
<dd><ul class="breatheparameterlist first last simple">
<li><code class="docutils literal"><span class="pre">start</span></code>: The start position of this sequence (or sample). </li>
<li><code class="docutils literal"><span class="pre">length</span></code>: The length of this sequence (or sample), namely the words number of this sequence. </li>
Y
Yu Yang 已提交
2699 2700 2701 2702 2703
</ul>
</dd>
</dl>
</p>
</dd></dl>
Y
Yu Yang 已提交
2704 2705 2706 2707

<dl class="function">
<dt id="_CPPv2N6paddle14RecurrentLayer12forwardBatchEi6size_tPKi">
<span id="paddle::RecurrentLayer::forwardBatch__i.s.iCP"></span><span class="target" id="paddleclasspaddle_1_1RecurrentLayer_1a5918b8a5a9da4654652f899ea0710ef8"></span>void <code class="descname">forwardBatch</code><span class="sig-paren">(</span>int <em>batchSize</em>, size_t <em>numSequences</em>, <em class="property">const</em> int *<em>starts</em><span class="sig-paren">)</span><a class="headerlink" href="#_CPPv2N6paddle14RecurrentLayer12forwardBatchEi6size_tPKi" title="Permalink to this definition">¶</a></dt>
2708
<dd><p>Reorganize input into batches and compute rnn forward batch by batch. It will convert batch shape to sequence after finishing forward. The batch info can refer to <a class="reference internal" href="#paddleclasspaddle_1_1SequenceToBatch"><span class="std std-ref">SequenceToBatch</span></a> class. </p>
Y
Yu Yang 已提交
2709 2710
<p><dl class="docutils">
<dt><strong>Parameters</strong></dt>
2711 2712 2713 2714
<dd><ul class="breatheparameterlist first last simple">
<li><code class="docutils literal"><span class="pre">batchSize</span></code>: Total words number of all samples in this batch. </li>
<li><code class="docutils literal"><span class="pre">numSequences</span></code>: The sample number. </li>
<li><code class="docutils literal"><span class="pre">starts</span></code>: Each start position of each samples. </li>
Y
Yu Yang 已提交
2715 2716 2717 2718 2719
</ul>
</dd>
</dl>
</p>
</dd></dl>
Y
Yu Yang 已提交
2720 2721 2722 2723

<dl class="function">
<dt id="_CPPv2N6paddle14RecurrentLayer13backwardBatchEi6size_tPKi">
<span id="paddle::RecurrentLayer::backwardBatch__i.s.iCP"></span><span class="target" id="paddleclasspaddle_1_1RecurrentLayer_1afe122c89654299ea0a68b626d1741c28"></span>void <code class="descname">backwardBatch</code><span class="sig-paren">(</span>int <em>batchSize</em>, size_t <em>numSequences</em>, <em class="property">const</em> int *<em>starts</em><span class="sig-paren">)</span><a class="headerlink" href="#_CPPv2N6paddle14RecurrentLayer13backwardBatchEi6size_tPKi" title="Permalink to this definition">¶</a></dt>
Y
Yu Yang 已提交
2724 2725 2726
<dd><p>Reorganize input into batches and compute rnn forward batch by batch. </p>
<p><dl class="docutils">
<dt><strong>Parameters</strong></dt>
2727 2728 2729 2730
<dd><ul class="breatheparameterlist first last simple">
<li><code class="docutils literal"><span class="pre">batchSize</span></code>: Total words number of all samples in this batch. </li>
<li><code class="docutils literal"><span class="pre">numSequences</span></code>: The sample number. </li>
<li><code class="docutils literal"><span class="pre">starts</span></code>: Each start position of each samples. </li>
Y
Yu Yang 已提交
2731 2732 2733 2734 2735
</ul>
</dd>
</dl>
</p>
</dd></dl>
Y
Yu Yang 已提交
2736 2737

</div>
2738
<div class="breathe-sectiondef docutils container">
Y
Yu Yang 已提交
2739 2740 2741 2742 2743 2744 2745 2746 2747 2748 2749 2750 2751 2752
<p class="breathe-sectiondef-title rubric">Protected Attributes</p>
<dl class="member">
<dt id="_CPPv2N6paddle14RecurrentLayer7weight_E">
<span id="paddle::RecurrentLayer::weight___std::unique_ptr:Weight:"></span><span class="target" id="paddleclasspaddle_1_1RecurrentLayer_1ac14a9979f7c9ffe7c0d794185e89c783"></span>std::unique_ptr&lt;<a class="reference internal" href="../../parameter/parameter/parameter.html#_CPPv2N6paddle6WeightE" title="paddle::Weight">Weight</a>&gt; <code class="descname">weight_</code><a class="headerlink" href="#_CPPv2N6paddle14RecurrentLayer7weight_E" title="Permalink to this definition">¶</a></dt>
<dd></dd></dl>

<dl class="member">
<dt id="_CPPv2N6paddle14RecurrentLayer5bias_E">
<span id="paddle::RecurrentLayer::bias___std::unique_ptr:Weight:"></span><span class="target" id="paddleclasspaddle_1_1RecurrentLayer_1a5ba280e13a530c829135ff95e152b765"></span>std::unique_ptr&lt;<a class="reference internal" href="../../parameter/parameter/parameter.html#_CPPv2N6paddle6WeightE" title="paddle::Weight">Weight</a>&gt; <code class="descname">bias_</code><a class="headerlink" href="#_CPPv2N6paddle14RecurrentLayer5bias_E" title="Permalink to this definition">¶</a></dt>
<dd></dd></dl>

<dl class="member">
<dt id="_CPPv2N6paddle14RecurrentLayer12frameOutput_E">
<span id="paddle::RecurrentLayer::frameOutput___std::vector:Argument:"></span><span class="target" id="paddleclasspaddle_1_1RecurrentLayer_1ae16040832362bdfc73cff510b377dd49"></span>std::vector&lt;<a class="reference internal" href="../../parameter/parameter/parameter.html#_CPPv2N6paddle8ArgumentE" title="paddle::Argument">Argument</a>&gt; <code class="descname">frameOutput_</code><a class="headerlink" href="#_CPPv2N6paddle14RecurrentLayer12frameOutput_E" title="Permalink to this definition">¶</a></dt>
Y
Yu Yang 已提交
2753 2754
<dd><p>frameOutput_[i] is used to hold the i-th sample of output_ </p>
</dd></dl>
Y
Yu Yang 已提交
2755 2756 2757 2758 2759 2760 2761 2762 2763

<dl class="member">
<dt id="_CPPv2N6paddle14RecurrentLayer11prevOutput_E">
<span id="paddle::RecurrentLayer::prevOutput___MatrixPtr"></span><span class="target" id="paddleclasspaddle_1_1RecurrentLayer_1a8fa6a54eb1b08db95ff33b3fda59d292"></span><a class="reference internal" href="../../math/matrix/matrix.html#_CPPv2N6paddle9MatrixPtrE" title="paddle::MatrixPtr">MatrixPtr</a> <code class="descname">prevOutput_</code><a class="headerlink" href="#_CPPv2N6paddle14RecurrentLayer11prevOutput_E" title="Permalink to this definition">¶</a></dt>
<dd></dd></dl>

<dl class="member">
<dt id="_CPPv2N6paddle14RecurrentLayer9reversed_E">
<span id="paddle::RecurrentLayer::reversed___b"></span><span class="target" id="paddleclasspaddle_1_1RecurrentLayer_1a27891ca7f195310e2fb5168fa02b6af1"></span>bool <code class="descname">reversed_</code><a class="headerlink" href="#_CPPv2N6paddle14RecurrentLayer9reversed_E" title="Permalink to this definition">¶</a></dt>
Y
Yu Yang 已提交
2764 2765
<dd><p>Whether compute rnn by reverse. </p>
</dd></dl>
Y
Yu Yang 已提交
2766 2767 2768 2769

<dl class="member">
<dt id="_CPPv2N6paddle14RecurrentLayer11batchValue_E">
<span id="paddle::RecurrentLayer::batchValue___std::unique_ptr:SequenceToBatch:"></span><span class="target" id="paddleclasspaddle_1_1RecurrentLayer_1a04665ba8307238a216b2c44c50da2926"></span>std::unique_ptr&lt;<a class="reference internal" href="#_CPPv2N6paddle15SequenceToBatchE" title="paddle::SequenceToBatch">SequenceToBatch</a>&gt; <code class="descname">batchValue_</code><a class="headerlink" href="#_CPPv2N6paddle14RecurrentLayer11batchValue_E" title="Permalink to this definition">¶</a></dt>
Y
Yu Yang 已提交
2770 2771
<dd><p>If compute batch by batch, batchValue_ will be used to save the reorganized input value. </p>
</dd></dl>
Y
Yu Yang 已提交
2772 2773 2774 2775

<dl class="member">
<dt id="_CPPv2N6paddle14RecurrentLayer10batchGrad_E">
<span id="paddle::RecurrentLayer::batchGrad___std::unique_ptr:SequenceToBatch:"></span><span class="target" id="paddleclasspaddle_1_1RecurrentLayer_1a8a82c9e0f3c6269de017b5ea22dae0ed"></span>std::unique_ptr&lt;<a class="reference internal" href="#_CPPv2N6paddle15SequenceToBatchE" title="paddle::SequenceToBatch">SequenceToBatch</a>&gt; <code class="descname">batchGrad_</code><a class="headerlink" href="#_CPPv2N6paddle14RecurrentLayer10batchGrad_E" title="Permalink to this definition">¶</a></dt>
Y
Yu Yang 已提交
2776 2777
<dd><p>If compute batch by batch, batchGrad_ will be used to save the gradient with respect to reorganized input value. </p>
</dd></dl>
Y
Yu Yang 已提交
2778 2779 2780 2781 2782 2783 2784 2785 2786 2787

</div>
</dd></dl>

</div>
<div class="section" id="sequencetobatch">
<h2>SequenceToBatch<a class="headerlink" href="#sequencetobatch" title="Permalink to this headline">¶</a></h2>
<dl class="class">
<dt id="_CPPv2N6paddle15SequenceToBatchE">
<span id="paddle::SequenceToBatch"></span><span class="target" id="paddleclasspaddle_1_1SequenceToBatch"></span><em class="property">class </em><code class="descclassname">paddle::</code><code class="descname">SequenceToBatch</code><a class="headerlink" href="#_CPPv2N6paddle15SequenceToBatchE" title="Permalink to this definition">¶</a></dt>
2788
<dd><div class="breathe-sectiondef docutils container">
Y
Yu Yang 已提交
2789 2790 2791 2792 2793 2794 2795 2796 2797 2798 2799 2800 2801 2802 2803 2804 2805 2806 2807 2808 2809 2810 2811 2812 2813 2814 2815
<p class="breathe-sectiondef-title rubric">Public Functions</p>
<dl class="function">
<dt id="_CPPv2N6paddle15SequenceToBatch15SequenceToBatchEb">
<span id="paddle::SequenceToBatch::SequenceToBatch__b"></span><span class="target" id="paddleclasspaddle_1_1SequenceToBatch_1abcd1977bcb75a3f6ac38fe30a2083d86"></span><code class="descname">SequenceToBatch</code><span class="sig-paren">(</span>bool <em>useGpu</em><span class="sig-paren">)</span><a class="headerlink" href="#_CPPv2N6paddle15SequenceToBatch15SequenceToBatchEb" title="Permalink to this definition">¶</a></dt>
<dd></dd></dl>

<dl class="function">
<dt id="_CPPv2N6paddle15SequenceToBatch19resizeOrCreateBatchEi6size_tPKibb">
<span id="paddle::SequenceToBatch::resizeOrCreateBatch__i.s.iCP.b.b"></span><span class="target" id="paddleclasspaddle_1_1SequenceToBatch_1a28a7ccf68dc1e41883df51e9b775c261"></span>void <code class="descname">resizeOrCreateBatch</code><span class="sig-paren">(</span>int <em>batchSize</em>, size_t <em>numSequences</em>, <em class="property">const</em> int *<em>seqStarts</em>, bool <em>reversed</em>, bool <em>prevBatchState</em> = false<span class="sig-paren">)</span><a class="headerlink" href="#_CPPv2N6paddle15SequenceToBatch19resizeOrCreateBatchEi6size_tPKibb" title="Permalink to this definition">¶</a></dt>
<dd></dd></dl>

<dl class="function">
<dt id="_CPPv2N6paddle15SequenceToBatch4copyER6MatrixR6Matrixb">
<span id="paddle::SequenceToBatch::copy__MatrixR.MatrixR.b"></span><span class="target" id="paddleclasspaddle_1_1SequenceToBatch_1af9014a67cae61b27e189f8d76ff58c0f"></span>void <code class="descname">copy</code><span class="sig-paren">(</span><a class="reference internal" href="../../math/matrix/matrix.html#_CPPv2N6paddle6MatrixE" title="paddle::Matrix">Matrix</a> &amp;<em>seqValue</em>, <a class="reference internal" href="../../math/matrix/matrix.html#_CPPv2N6paddle6MatrixE" title="paddle::Matrix">Matrix</a> &amp;<em>batchValue</em>, bool <em>seq2batch</em><span class="sig-paren">)</span><a class="headerlink" href="#_CPPv2N6paddle15SequenceToBatch4copyER6MatrixR6Matrixb" title="Permalink to this definition">¶</a></dt>
<dd></dd></dl>

<dl class="function">
<dt id="_CPPv2N6paddle15SequenceToBatch3addER6MatrixR6Matrixb">
<span id="paddle::SequenceToBatch::add__MatrixR.MatrixR.b"></span><span class="target" id="paddleclasspaddle_1_1SequenceToBatch_1aea08d566a0faceeb9838f064e012387b"></span>void <code class="descname">add</code><span class="sig-paren">(</span><a class="reference internal" href="../../math/matrix/matrix.html#_CPPv2N6paddle6MatrixE" title="paddle::Matrix">Matrix</a> &amp;<em>seqValue</em>, <a class="reference internal" href="../../math/matrix/matrix.html#_CPPv2N6paddle6MatrixE" title="paddle::Matrix">Matrix</a> &amp;<em>batchValue</em>, bool <em>seq2batch</em><span class="sig-paren">)</span><a class="headerlink" href="#_CPPv2N6paddle15SequenceToBatch3addER6MatrixR6Matrixb" title="Permalink to this definition">¶</a></dt>
<dd></dd></dl>

<dl class="function">
<dt id="_CPPv2N6paddle15SequenceToBatch13getBatchValueER6Matrixii">
<span id="paddle::SequenceToBatch::getBatchValue__MatrixR.i.i"></span><span class="target" id="paddleclasspaddle_1_1SequenceToBatch_1a9fff6f942ecba9a4c902dff969c15092"></span><a class="reference internal" href="../../math/matrix/matrix.html#_CPPv2N6paddle9MatrixPtrE" title="paddle::MatrixPtr">MatrixPtr</a> <code class="descname">getBatchValue</code><span class="sig-paren">(</span><a class="reference internal" href="../../math/matrix/matrix.html#_CPPv2N6paddle6MatrixE" title="paddle::Matrix">Matrix</a> &amp;<em>batchValue</em>, int <em>batchId</em>, int <em>numRows</em> = 0<span class="sig-paren">)</span><a class="headerlink" href="#_CPPv2N6paddle15SequenceToBatch13getBatchValueER6Matrixii" title="Permalink to this definition">¶</a></dt>
<dd></dd></dl>

<dl class="function">
2816 2817
<dt id="_CPPv2NK6paddle15SequenceToBatch11getNumBatchEv">
<span id="paddle::SequenceToBatch::getNumBatchC"></span><span class="target" id="paddleclasspaddle_1_1SequenceToBatch_1a31d9fbc0e725b7c35a6b95ba718926bc"></span>size_t <code class="descname">getNumBatch</code><span class="sig-paren">(</span><span class="sig-paren">)</span> <em class="property">const</em><a class="headerlink" href="#_CPPv2NK6paddle15SequenceToBatch11getNumBatchEv" title="Permalink to this definition">¶</a></dt>
Y
Yu Yang 已提交
2818 2819 2820 2821 2822 2823 2824 2825 2826 2827 2828 2829 2830 2831 2832 2833 2834 2835 2836 2837 2838 2839 2840 2841 2842 2843 2844 2845 2846 2847 2848 2849 2850 2851 2852 2853 2854 2855 2856
<dd></dd></dl>

<dl class="function">
<dt id="_CPPv2N6paddle15SequenceToBatch14resizeOrCreateER6Matrix">
<span id="paddle::SequenceToBatch::resizeOrCreate__MatrixR"></span><span class="target" id="paddleclasspaddle_1_1SequenceToBatch_1a257eee81d19221265bb4062e68422254"></span>void <code class="descname">resizeOrCreate</code><span class="sig-paren">(</span><a class="reference internal" href="../../math/matrix/matrix.html#_CPPv2N6paddle6MatrixE" title="paddle::Matrix">Matrix</a> &amp;<em>seqValue</em><span class="sig-paren">)</span><a class="headerlink" href="#_CPPv2N6paddle15SequenceToBatch14resizeOrCreateER6Matrix" title="Permalink to this definition">¶</a></dt>
<dd></dd></dl>

<dl class="function">
<dt id="_CPPv2N6paddle15SequenceToBatch11copyFromSeqER6Matrix">
<span id="paddle::SequenceToBatch::copyFromSeq__MatrixR"></span><span class="target" id="paddleclasspaddle_1_1SequenceToBatch_1ab0daf928cdd60324c92ef5dd99f484a1"></span>void <code class="descname">copyFromSeq</code><span class="sig-paren">(</span><a class="reference internal" href="../../math/matrix/matrix.html#_CPPv2N6paddle6MatrixE" title="paddle::Matrix">Matrix</a> &amp;<em>seqValue</em><span class="sig-paren">)</span><a class="headerlink" href="#_CPPv2N6paddle15SequenceToBatch11copyFromSeqER6Matrix" title="Permalink to this definition">¶</a></dt>
<dd></dd></dl>

<dl class="function">
<dt id="_CPPv2N6paddle15SequenceToBatch11copyBackSeqER6Matrix">
<span id="paddle::SequenceToBatch::copyBackSeq__MatrixR"></span><span class="target" id="paddleclasspaddle_1_1SequenceToBatch_1ab9a8bb953a6ce9cf2b6d0ba91ac1cb14"></span>void <code class="descname">copyBackSeq</code><span class="sig-paren">(</span><a class="reference internal" href="../../math/matrix/matrix.html#_CPPv2N6paddle6MatrixE" title="paddle::Matrix">Matrix</a> &amp;<em>seqValue</em><span class="sig-paren">)</span><a class="headerlink" href="#_CPPv2N6paddle15SequenceToBatch11copyBackSeqER6Matrix" title="Permalink to this definition">¶</a></dt>
<dd></dd></dl>

<dl class="function">
<dt id="_CPPv2N6paddle15SequenceToBatch13getBatchValueEii">
<span id="paddle::SequenceToBatch::getBatchValue__i.i"></span><span class="target" id="paddleclasspaddle_1_1SequenceToBatch_1ac623240c86a38644091f0088bd7e51b6"></span><a class="reference internal" href="../../math/matrix/matrix.html#_CPPv2N6paddle9MatrixPtrE" title="paddle::MatrixPtr">MatrixPtr</a> <code class="descname">getBatchValue</code><span class="sig-paren">(</span>int <em>batchId</em>, int <em>numRows</em> = 0<span class="sig-paren">)</span><a class="headerlink" href="#_CPPv2N6paddle15SequenceToBatch13getBatchValueEii" title="Permalink to this definition">¶</a></dt>
<dd></dd></dl>

<dl class="function">
<dt id="_CPPv2N6paddle15SequenceToBatch13getBatchValueEv">
<span id="paddle::SequenceToBatch::getBatchValue"></span><span class="target" id="paddleclasspaddle_1_1SequenceToBatch_1af405c5e13761b5abcba038fc70439e41"></span><a class="reference internal" href="../../math/matrix/matrix.html#_CPPv2N6paddle9MatrixPtrE" title="paddle::MatrixPtr">MatrixPtr</a> <code class="descname">getBatchValue</code><span class="sig-paren">(</span><span class="sig-paren">)</span><a class="headerlink" href="#_CPPv2N6paddle15SequenceToBatch13getBatchValueEv" title="Permalink to this definition">¶</a></dt>
<dd></dd></dl>

<dl class="function">
<dt id="_CPPv2N6paddle15SequenceToBatch16prevOutput2BatchER6MatrixR6Matrix">
<span id="paddle::SequenceToBatch::prevOutput2Batch__MatrixR.MatrixR"></span><span class="target" id="paddleclasspaddle_1_1SequenceToBatch_1a2e38715d3029c4910252f15343ad69de"></span>void <code class="descname">prevOutput2Batch</code><span class="sig-paren">(</span><a class="reference internal" href="../../math/matrix/matrix.html#_CPPv2N6paddle6MatrixE" title="paddle::Matrix">Matrix</a> &amp;<em>src</em>, <a class="reference internal" href="../../math/matrix/matrix.html#_CPPv2N6paddle6MatrixE" title="paddle::Matrix">Matrix</a> &amp;<em>dst</em><span class="sig-paren">)</span><a class="headerlink" href="#_CPPv2N6paddle15SequenceToBatch16prevOutput2BatchER6MatrixR6Matrix" title="Permalink to this definition">¶</a></dt>
<dd></dd></dl>

<dl class="function">
<dt id="_CPPv2N6paddle15SequenceToBatch21getSeqOutputFromBatchER6MatrixR6Matrix">
<span id="paddle::SequenceToBatch::getSeqOutputFromBatch__MatrixR.MatrixR"></span><span class="target" id="paddleclasspaddle_1_1SequenceToBatch_1ac10d10515f41c736801344e4620968bd"></span>void <code class="descname">getSeqOutputFromBatch</code><span class="sig-paren">(</span><a class="reference internal" href="../../math/matrix/matrix.html#_CPPv2N6paddle6MatrixE" title="paddle::Matrix">Matrix</a> &amp;<em>sequence</em>, <a class="reference internal" href="../../math/matrix/matrix.html#_CPPv2N6paddle6MatrixE" title="paddle::Matrix">Matrix</a> &amp;<em>batch</em><span class="sig-paren">)</span><a class="headerlink" href="#_CPPv2N6paddle15SequenceToBatch21getSeqOutputFromBatchER6MatrixR6Matrix" title="Permalink to this definition">¶</a></dt>
<dd></dd></dl>

<dl class="function">
<dt id="_CPPv2N6paddle15SequenceToBatch14shareIndexWithERK15SequenceToBatch">
2857
<span id="paddle::SequenceToBatch::shareIndexWith__SequenceToBatchCR"></span><span class="target" id="paddleclasspaddle_1_1SequenceToBatch_1ac7e875eb37973abecaf8a6a3884b6cc3"></span>void <code class="descname">shareIndexWith</code><span class="sig-paren">(</span><em class="property">const</em> <a class="reference internal" href="#_CPPv2N6paddle15SequenceToBatchE" title="paddle::SequenceToBatch">SequenceToBatch</a> &amp;<em>seq2batch</em><span class="sig-paren">)</span><a class="headerlink" href="#_CPPv2N6paddle15SequenceToBatch14shareIndexWithERK15SequenceToBatch" title="Permalink to this definition">¶</a></dt>
Y
Yu Yang 已提交
2858 2859 2860
<dd></dd></dl>

</div>
2861
<div class="breathe-sectiondef docutils container">
Y
Yu Yang 已提交
2862 2863 2864 2865 2866 2867 2868 2869 2870 2871 2872 2873
<p class="breathe-sectiondef-title rubric">Protected Functions</p>
<dl class="function">
<dt id="_CPPv2N6paddle15SequenceToBatch18sequence2BatchCopyER6MatrixR6MatrixR7IVectorb">
<span id="paddle::SequenceToBatch::sequence2BatchCopy__MatrixR.MatrixR.IVectorR.b"></span><span class="target" id="paddleclasspaddle_1_1SequenceToBatch_1a3bad8a979dd13f866c6620d39675f8ea"></span>void <code class="descname">sequence2BatchCopy</code><span class="sig-paren">(</span><a class="reference internal" href="../../math/matrix/matrix.html#_CPPv2N6paddle6MatrixE" title="paddle::Matrix">Matrix</a> &amp;<em>batch</em>, <a class="reference internal" href="../../math/matrix/matrix.html#_CPPv2N6paddle6MatrixE" title="paddle::Matrix">Matrix</a> &amp;<em>sequence</em>, <a class="reference internal" href="../../math/matrix/matrix.html#_CPPv2N6paddle7IVectorE" title="paddle::IVector">IVector</a> &amp;<em>seq2BatchIdx</em>, bool <em>seq2batch</em><span class="sig-paren">)</span><a class="headerlink" href="#_CPPv2N6paddle15SequenceToBatch18sequence2BatchCopyER6MatrixR6MatrixR7IVectorb" title="Permalink to this definition">¶</a></dt>
<dd></dd></dl>

<dl class="function">
<dt id="_CPPv2N6paddle15SequenceToBatch17sequence2BatchAddER6MatrixR6MatrixR7IVectorb">
<span id="paddle::SequenceToBatch::sequence2BatchAdd__MatrixR.MatrixR.IVectorR.b"></span><span class="target" id="paddleclasspaddle_1_1SequenceToBatch_1aace2674cc1620fa2873a9303f2a2cda1"></span>void <code class="descname">sequence2BatchAdd</code><span class="sig-paren">(</span><a class="reference internal" href="../../math/matrix/matrix.html#_CPPv2N6paddle6MatrixE" title="paddle::Matrix">Matrix</a> &amp;<em>batch</em>, <a class="reference internal" href="../../math/matrix/matrix.html#_CPPv2N6paddle6MatrixE" title="paddle::Matrix">Matrix</a> &amp;<em>sequence</em>, <a class="reference internal" href="../../math/matrix/matrix.html#_CPPv2N6paddle7IVectorE" title="paddle::IVector">IVector</a> &amp;<em>seq2BatchIdx</em>, bool <em>seq2batch</em><span class="sig-paren">)</span><a class="headerlink" href="#_CPPv2N6paddle15SequenceToBatch17sequence2BatchAddER6MatrixR6MatrixR7IVectorb" title="Permalink to this definition">¶</a></dt>
<dd></dd></dl>

</div>
2874
<div class="breathe-sectiondef docutils container">
Y
Yu Yang 已提交
2875 2876 2877 2878 2879 2880 2881 2882 2883 2884 2885 2886 2887 2888 2889 2890 2891 2892 2893 2894 2895 2896 2897 2898 2899 2900 2901 2902 2903 2904 2905 2906 2907 2908 2909 2910 2911 2912 2913 2914 2915 2916 2917 2918 2919 2920 2921 2922 2923 2924 2925 2926 2927 2928 2929 2930 2931 2932 2933 2934 2935 2936
<p class="breathe-sectiondef-title rubric">Protected Attributes</p>
<dl class="member">
<dt id="_CPPv2N6paddle15SequenceToBatch20batchStartPositions_E">
<span id="paddle::SequenceToBatch::batchStartPositions___IVectorPtr"></span><span class="target" id="paddleclasspaddle_1_1SequenceToBatch_1a6750f37aed08ae0f52ff8d73fd284d96"></span><a class="reference internal" href="../../math/matrix/matrix.html#_CPPv2N6paddle10IVectorPtrE" title="paddle::IVectorPtr">IVectorPtr</a> <code class="descname">batchStartPositions_</code><a class="headerlink" href="#_CPPv2N6paddle15SequenceToBatch20batchStartPositions_E" title="Permalink to this definition">¶</a></dt>
<dd></dd></dl>

<dl class="member">
<dt id="_CPPv2N6paddle15SequenceToBatch13seq2BatchIdx_E">
<span id="paddle::SequenceToBatch::seq2BatchIdx___IVectorPtr"></span><span class="target" id="paddleclasspaddle_1_1SequenceToBatch_1a3af6dd31f47f637089b15dde413fc11b"></span><a class="reference internal" href="../../math/matrix/matrix.html#_CPPv2N6paddle10IVectorPtrE" title="paddle::IVectorPtr">IVectorPtr</a> <code class="descname">seq2BatchIdx_</code><a class="headerlink" href="#_CPPv2N6paddle15SequenceToBatch13seq2BatchIdx_E" title="Permalink to this definition">¶</a></dt>
<dd></dd></dl>

<dl class="member">
<dt id="_CPPv2N6paddle15SequenceToBatch16cpuSeq2BatchIdx_E">
<span id="paddle::SequenceToBatch::cpuSeq2BatchIdx___IVectorPtr"></span><span class="target" id="paddleclasspaddle_1_1SequenceToBatch_1ae43bd5e6c3dceb5bb128b22fe8d75a08"></span><a class="reference internal" href="../../math/matrix/matrix.html#_CPPv2N6paddle10IVectorPtrE" title="paddle::IVectorPtr">IVectorPtr</a> <code class="descname">cpuSeq2BatchIdx_</code><a class="headerlink" href="#_CPPv2N6paddle15SequenceToBatch16cpuSeq2BatchIdx_E" title="Permalink to this definition">¶</a></dt>
<dd></dd></dl>

<dl class="member">
<dt id="_CPPv2N6paddle15SequenceToBatch10cpuSeqIdx_E">
<span id="paddle::SequenceToBatch::cpuSeqIdx___IVectorPtr"></span><span class="target" id="paddleclasspaddle_1_1SequenceToBatch_1a986f39c0fe02355fef8b5ca41eda80c6"></span><a class="reference internal" href="../../math/matrix/matrix.html#_CPPv2N6paddle10IVectorPtrE" title="paddle::IVectorPtr">IVectorPtr</a> <code class="descname">cpuSeqIdx_</code><a class="headerlink" href="#_CPPv2N6paddle15SequenceToBatch10cpuSeqIdx_E" title="Permalink to this definition">¶</a></dt>
<dd></dd></dl>

<dl class="member">
<dt id="_CPPv2N6paddle15SequenceToBatch20cpuSeqEndIdxInBatch_E">
<span id="paddle::SequenceToBatch::cpuSeqEndIdxInBatch___IVectorPtr"></span><span class="target" id="paddleclasspaddle_1_1SequenceToBatch_1a0fc33d218719c71206cb5c2407cad20d"></span><a class="reference internal" href="../../math/matrix/matrix.html#_CPPv2N6paddle10IVectorPtrE" title="paddle::IVectorPtr">IVectorPtr</a> <code class="descname">cpuSeqEndIdxInBatch_</code><a class="headerlink" href="#_CPPv2N6paddle15SequenceToBatch20cpuSeqEndIdxInBatch_E" title="Permalink to this definition">¶</a></dt>
<dd></dd></dl>

<dl class="member">
<dt id="_CPPv2N6paddle15SequenceToBatch7seqIdx_E">
<span id="paddle::SequenceToBatch::seqIdx___IVectorPtr"></span><span class="target" id="paddleclasspaddle_1_1SequenceToBatch_1a15766e26d7d371b4b0e70c59c17b295d"></span><a class="reference internal" href="../../math/matrix/matrix.html#_CPPv2N6paddle10IVectorPtrE" title="paddle::IVectorPtr">IVectorPtr</a> <code class="descname">seqIdx_</code><a class="headerlink" href="#_CPPv2N6paddle15SequenceToBatch7seqIdx_E" title="Permalink to this definition">¶</a></dt>
<dd></dd></dl>

<dl class="member">
<dt id="_CPPv2N6paddle15SequenceToBatch17seqEndIdxInBatch_E">
<span id="paddle::SequenceToBatch::seqEndIdxInBatch___IVectorPtr"></span><span class="target" id="paddleclasspaddle_1_1SequenceToBatch_1a6c86b527bf3fcae665bdaebecdc66252"></span><a class="reference internal" href="../../math/matrix/matrix.html#_CPPv2N6paddle10IVectorPtrE" title="paddle::IVectorPtr">IVectorPtr</a> <code class="descname">seqEndIdxInBatch_</code><a class="headerlink" href="#_CPPv2N6paddle15SequenceToBatch17seqEndIdxInBatch_E" title="Permalink to this definition">¶</a></dt>
<dd></dd></dl>

<dl class="member">
<dt id="_CPPv2N6paddle15SequenceToBatch9numBatch_E">
<span id="paddle::SequenceToBatch::numBatch___s"></span><span class="target" id="paddleclasspaddle_1_1SequenceToBatch_1a9d4451ccc382bf187fa8393dff3f30d0"></span>size_t <code class="descname">numBatch_</code><a class="headerlink" href="#_CPPv2N6paddle15SequenceToBatch9numBatch_E" title="Permalink to this definition">¶</a></dt>
<dd></dd></dl>

<dl class="member">
<dt id="_CPPv2N6paddle15SequenceToBatch7useGpu_E">
<span id="paddle::SequenceToBatch::useGpu___b"></span><span class="target" id="paddleclasspaddle_1_1SequenceToBatch_1a8f9fc367c0aa65fb1abbaf8d3863c1e5"></span>bool <code class="descname">useGpu_</code><a class="headerlink" href="#_CPPv2N6paddle15SequenceToBatch7useGpu_E" title="Permalink to this definition">¶</a></dt>
<dd></dd></dl>

<dl class="member">
<dt id="_CPPv2N6paddle15SequenceToBatch11batchValue_E">
<span id="paddle::SequenceToBatch::batchValue___MatrixPtr"></span><span class="target" id="paddleclasspaddle_1_1SequenceToBatch_1afb76192bdc89d9074f521aa521379f42"></span><a class="reference internal" href="../../math/matrix/matrix.html#_CPPv2N6paddle9MatrixPtrE" title="paddle::MatrixPtr">MatrixPtr</a> <code class="descname">batchValue_</code><a class="headerlink" href="#_CPPv2N6paddle15SequenceToBatch11batchValue_E" title="Permalink to this definition">¶</a></dt>
<dd></dd></dl>

</div>
</dd></dl>

</div>
<div class="section" id="lstm">
<h2>LSTM<a class="headerlink" href="#lstm" title="Permalink to this headline">¶</a></h2>
<div class="section" id="lstmlayer">
<h3>LstmLayer<a class="headerlink" href="#lstmlayer" title="Permalink to this headline">¶</a></h3>
<dl class="class">
<dt id="_CPPv2N6paddle9LstmLayerE">
<span id="paddle::LstmLayer"></span><span class="target" id="paddleclasspaddle_1_1LstmLayer"></span><em class="property">class </em><code class="descclassname">paddle::</code><code class="descname">LstmLayer</code><a class="headerlink" href="#_CPPv2N6paddle9LstmLayerE" title="Permalink to this definition">¶</a></dt>
2937 2938 2939 2940 2941 2942 2943 2944 2945 2946 2947
<dd><p><a class="reference internal" href="#paddleclasspaddle_1_1LstmLayer"><span class="std std-ref">LstmLayer</span></a> takes 1 input layer with size * 4. Input layer is diveded into 4 equal parts: (input_s, input_ig, input_fg, input_og) </p>
<p>For each sequence [start, end] it performs the following computation: <div class="highlight-default"><div class="highlight"><pre><span></span><span class="n">output_</span><span class="p">{</span><span class="n">i</span><span class="p">}</span> <span class="o">=</span> <span class="n">actState</span><span class="p">(</span><span class="n">state_</span><span class="p">{</span><span class="n">i</span><span class="p">})</span> <span class="o">*</span> <span class="n">actGate</span><span class="p">(</span><span class="n">outputGate_</span><span class="p">{</span><span class="n">i</span><span class="p">})</span>
<span class="n">state_</span><span class="p">{</span><span class="n">i</span><span class="p">}</span> <span class="o">=</span> <span class="n">actInput</span><span class="p">(</span><span class="n">input_s_</span><span class="p">{</span><span class="n">i</span><span class="p">}</span> <span class="o">+</span> <span class="n">bias_s</span> <span class="o">+</span>
            <span class="n">output_</span><span class="p">{</span><span class="n">i</span><span class="o">-</span><span class="mi">1</span><span class="p">}</span> <span class="o">*</span> <span class="n">recurrIW</span><span class="p">)</span> <span class="o">*</span> <span class="n">actGate</span><span class="p">(</span><span class="n">inputGate_</span><span class="p">{</span><span class="n">i</span><span class="p">})</span> <span class="o">+</span>
            <span class="n">actGate</span><span class="p">(</span><span class="n">forgetGate_</span><span class="p">{</span><span class="n">i</span><span class="p">})</span> <span class="o">*</span> <span class="n">state_</span><span class="p">{</span><span class="n">i</span><span class="o">-</span><span class="mi">1</span><span class="p">}</span>
<span class="n">inputGate</span> <span class="o">=</span> <span class="n">input_ig_</span><span class="p">{</span><span class="n">i</span><span class="p">}</span> <span class="o">+</span> <span class="n">bias_ig</span> <span class="o">+</span> <span class="n">output_</span><span class="p">{</span><span class="n">i</span><span class="o">-</span><span class="mi">1</span><span class="p">}</span> <span class="o">*</span> <span class="n">recurrIGW</span> <span class="o">+</span>
            <span class="n">state_</span><span class="p">{</span><span class="n">i</span><span class="o">-</span><span class="mi">1</span><span class="p">}</span> <span class="o">*</span> <span class="n">inputCheck</span>
<span class="n">ouputGate</span> <span class="o">=</span> <span class="n">input_og_</span><span class="p">{</span><span class="n">i</span><span class="p">}</span> <span class="o">+</span> <span class="n">bias_og</span> <span class="o">+</span> <span class="n">output_</span><span class="p">{</span><span class="n">i</span><span class="o">-</span><span class="mi">1</span><span class="p">}</span> <span class="o">*</span> <span class="n">recurrOGW</span> <span class="o">+</span>
            <span class="n">state_</span><span class="p">{</span><span class="n">i</span><span class="p">}</span> <span class="o">*</span> <span class="n">outputCheck</span>
<span class="n">forgetGate</span> <span class="o">=</span> <span class="n">input_fg_</span><span class="p">{</span><span class="n">i</span><span class="p">}</span> <span class="o">+</span> <span class="n">bias_fg</span> <span class="o">+</span> <span class="n">output_</span><span class="p">{</span><span class="n">i</span><span class="o">-</span><span class="mi">1</span><span class="p">}</span> <span class="o">*</span> <span class="n">recurrFGW</span> <span class="o">+</span>
             <span class="n">state_</span><span class="p">{</span><span class="n">i</span><span class="o">-</span><span class="mi">1</span><span class="p">}</span> <span class="o">*</span> <span class="n">forgetCheck</span>
Y
Yu Yang 已提交
2948 2949 2950 2951 2952 2953 2954 2955 2956 2957 2958 2959 2960 2961 2962 2963 2964 2965
</pre></div>
</div>
</p>
<p><ul class="simple">
<li>parameter[0] consists of (recurrIW, recurrIGW, recurrFGW, recurrOGW)</li>
<li>baisParameter consists of (bias_s, bias_ig, bias_og, bias_fg, inputCheck, forgetCheck, outputCheck)</li>
<li>actInput is defined by config active_type.</li>
<li>actState is defined by config active_state_type.</li>
<li>actGate is defined by config actvie_gate_type.</li>
</ul>
</p>
<p>There are two ways to compute, namely one sequence by one sequence or one batch by one batch. By default and no setting pre_batch_state true, it will compute batch by batch.</p>
<p>The formula in the paper is as follows: <div class="math">
\[\begin{split} i_t = \sigma(W_{xi}x_{t} + W_{hi}h_{t-1} + W_{ci}c_{t-1} + b_i) \\ f_t = \sigma(W_{xf}x_{t} + W_{hf}h_{t-1} + W_{cf}c_{t-1} + b_f) \\ \tilde{c_t} = tanh (W_{xc}x_t+W_{hc}h_{t-1} + b_c) \\ o_t = \sigma(W_{xo}x_{t} + W_{ho}h_{t-1} + W_{co}c_t + b_o) \\ c_t = f_t * c_{t-1} + i_t * \tilde{c_t} \\ h_t = o_t tanh(c_t) \end{split}\]</div>
</p>
<p>
The weight ([size, 4*size]) contains <span class="math">\(W_{hi}, W_{hf}, W_{hc}, W_{ho}\)</span>. The bias contains <span class="math">\(b_i, b_f, b_c, b_o\)</span> and <span class="math">\(W_{ci}, W_{cf}, W_{co}\)</span>. <dl class="docutils">
<dt><strong>Note</strong></dt>
2966
<dd>These <span class="math">\(W_{xi}x_{t}, W_{xf}x_{t}, W_{xc}x_{t}, W_{xo}x_{t}\)</span> operations on the input sequence were NOT included in <a class="reference internal" href="#paddleclasspaddle_1_1LstmLayer"><span class="std std-ref">LstmLayer</span></a>. So users should use fc_layer or mixed_layer before lstm_later.</dd>
Y
Yu Yang 已提交
2967 2968
</dl>
</p>
2969 2970
<p>Inherits from <a class="reference internal" href="#paddleclasspaddle_1_1Layer"><span class="std std-ref">paddle::Layer</span></a>, <a class="reference internal" href="#paddleclasspaddle_1_1LstmCompute"><span class="std std-ref">paddle::LstmCompute</span></a></p>
<p>Subclassed by <a class="reference internal" href="#paddleclasspaddle_1_1MDLstmLayer"><span class="std std-ref">paddle::MDLstmLayer</span></a></p>
2971
<div class="breathe-sectiondef docutils container">
Y
Yu Yang 已提交
2972 2973 2974 2975 2976 2977 2978 2979
<p class="breathe-sectiondef-title rubric">Public Functions</p>
<dl class="function">
<dt id="_CPPv2N6paddle9LstmLayer9LstmLayerERK11LayerConfig">
<span id="paddle::LstmLayer::LstmLayer__LayerConfigCR"></span><span class="target" id="paddleclasspaddle_1_1LstmLayer_1ad5a6f6d354604c62713f284defed842c"></span><code class="descname">LstmLayer</code><span class="sig-paren">(</span><em class="property">const</em> LayerConfig &amp;<em>config</em><span class="sig-paren">)</span><a class="headerlink" href="#_CPPv2N6paddle9LstmLayer9LstmLayerERK11LayerConfig" title="Permalink to this definition">¶</a></dt>
<dd></dd></dl>

<dl class="function">
<dt id="_CPPv2N6paddle9LstmLayer4initERK8LayerMapRK12ParameterMap">
2980
<span id="paddle::LstmLayer::init__LayerMapCR.ParameterMapCR"></span><span class="target" id="paddleclasspaddle_1_1LstmLayer_1aeaebc3198e166f94befca77d65dd23d1"></span>bool <code class="descname">init</code><span class="sig-paren">(</span><em class="property">const</em> LayerMap &amp;<em>layerMap</em>, <em class="property">const</em> <a class="reference internal" href="../../parameter/parameter/parameter.html#_CPPv2N6paddle12ParameterMapE" title="paddle::ParameterMap">ParameterMap</a> &amp;<em>parameterMap</em><span class="sig-paren">)</span><a class="headerlink" href="#_CPPv2N6paddle9LstmLayer4initERK8LayerMapRK12ParameterMap" title="Permalink to this definition">¶</a></dt>
Y
Yu Yang 已提交
2981 2982 2983 2984 2985
<dd><p>Intialization. For example, adding input layers from layerMap and parameterMap. </p>
</dd></dl>

<dl class="function">
<dt id="_CPPv2N6paddle9LstmLayer7forwardE8PassType">
2986
<span id="paddle::LstmLayer::forward__PassType"></span><span class="target" id="paddleclasspaddle_1_1LstmLayer_1a4871e5ee0deffb188e4e772e5a5e8a2a"></span>void <code class="descname">forward</code><span class="sig-paren">(</span>PassType <em>passType</em><span class="sig-paren">)</span><a class="headerlink" href="#_CPPv2N6paddle9LstmLayer7forwardE8PassType" title="Permalink to this definition">¶</a></dt>
Y
Yu Yang 已提交
2987 2988 2989 2990 2991
<dd><p>Forward propagation. All inherited implementation should call Layer::foward() function. </p>
</dd></dl>

<dl class="function">
<dt id="_CPPv2N6paddle9LstmLayer8backwardERK14UpdateCallback">
2992
<span id="paddle::LstmLayer::backward__UpdateCallbackCR"></span><span class="target" id="paddleclasspaddle_1_1LstmLayer_1a9928d17c4012810b77a7b3520d9ff6b2"></span>void <code class="descname">backward</code><span class="sig-paren">(</span><em class="property">const</em> <a class="reference internal" href="../../parameter/parameter/parameter.html#_CPPv2N6paddle14UpdateCallbackE" title="paddle::UpdateCallback">UpdateCallback</a> &amp;<em>callback</em><span class="sig-paren">)</span><a class="headerlink" href="#_CPPv2N6paddle9LstmLayer8backwardERK14UpdateCallback" title="Permalink to this definition">¶</a></dt>
2993
<dd><p>Backward propagation. Should only be called after <a class="reference internal" href="#paddleclasspaddle_1_1Layer_1a12386b3f20dd731e7ceaa2c61667cbe1"><span class="std std-ref">Layer::forward()</span></a> function. </p>
Y
Yu Yang 已提交
2994 2995 2996 2997
</dd></dl>

<dl class="function">
<dt id="_CPPv2N6paddle9LstmLayer10resetStateEv">
2998
<span id="paddle::LstmLayer::resetState"></span><span class="target" id="paddleclasspaddle_1_1LstmLayer_1a2e0fc16e618d973701b32d07ccbd74d8"></span>void <code class="descname">resetState</code><span class="sig-paren">(</span><span class="sig-paren">)</span><a class="headerlink" href="#_CPPv2N6paddle9LstmLayer10resetStateEv" title="Permalink to this definition">¶</a></dt>
2999 3000
<dd><p>Reset the internal state variables. Allocate them if they have not been allocated. This function need to called before <a class="reference internal" href="#paddleclasspaddle_1_1Layer_1a12386b3f20dd731e7ceaa2c61667cbe1"><span class="std std-ref">Layer::forward()</span></a> for generating sequence.</p>
<p>This is used for sequence generation. When generating sequence, the calculation at current timestamp depends on the state from previous timestamp. The model needs to keep the information about the previous timestamp in the state variables. Layers such as <a class="reference internal" href="#paddleclasspaddle_1_1RecurrentLayer"><span class="std std-ref">RecurrentLayer</span></a>, <a class="reference internal" href="#paddleclasspaddle_1_1LstmLayer"><span class="std std-ref">LstmLayer</span></a> and ContextLayer have state variables. </p>
Y
Yu Yang 已提交
3001 3002 3003 3004
</dd></dl>

<dl class="function">
<dt id="_CPPv2N6paddle9LstmLayer8setStateE13LayerStatePtr">
3005
<span id="paddle::LstmLayer::setState__LayerStatePtr"></span><span class="target" id="paddleclasspaddle_1_1LstmLayer_1aa50629508750f22b0b9fe89ffea6d7e6"></span>void <code class="descname">setState</code><span class="sig-paren">(</span>LayerStatePtr <em>state</em><span class="sig-paren">)</span><a class="headerlink" href="#_CPPv2N6paddle9LstmLayer8setStateE13LayerStatePtr" title="Permalink to this definition">¶</a></dt>
Y
Yu Yang 已提交
3006 3007 3008 3009 3010
<dd><p>Set layer state. </p>
</dd></dl>

<dl class="function">
<dt id="_CPPv2N6paddle9LstmLayer8getStateEv">
3011
<span id="paddle::LstmLayer::getState"></span><span class="target" id="paddleclasspaddle_1_1LstmLayer_1a05e2ac75189f5b6d54d9c2531a1c6323"></span>LayerStatePtr <code class="descname">getState</code><span class="sig-paren">(</span><span class="sig-paren">)</span><a class="headerlink" href="#_CPPv2N6paddle9LstmLayer8getStateEv" title="Permalink to this definition">¶</a></dt>
Y
Yu Yang 已提交
3012 3013 3014 3015 3016 3017 3018 3019
<dd><p>Get layer state. <dl class="docutils">
<dt><strong>Return</strong></dt>
<dd>A copy of internal state. </dd>
</dl>
</p>
</dd></dl>

</div>
3020
<div class="breathe-sectiondef docutils container">
Y
Yu Yang 已提交
3021 3022 3023 3024
<p class="breathe-sectiondef-title rubric">Protected Functions</p>
<dl class="function">
<dt id="_CPPv2N6paddle9LstmLayer15forwardSequenceEi6size_tPKi9MatrixPtr">
<span id="paddle::LstmLayer::forwardSequence__i.s.iCP.MatrixPtr"></span><span class="target" id="paddleclasspaddle_1_1LstmLayer_1addf28182ae53fa0165a39cf1edbbab99"></span>void <code class="descname">forwardSequence</code><span class="sig-paren">(</span>int <em>batchSize</em>, size_t <em>numSequences</em>, <em class="property">const</em> int *<em>starts</em>, <a class="reference internal" href="../../math/matrix/matrix.html#_CPPv2N6paddle9MatrixPtrE" title="paddle::MatrixPtr">MatrixPtr</a> <em>inputValue</em><span class="sig-paren">)</span><a class="headerlink" href="#_CPPv2N6paddle9LstmLayer15forwardSequenceEi6size_tPKi9MatrixPtr" title="Permalink to this definition">¶</a></dt>
Y
Yu Yang 已提交
3025 3026 3027
<dd><p>Compute lstm forward one sequence by one sequence. </p>
<p><dl class="docutils">
<dt><strong>Parameters</strong></dt>
3028 3029 3030 3031 3032
<dd><ul class="breatheparameterlist first last simple">
<li><code class="docutils literal"><span class="pre">batchSize</span></code>: The batchSize is not equal to the batch_size in the config file. It is the total words number of all samples in this forward batch. </li>
<li><code class="docutils literal"><span class="pre">numSequences</span></code>: The sample number. It is equal to the batch_size in the config file. </li>
<li><code class="docutils literal"><span class="pre">starts</span></code>: Each start position of each samples. </li>
<li><code class="docutils literal"><span class="pre">inputValue</span></code>: The input values. </li>
Y
Yu Yang 已提交
3033 3034 3035 3036 3037
</ul>
</dd>
</dl>
</p>
</dd></dl>
Y
Yu Yang 已提交
3038 3039 3040 3041

<dl class="function">
<dt id="_CPPv2N6paddle9LstmLayer16backwardSequenceEi6size_tPKi9MatrixPtr">
<span id="paddle::LstmLayer::backwardSequence__i.s.iCP.MatrixPtr"></span><span class="target" id="paddleclasspaddle_1_1LstmLayer_1a061ea3b73bb124323d7ad98b66c54599"></span>void <code class="descname">backwardSequence</code><span class="sig-paren">(</span>int <em>batchSize</em>, size_t <em>numSequences</em>, <em class="property">const</em> int *<em>starts</em>, <a class="reference internal" href="../../math/matrix/matrix.html#_CPPv2N6paddle9MatrixPtrE" title="paddle::MatrixPtr">MatrixPtr</a> <em>inputGrad</em><span class="sig-paren">)</span><a class="headerlink" href="#_CPPv2N6paddle9LstmLayer16backwardSequenceEi6size_tPKi9MatrixPtr" title="Permalink to this definition">¶</a></dt>
Y
Yu Yang 已提交
3042 3043
<dd><p>Compute lstm backward one sequence by one sequence. </p>
</dd></dl>
Y
Yu Yang 已提交
3044 3045 3046 3047

<dl class="function">
<dt id="_CPPv2N6paddle9LstmLayer12forwardBatchEi6size_tPKi9MatrixPtr">
<span id="paddle::LstmLayer::forwardBatch__i.s.iCP.MatrixPtr"></span><span class="target" id="paddleclasspaddle_1_1LstmLayer_1a624184a9640f140295e245ea6f2a0512"></span>void <code class="descname">forwardBatch</code><span class="sig-paren">(</span>int <em>batchSize</em>, size_t <em>numSequences</em>, <em class="property">const</em> int *<em>starts</em>, <a class="reference internal" href="../../math/matrix/matrix.html#_CPPv2N6paddle9MatrixPtrE" title="paddle::MatrixPtr">MatrixPtr</a> <em>inputValue</em><span class="sig-paren">)</span><a class="headerlink" href="#_CPPv2N6paddle9LstmLayer12forwardBatchEi6size_tPKi9MatrixPtr" title="Permalink to this definition">¶</a></dt>
3048
<dd><p>Compute lstm forward one batch by one batch. The batch value is reorganized by <a class="reference internal" href="#paddleclasspaddle_1_1SequenceToBatch"><span class="std std-ref">SequenceToBatch</span></a> class. The batch output value will be convert into sequence value after finishing forward. Here, one batch contains one word of each sample. If the length of each sample is not equality, the batch will not pads zero and contains less words. The total batch numbers are the max length of the sequence. The details can refer to <a class="reference internal" href="#paddleclasspaddle_1_1SequenceToBatch"><span class="std std-ref">SequenceToBatch</span></a> class. On GPU mode, it will launch GPU kernel for loop.</p>
3049
<p><div class="highlight-default"><div class="highlight"><pre><span></span><span class="k">for</span> <span class="p">(</span><span class="nb">int</span> <span class="n">i</span> <span class="o">=</span> <span class="mi">0</span><span class="p">;</span> <span class="n">i</span> <span class="o">&lt;</span> <span class="n">numBatch</span><span class="p">(</span><span class="n">max_sequence_length</span><span class="p">);</span> <span class="o">++</span><span class="n">i</span><span class="p">)</span> <span class="p">{</span>
3050 3051
  <span class="n">compute</span> <span class="n">one</span> <span class="n">batch</span><span class="o">.</span>
<span class="p">}</span>
Y
Yu Yang 已提交
3052 3053
</pre></div>
</div>
3054
 </p>
Y
Yu Yang 已提交
3055
</dd></dl>
Y
Yu Yang 已提交
3056 3057 3058 3059

<dl class="function">
<dt id="_CPPv2N6paddle9LstmLayer13backwardBatchEi6size_tPKi9MatrixPtr">
<span id="paddle::LstmLayer::backwardBatch__i.s.iCP.MatrixPtr"></span><span class="target" id="paddleclasspaddle_1_1LstmLayer_1a6b1a32de1475fddfe16e62ebe0fabe86"></span>void <code class="descname">backwardBatch</code><span class="sig-paren">(</span>int <em>batchSize</em>, size_t <em>numSequences</em>, <em class="property">const</em> int *<em>starts</em>, <a class="reference internal" href="../../math/matrix/matrix.html#_CPPv2N6paddle9MatrixPtrE" title="paddle::MatrixPtr">MatrixPtr</a> <em>inputGrad</em><span class="sig-paren">)</span><a class="headerlink" href="#_CPPv2N6paddle9LstmLayer13backwardBatchEi6size_tPKi9MatrixPtr" title="Permalink to this definition">¶</a></dt>
Y
Yu Yang 已提交
3060 3061
<dd><p>Compute lstm backward one batch by one batch. </p>
</dd></dl>
Y
Yu Yang 已提交
3062 3063 3064 3065

<dl class="function">
<dt id="_CPPv2N6paddle9LstmLayer18forwardSeqParallelEi6size_tPKi9MatrixPtr">
<span id="paddle::LstmLayer::forwardSeqParallel__i.s.iCP.MatrixPtr"></span><span class="target" id="paddleclasspaddle_1_1LstmLayer_1a0a66e7f6daff5af7dadde2b33963f397"></span>void <code class="descname">forwardSeqParallel</code><span class="sig-paren">(</span>int <em>batchSize</em>, size_t <em>numSequences</em>, <em class="property">const</em> int *<em>starts</em>, <a class="reference internal" href="../../math/matrix/matrix.html#_CPPv2N6paddle9MatrixPtrE" title="paddle::MatrixPtr">MatrixPtr</a> <em>inputValue</em><span class="sig-paren">)</span><a class="headerlink" href="#_CPPv2N6paddle9LstmLayer18forwardSeqParallelEi6size_tPKi9MatrixPtr" title="Permalink to this definition">¶</a></dt>
Y
Yu Yang 已提交
3066 3067
<dd><p>This function only supports GPU. It not need to reorganize input into batch value. It will launch one kernel to parallelly compute forward propagation in sequence level. </p>
</dd></dl>
Y
Yu Yang 已提交
3068 3069 3070 3071

<dl class="function">
<dt id="_CPPv2N6paddle9LstmLayer19backwardSeqParallelEi6size_tPKi9MatrixPtr">
<span id="paddle::LstmLayer::backwardSeqParallel__i.s.iCP.MatrixPtr"></span><span class="target" id="paddleclasspaddle_1_1LstmLayer_1aace09a289970336e21f9be501f1bc481"></span>void <code class="descname">backwardSeqParallel</code><span class="sig-paren">(</span>int <em>batchSize</em>, size_t <em>numSequences</em>, <em class="property">const</em> int *<em>starts</em>, <a class="reference internal" href="../../math/matrix/matrix.html#_CPPv2N6paddle9MatrixPtrE" title="paddle::MatrixPtr">MatrixPtr</a> <em>inputGrad</em><span class="sig-paren">)</span><a class="headerlink" href="#_CPPv2N6paddle9LstmLayer19backwardSeqParallelEi6size_tPKi9MatrixPtr" title="Permalink to this definition">¶</a></dt>
Y
Yu Yang 已提交
3072 3073
<dd><p>Backward propagation corresponding to forwardSeqParallel. </p>
</dd></dl>
Y
Yu Yang 已提交
3074 3075 3076 3077

<dl class="function">
<dt id="_CPPv2N6paddle9LstmLayer18getPrevBatchOutputE6size_t">
<span id="paddle::LstmLayer::getPrevBatchOutput__s"></span><span class="target" id="paddleclasspaddle_1_1LstmLayer_1a7e4c94173d17f8820a81a8e268bb6964"></span>void <code class="descname">getPrevBatchOutput</code><span class="sig-paren">(</span>size_t <em>numSequences</em><span class="sig-paren">)</span><a class="headerlink" href="#_CPPv2N6paddle9LstmLayer18getPrevBatchOutputE6size_t" title="Permalink to this definition">¶</a></dt>
Y
Yu Yang 已提交
3078 3079
<dd><p>This function is used for sequence generation and get output after forwardBatch. </p>
</dd></dl>
Y
Yu Yang 已提交
3080 3081 3082 3083

<dl class="function">
<dt id="_CPPv2N6paddle9LstmLayer17getPrevBatchStateE6size_t">
<span id="paddle::LstmLayer::getPrevBatchState__s"></span><span class="target" id="paddleclasspaddle_1_1LstmLayer_1ac122a861de83424fb20a9c6213ed24e2"></span>void <code class="descname">getPrevBatchState</code><span class="sig-paren">(</span>size_t <em>numSequences</em><span class="sig-paren">)</span><a class="headerlink" href="#_CPPv2N6paddle9LstmLayer17getPrevBatchStateE6size_t" title="Permalink to this definition">¶</a></dt>
Y
Yu Yang 已提交
3084 3085
<dd><p>This function is used for sequence generation and get state after forwardBatch. </p>
</dd></dl>
Y
Yu Yang 已提交
3086 3087

</div>
3088
<div class="breathe-sectiondef docutils container">
Y
Yu Yang 已提交
3089 3090 3091 3092
<p class="breathe-sectiondef-title rubric">Protected Attributes</p>
<dl class="member">
<dt id="_CPPv2N6paddle9LstmLayer7weight_E">
<span id="paddle::LstmLayer::weight___std::unique_ptr:Weight:"></span><span class="target" id="paddleclasspaddle_1_1LstmLayer_1a92459d3e28d0f40fae23a7a9b81a8b85"></span>std::unique_ptr&lt;<a class="reference internal" href="../../parameter/parameter/parameter.html#_CPPv2N6paddle6WeightE" title="paddle::Weight">Weight</a>&gt; <code class="descname">weight_</code><a class="headerlink" href="#_CPPv2N6paddle9LstmLayer7weight_E" title="Permalink to this definition">¶</a></dt>
Y
Yu Yang 已提交
3093 3094
<dd><p>Learned parameters, shape: (size, 4*size). The weight ([size, 4*size]) contains <span class="math">\(W_{hi}, W_{hf}, W_{hc}, W_{ho}\)</span>. </p>
</dd></dl>
Y
Yu Yang 已提交
3095 3096 3097 3098

<dl class="member">
<dt id="_CPPv2N6paddle9LstmLayer5bias_E">
<span id="paddle::LstmLayer::bias___std::unique_ptr:Weight:"></span><span class="target" id="paddleclasspaddle_1_1LstmLayer_1ac4bec6e74d8c5b1059fd97e87c244e15"></span>std::unique_ptr&lt;<a class="reference internal" href="../../parameter/parameter/parameter.html#_CPPv2N6paddle6WeightE" title="paddle::Weight">Weight</a>&gt; <code class="descname">bias_</code><a class="headerlink" href="#_CPPv2N6paddle9LstmLayer5bias_E" title="Permalink to this definition">¶</a></dt>
Y
Yu Yang 已提交
3099 3100
<dd><p>Learned bias parameter, shape: (1, 7 * size). The bias contains <span class="math">\(b_i, b_f, b_c, b_o\)</span> and <span class="math">\(W_{ci}, W_{cf}, W_{co}\)</span>. </p>
</dd></dl>
Y
Yu Yang 已提交
3101 3102 3103 3104

<dl class="member">
<dt id="_CPPv2N6paddle9LstmLayer10localBias_E">
<span id="paddle::LstmLayer::localBias___MatrixPtr"></span><span class="target" id="paddleclasspaddle_1_1LstmLayer_1a2776041d687f5386e5a06b4ca66e6c68"></span><a class="reference internal" href="../../math/matrix/matrix.html#_CPPv2N6paddle9MatrixPtrE" title="paddle::MatrixPtr">MatrixPtr</a> <code class="descname">localBias_</code><a class="headerlink" href="#_CPPv2N6paddle9LstmLayer10localBias_E" title="Permalink to this definition">¶</a></dt>
Y
Yu Yang 已提交
3105 3106
<dd><p>The reeal bias, point to <span class="math">\(b_i, b_f, b_c, b_o\)</span>. </p>
</dd></dl>
Y
Yu Yang 已提交
3107 3108 3109 3110

<dl class="member">
<dt id="_CPPv2N6paddle9LstmLayer8checkIg_E">
<span id="paddle::LstmLayer::checkIg___MatrixPtr"></span><span class="target" id="paddleclasspaddle_1_1LstmLayer_1aa5457444a9d9badfa9402a511fc26d43"></span><a class="reference internal" href="../../math/matrix/matrix.html#_CPPv2N6paddle9MatrixPtrE" title="paddle::MatrixPtr">MatrixPtr</a> <code class="descname">checkIg_</code><a class="headerlink" href="#_CPPv2N6paddle9LstmLayer8checkIg_E" title="Permalink to this definition">¶</a></dt>
Y
Yu Yang 已提交
3111 3112
<dd><p>The peephole connection for input gate. </p>
</dd></dl>
Y
Yu Yang 已提交
3113 3114 3115 3116

<dl class="member">
<dt id="_CPPv2N6paddle9LstmLayer8checkFg_E">
<span id="paddle::LstmLayer::checkFg___MatrixPtr"></span><span class="target" id="paddleclasspaddle_1_1LstmLayer_1aad87b56f463f7b0460e227e2d819dd9d"></span><a class="reference internal" href="../../math/matrix/matrix.html#_CPPv2N6paddle9MatrixPtrE" title="paddle::MatrixPtr">MatrixPtr</a> <code class="descname">checkFg_</code><a class="headerlink" href="#_CPPv2N6paddle9LstmLayer8checkFg_E" title="Permalink to this definition">¶</a></dt>
Y
Yu Yang 已提交
3117 3118
<dd><p>The peephole connection for forget gate. </p>
</dd></dl>
Y
Yu Yang 已提交
3119 3120 3121 3122

<dl class="member">
<dt id="_CPPv2N6paddle9LstmLayer8checkOg_E">
<span id="paddle::LstmLayer::checkOg___MatrixPtr"></span><span class="target" id="paddleclasspaddle_1_1LstmLayer_1a9ed73496e458c389c3257559721de078"></span><a class="reference internal" href="../../math/matrix/matrix.html#_CPPv2N6paddle9MatrixPtrE" title="paddle::MatrixPtr">MatrixPtr</a> <code class="descname">checkOg_</code><a class="headerlink" href="#_CPPv2N6paddle9LstmLayer8checkOg_E" title="Permalink to this definition">¶</a></dt>
Y
Yu Yang 已提交
3123 3124
<dd><p>The peephole connection for output gate. </p>
</dd></dl>
Y
Yu Yang 已提交
3125 3126 3127 3128

<dl class="member">
<dt id="_CPPv2N6paddle9LstmLayer14localBiasGrad_E">
<span id="paddle::LstmLayer::localBiasGrad___MatrixPtr"></span><span class="target" id="paddleclasspaddle_1_1LstmLayer_1a9ea1fed33a8f44d2907712d4959d4e68"></span><a class="reference internal" href="../../math/matrix/matrix.html#_CPPv2N6paddle9MatrixPtrE" title="paddle::MatrixPtr">MatrixPtr</a> <code class="descname">localBiasGrad_</code><a class="headerlink" href="#_CPPv2N6paddle9LstmLayer14localBiasGrad_E" title="Permalink to this definition">¶</a></dt>
Y
Yu Yang 已提交
3129 3130
<dd><p>The gradient of real bias. </p>
</dd></dl>
Y
Yu Yang 已提交
3131 3132 3133 3134

<dl class="member">
<dt id="_CPPv2N6paddle9LstmLayer12checkIgGrad_E">
<span id="paddle::LstmLayer::checkIgGrad___MatrixPtr"></span><span class="target" id="paddleclasspaddle_1_1LstmLayer_1a7356cbc10b129b84cc4dee666e18e2ae"></span><a class="reference internal" href="../../math/matrix/matrix.html#_CPPv2N6paddle9MatrixPtrE" title="paddle::MatrixPtr">MatrixPtr</a> <code class="descname">checkIgGrad_</code><a class="headerlink" href="#_CPPv2N6paddle9LstmLayer12checkIgGrad_E" title="Permalink to this definition">¶</a></dt>
Y
Yu Yang 已提交
3135 3136
<dd><p>The gradient of peephole connection for input gates. </p>
</dd></dl>
Y
Yu Yang 已提交
3137 3138 3139 3140

<dl class="member">
<dt id="_CPPv2N6paddle9LstmLayer12checkFgGrad_E">
<span id="paddle::LstmLayer::checkFgGrad___MatrixPtr"></span><span class="target" id="paddleclasspaddle_1_1LstmLayer_1ac69563893568b98eb3f9e1d67724a5ca"></span><a class="reference internal" href="../../math/matrix/matrix.html#_CPPv2N6paddle9MatrixPtrE" title="paddle::MatrixPtr">MatrixPtr</a> <code class="descname">checkFgGrad_</code><a class="headerlink" href="#_CPPv2N6paddle9LstmLayer12checkFgGrad_E" title="Permalink to this definition">¶</a></dt>
Y
Yu Yang 已提交
3141 3142
<dd><p>The gradient of peephole connection for forget gates. </p>
</dd></dl>
Y
Yu Yang 已提交
3143 3144 3145 3146

<dl class="member">
<dt id="_CPPv2N6paddle9LstmLayer12checkOgGrad_E">
<span id="paddle::LstmLayer::checkOgGrad___MatrixPtr"></span><span class="target" id="paddleclasspaddle_1_1LstmLayer_1af0c44e0bc913f4f49c291d0a566a6368"></span><a class="reference internal" href="../../math/matrix/matrix.html#_CPPv2N6paddle9MatrixPtrE" title="paddle::MatrixPtr">MatrixPtr</a> <code class="descname">checkOgGrad_</code><a class="headerlink" href="#_CPPv2N6paddle9LstmLayer12checkOgGrad_E" title="Permalink to this definition">¶</a></dt>
Y
Yu Yang 已提交
3147 3148
<dd><p>The gradient of peephole connection for output gates. </p>
</dd></dl>
Y
Yu Yang 已提交
3149 3150 3151 3152

<dl class="member">
<dt id="_CPPv2N6paddle9LstmLayer6state_E">
<span id="paddle::LstmLayer::state___Argument"></span><span class="target" id="paddleclasspaddle_1_1LstmLayer_1a578ea77a3a2937f4c11d5e85abb540d9"></span><a class="reference internal" href="../../parameter/parameter/parameter.html#_CPPv2N6paddle8ArgumentE" title="paddle::Argument">Argument</a> <code class="descname">state_</code><a class="headerlink" href="#_CPPv2N6paddle9LstmLayer6state_E" title="Permalink to this definition">¶</a></dt>
Y
Yu Yang 已提交
3153 3154
<dd><p>Stores the cell state of previous time step, namely <span class="math">\(c_{t-1}\)</span>. </p>
</dd></dl>
Y
Yu Yang 已提交
3155 3156 3157 3158

<dl class="member">
<dt id="_CPPv2N6paddle9LstmLayer10preOutput_E">
<span id="paddle::LstmLayer::preOutput___Argument"></span><span class="target" id="paddleclasspaddle_1_1LstmLayer_1a30848b02cc2723995620b7a57d50d7a2"></span><a class="reference internal" href="../../parameter/parameter/parameter.html#_CPPv2N6paddle8ArgumentE" title="paddle::Argument">Argument</a> <code class="descname">preOutput_</code><a class="headerlink" href="#_CPPv2N6paddle9LstmLayer10preOutput_E" title="Permalink to this definition">¶</a></dt>
Y
Yu Yang 已提交
3159 3160
<dd><p>Stores the hidden of previous time step, namely <span class="math">\(h_{t-1}\)</span>. </p>
</dd></dl>
Y
Yu Yang 已提交
3161 3162 3163 3164

<dl class="member">
<dt id="_CPPv2N6paddle9LstmLayer5gate_E">
<span id="paddle::LstmLayer::gate___Argument"></span><span class="target" id="paddleclasspaddle_1_1LstmLayer_1a3b11e8c505af58c777a097a9a3640360"></span><a class="reference internal" href="../../parameter/parameter/parameter.html#_CPPv2N6paddle8ArgumentE" title="paddle::Argument">Argument</a> <code class="descname">gate_</code><a class="headerlink" href="#_CPPv2N6paddle9LstmLayer5gate_E" title="Permalink to this definition">¶</a></dt>
Y
Yu Yang 已提交
3165 3166
<dd><p>Stores the value and gradient of four gates, namely <span class="math">\(i_t, f_t, o_t, c_t\)</span>. </p>
</dd></dl>
Y
Yu Yang 已提交
3167 3168 3169 3170

<dl class="member">
<dt id="_CPPv2N6paddle9LstmLayer9reversed_E">
<span id="paddle::LstmLayer::reversed___b"></span><span class="target" id="paddleclasspaddle_1_1LstmLayer_1aefb72d6398ca27883185f26e6b568e48"></span>bool <code class="descname">reversed_</code><a class="headerlink" href="#_CPPv2N6paddle9LstmLayer9reversed_E" title="Permalink to this definition">¶</a></dt>
Y
Yu Yang 已提交
3171 3172
<dd><p>Whether it is reversed lstm. </p>
</dd></dl>
Y
Yu Yang 已提交
3173 3174 3175 3176

<dl class="member">
<dt id="_CPPv2N6paddle9LstmLayer9useBatch_E">
<span id="paddle::LstmLayer::useBatch___b"></span><span class="target" id="paddleclasspaddle_1_1LstmLayer_1ab367f4c61fd5a3e03d8be8b1f1c922b3"></span>bool <code class="descname">useBatch_</code><a class="headerlink" href="#_CPPv2N6paddle9LstmLayer9useBatch_E" title="Permalink to this definition">¶</a></dt>
Y
Yu Yang 已提交
3177 3178
<dd><p>Whether to use batch method to compute. </p>
</dd></dl>
Y
Yu Yang 已提交
3179 3180 3181 3182

<dl class="member">
<dt id="_CPPv2N6paddle9LstmLayer15useSeqParallel_E">
<span id="paddle::LstmLayer::useSeqParallel___b"></span><span class="target" id="paddleclasspaddle_1_1LstmLayer_1a031e723b62ade9fc6b2cc6a1aee01b55"></span>bool <code class="descname">useSeqParallel_</code><a class="headerlink" href="#_CPPv2N6paddle9LstmLayer15useSeqParallel_E" title="Permalink to this definition">¶</a></dt>
Y
Yu Yang 已提交
3183 3184
<dd><p>Whether to use sequence parallell method to compute. </p>
</dd></dl>
Y
Yu Yang 已提交
3185 3186 3187 3188

<dl class="member">
<dt id="_CPPv2N6paddle9LstmLayer11batchValue_E">
<span id="paddle::LstmLayer::batchValue___std::unique_ptr:SequenceToBatch:"></span><span class="target" id="paddleclasspaddle_1_1LstmLayer_1a74ae42b89d0634d05cf7d7eb823879c7"></span>std::unique_ptr&lt;<a class="reference internal" href="#_CPPv2N6paddle15SequenceToBatchE" title="paddle::SequenceToBatch">SequenceToBatch</a>&gt; <code class="descname">batchValue_</code><a class="headerlink" href="#_CPPv2N6paddle9LstmLayer11batchValue_E" title="Permalink to this definition">¶</a></dt>
Y
Yu Yang 已提交
3189 3190
<dd><p>batchValue_ is used in method of batch calculation. It stores the batch value after reorganized input. </p>
</dd></dl>
Y
Yu Yang 已提交
3191 3192 3193 3194

<dl class="member">
<dt id="_CPPv2N6paddle9LstmLayer10batchGrad_E">
<span id="paddle::LstmLayer::batchGrad___std::unique_ptr:SequenceToBatch:"></span><span class="target" id="paddleclasspaddle_1_1LstmLayer_1afab99330c37418be2aca740408b7fe85"></span>std::unique_ptr&lt;<a class="reference internal" href="#_CPPv2N6paddle15SequenceToBatchE" title="paddle::SequenceToBatch">SequenceToBatch</a>&gt; <code class="descname">batchGrad_</code><a class="headerlink" href="#_CPPv2N6paddle9LstmLayer10batchGrad_E" title="Permalink to this definition">¶</a></dt>
Y
Yu Yang 已提交
3195 3196
<dd><p>The gradient of batchValue_. </p>
</dd></dl>
Y
Yu Yang 已提交
3197 3198 3199 3200

<dl class="member">
<dt id="_CPPv2N6paddle9LstmLayer10prevState_E">
<span id="paddle::LstmLayer::prevState___MatrixPtr"></span><span class="target" id="paddleclasspaddle_1_1LstmLayer_1a30bd80ec9bbb342f69cc429b4a1db7bf"></span><a class="reference internal" href="../../math/matrix/matrix.html#_CPPv2N6paddle9MatrixPtrE" title="paddle::MatrixPtr">MatrixPtr</a> <code class="descname">prevState_</code><a class="headerlink" href="#_CPPv2N6paddle9LstmLayer10prevState_E" title="Permalink to this definition">¶</a></dt>
Y
Yu Yang 已提交
3201 3202
<dd><p>Used in generation and stores the state of previous time step. </p>
</dd></dl>
Y
Yu Yang 已提交
3203 3204 3205 3206

<dl class="member">
<dt id="_CPPv2N6paddle9LstmLayer11prevOutput_E">
<span id="paddle::LstmLayer::prevOutput___MatrixPtr"></span><span class="target" id="paddleclasspaddle_1_1LstmLayer_1a05637ccdbbbc6224bdb2e214a1c21e14"></span><a class="reference internal" href="../../math/matrix/matrix.html#_CPPv2N6paddle9MatrixPtrE" title="paddle::MatrixPtr">MatrixPtr</a> <code class="descname">prevOutput_</code><a class="headerlink" href="#_CPPv2N6paddle9LstmLayer11prevOutput_E" title="Permalink to this definition">¶</a></dt>
Y
Yu Yang 已提交
3207 3208
<dd><p>Used in generation and stores the output of previous time step. </p>
</dd></dl>
Y
Yu Yang 已提交
3209 3210 3211 3212 3213 3214 3215 3216 3217

<dl class="member">
<dt id="_CPPv2N6paddle9LstmLayer17prevBatchOutput2_E">
<span id="paddle::LstmLayer::prevBatchOutput2___MatrixPtr"></span><span class="target" id="paddleclasspaddle_1_1LstmLayer_1a28a88105d01a0d3f9a7f8db88253003e"></span><a class="reference internal" href="../../math/matrix/matrix.html#_CPPv2N6paddle9MatrixPtrE" title="paddle::MatrixPtr">MatrixPtr</a> <code class="descname">prevBatchOutput2_</code><a class="headerlink" href="#_CPPv2N6paddle9LstmLayer17prevBatchOutput2_E" title="Permalink to this definition">¶</a></dt>
<dd></dd></dl>

<dl class="member">
<dt id="_CPPv2N6paddle9LstmLayer11totalState_E">
<span id="paddle::LstmLayer::totalState___MatrixPtr"></span><span class="target" id="paddleclasspaddle_1_1LstmLayer_1a6b5837563860f057c8289518f782832b"></span><a class="reference internal" href="../../math/matrix/matrix.html#_CPPv2N6paddle9MatrixPtrE" title="paddle::MatrixPtr">MatrixPtr</a> <code class="descname">totalState_</code><a class="headerlink" href="#_CPPv2N6paddle9LstmLayer11totalState_E" title="Permalink to this definition">¶</a></dt>
Y
Yu Yang 已提交
3218 3219
<dd><p>The total state. </p>
</dd></dl>
Y
Yu Yang 已提交
3220 3221 3222 3223 3224 3225 3226 3227 3228 3229

</div>
</dd></dl>

</div>
<div class="section" id="lstmsteplayer">
<h3>LstmStepLayer<a class="headerlink" href="#lstmsteplayer" title="Permalink to this headline">¶</a></h3>
<dl class="class">
<dt id="_CPPv2N6paddle13LstmStepLayerE">
<span id="paddle::LstmStepLayer"></span><span class="target" id="paddleclasspaddle_1_1LstmStepLayer"></span><em class="property">class </em><code class="descclassname">paddle::</code><code class="descname">LstmStepLayer</code><a class="headerlink" href="#_CPPv2N6paddle13LstmStepLayerE" title="Permalink to this definition">¶</a></dt>
3230
<dd><p>Inherits from <a class="reference internal" href="#paddleclasspaddle_1_1Layer"><span class="std std-ref">paddle::Layer</span></a>, <a class="reference internal" href="#paddleclasspaddle_1_1LstmCompute"><span class="std std-ref">paddle::LstmCompute</span></a></p>
3231
<div class="breathe-sectiondef docutils container">
Y
Yu Yang 已提交
3232 3233 3234 3235 3236 3237 3238 3239 3240 3241 3242 3243 3244
<p class="breathe-sectiondef-title rubric">Public Functions</p>
<dl class="function">
<dt id="_CPPv2N6paddle13LstmStepLayer13LstmStepLayerERK11LayerConfig">
<span id="paddle::LstmStepLayer::LstmStepLayer__LayerConfigCR"></span><span class="target" id="paddleclasspaddle_1_1LstmStepLayer_1a509f50cfc015ea7f82abbe7990568eda"></span><code class="descname">LstmStepLayer</code><span class="sig-paren">(</span><em class="property">const</em> LayerConfig &amp;<em>config</em><span class="sig-paren">)</span><a class="headerlink" href="#_CPPv2N6paddle13LstmStepLayer13LstmStepLayerERK11LayerConfig" title="Permalink to this definition">¶</a></dt>
<dd></dd></dl>

<dl class="function">
<dt id="_CPPv2N6paddle13LstmStepLayerD0Ev">
<span id="paddle::LstmStepLayer::~LstmStepLayer"></span><span class="target" id="paddleclasspaddle_1_1LstmStepLayer_1ade04c2e21640d3c25f5d3f185d5469a1"></span><code class="descname">~LstmStepLayer</code><span class="sig-paren">(</span><span class="sig-paren">)</span><a class="headerlink" href="#_CPPv2N6paddle13LstmStepLayerD0Ev" title="Permalink to this definition">¶</a></dt>
<dd></dd></dl>

<dl class="function">
<dt id="_CPPv2N6paddle13LstmStepLayer4initERK8LayerMapRK12ParameterMap">
3245
<span id="paddle::LstmStepLayer::init__LayerMapCR.ParameterMapCR"></span><span class="target" id="paddleclasspaddle_1_1LstmStepLayer_1a794c401dbaedae6f119fc4dd2ac49950"></span>bool <code class="descname">init</code><span class="sig-paren">(</span><em class="property">const</em> LayerMap &amp;<em>layerMap</em>, <em class="property">const</em> <a class="reference internal" href="../../parameter/parameter/parameter.html#_CPPv2N6paddle12ParameterMapE" title="paddle::ParameterMap">ParameterMap</a> &amp;<em>parameterMap</em><span class="sig-paren">)</span><a class="headerlink" href="#_CPPv2N6paddle13LstmStepLayer4initERK8LayerMapRK12ParameterMap" title="Permalink to this definition">¶</a></dt>
Y
Yu Yang 已提交
3246 3247 3248 3249 3250
<dd><p>Intialization. For example, adding input layers from layerMap and parameterMap. </p>
</dd></dl>

<dl class="function">
<dt id="_CPPv2N6paddle13LstmStepLayer7forwardE8PassType">
3251
<span id="paddle::LstmStepLayer::forward__PassType"></span><span class="target" id="paddleclasspaddle_1_1LstmStepLayer_1ac922a29656d65f2e999c641e4edc8b69"></span>void <code class="descname">forward</code><span class="sig-paren">(</span>PassType <em>passType</em><span class="sig-paren">)</span><a class="headerlink" href="#_CPPv2N6paddle13LstmStepLayer7forwardE8PassType" title="Permalink to this definition">¶</a></dt>
Y
Yu Yang 已提交
3252 3253 3254 3255 3256
<dd><p>Forward propagation. All inherited implementation should call Layer::foward() function. </p>
</dd></dl>

<dl class="function">
<dt id="_CPPv2N6paddle13LstmStepLayer8backwardERK14UpdateCallback">
3257
<span id="paddle::LstmStepLayer::backward__UpdateCallbackCR"></span><span class="target" id="paddleclasspaddle_1_1LstmStepLayer_1a3f6214e06bd0eb6534b4cb9d4847b71d"></span>void <code class="descname">backward</code><span class="sig-paren">(</span><em class="property">const</em> <a class="reference internal" href="../../parameter/parameter/parameter.html#_CPPv2N6paddle14UpdateCallbackE" title="paddle::UpdateCallback">UpdateCallback</a> &amp;<em>callback</em> = nullptr<span class="sig-paren">)</span><a class="headerlink" href="#_CPPv2N6paddle13LstmStepLayer8backwardERK14UpdateCallback" title="Permalink to this definition">¶</a></dt>
3258
<dd><p>Backward propagation. Should only be called after <a class="reference internal" href="#paddleclasspaddle_1_1Layer_1a12386b3f20dd731e7ceaa2c61667cbe1"><span class="std std-ref">Layer::forward()</span></a> function. </p>
Y
Yu Yang 已提交
3259 3260 3261
</dd></dl>

</div>
3262
<div class="breathe-sectiondef docutils container">
Y
Yu Yang 已提交
3263 3264 3265 3266 3267 3268 3269 3270 3271 3272 3273 3274 3275 3276 3277 3278 3279 3280 3281 3282 3283 3284 3285 3286 3287 3288 3289 3290 3291 3292 3293 3294 3295 3296 3297 3298 3299 3300 3301 3302 3303 3304 3305 3306 3307 3308 3309 3310 3311 3312 3313 3314 3315 3316 3317 3318 3319 3320 3321 3322
<p class="breathe-sectiondef-title rubric">Protected Attributes</p>
<dl class="member">
<dt id="_CPPv2N6paddle13LstmStepLayer6state_E">
<span id="paddle::LstmStepLayer::state___Argument"></span><span class="target" id="paddleclasspaddle_1_1LstmStepLayer_1ac685e097d3980d12d21fdee653c5a242"></span><a class="reference internal" href="../../parameter/parameter/parameter.html#_CPPv2N6paddle8ArgumentE" title="paddle::Argument">Argument</a> <code class="descname">state_</code><a class="headerlink" href="#_CPPv2N6paddle13LstmStepLayer6state_E" title="Permalink to this definition">¶</a></dt>
<dd></dd></dl>

<dl class="member">
<dt id="_CPPv2N6paddle13LstmStepLayer5gate_E">
<span id="paddle::LstmStepLayer::gate___Argument"></span><span class="target" id="paddleclasspaddle_1_1LstmStepLayer_1a620e1be9bd694a03385ab947f35d9a48"></span><a class="reference internal" href="../../parameter/parameter/parameter.html#_CPPv2N6paddle8ArgumentE" title="paddle::Argument">Argument</a> <code class="descname">gate_</code><a class="headerlink" href="#_CPPv2N6paddle13LstmStepLayer5gate_E" title="Permalink to this definition">¶</a></dt>
<dd></dd></dl>

<dl class="member">
<dt id="_CPPv2N6paddle13LstmStepLayer12stateActive_E">
<span id="paddle::LstmStepLayer::stateActive___Argument"></span><span class="target" id="paddleclasspaddle_1_1LstmStepLayer_1a56b8984e1068eb7912045c48e6053100"></span><a class="reference internal" href="../../parameter/parameter/parameter.html#_CPPv2N6paddle8ArgumentE" title="paddle::Argument">Argument</a> <code class="descname">stateActive_</code><a class="headerlink" href="#_CPPv2N6paddle13LstmStepLayer12stateActive_E" title="Permalink to this definition">¶</a></dt>
<dd></dd></dl>

<dl class="member">
<dt id="_CPPv2N6paddle13LstmStepLayer8checkIg_E">
<span id="paddle::LstmStepLayer::checkIg___MatrixPtr"></span><span class="target" id="paddleclasspaddle_1_1LstmStepLayer_1ab45f50312805d5dd1479564356a54d22"></span><a class="reference internal" href="../../math/matrix/matrix.html#_CPPv2N6paddle9MatrixPtrE" title="paddle::MatrixPtr">MatrixPtr</a> <code class="descname">checkIg_</code><a class="headerlink" href="#_CPPv2N6paddle13LstmStepLayer8checkIg_E" title="Permalink to this definition">¶</a></dt>
<dd></dd></dl>

<dl class="member">
<dt id="_CPPv2N6paddle13LstmStepLayer8checkFg_E">
<span id="paddle::LstmStepLayer::checkFg___MatrixPtr"></span><span class="target" id="paddleclasspaddle_1_1LstmStepLayer_1aa32e29957bf96d63c682d97b2515e50d"></span><a class="reference internal" href="../../math/matrix/matrix.html#_CPPv2N6paddle9MatrixPtrE" title="paddle::MatrixPtr">MatrixPtr</a> <code class="descname">checkFg_</code><a class="headerlink" href="#_CPPv2N6paddle13LstmStepLayer8checkFg_E" title="Permalink to this definition">¶</a></dt>
<dd></dd></dl>

<dl class="member">
<dt id="_CPPv2N6paddle13LstmStepLayer8checkOg_E">
<span id="paddle::LstmStepLayer::checkOg___MatrixPtr"></span><span class="target" id="paddleclasspaddle_1_1LstmStepLayer_1a1e43f6d15f2b2d2bd1564dfb506393e4"></span><a class="reference internal" href="../../math/matrix/matrix.html#_CPPv2N6paddle9MatrixPtrE" title="paddle::MatrixPtr">MatrixPtr</a> <code class="descname">checkOg_</code><a class="headerlink" href="#_CPPv2N6paddle13LstmStepLayer8checkOg_E" title="Permalink to this definition">¶</a></dt>
<dd></dd></dl>

<dl class="member">
<dt id="_CPPv2N6paddle13LstmStepLayer12checkIgGrad_E">
<span id="paddle::LstmStepLayer::checkIgGrad___MatrixPtr"></span><span class="target" id="paddleclasspaddle_1_1LstmStepLayer_1abe52a745028a53a03ac3892ea6a4a22d"></span><a class="reference internal" href="../../math/matrix/matrix.html#_CPPv2N6paddle9MatrixPtrE" title="paddle::MatrixPtr">MatrixPtr</a> <code class="descname">checkIgGrad_</code><a class="headerlink" href="#_CPPv2N6paddle13LstmStepLayer12checkIgGrad_E" title="Permalink to this definition">¶</a></dt>
<dd></dd></dl>

<dl class="member">
<dt id="_CPPv2N6paddle13LstmStepLayer12checkFgGrad_E">
<span id="paddle::LstmStepLayer::checkFgGrad___MatrixPtr"></span><span class="target" id="paddleclasspaddle_1_1LstmStepLayer_1a70974f3a29ef5339d53bf124339fcc41"></span><a class="reference internal" href="../../math/matrix/matrix.html#_CPPv2N6paddle9MatrixPtrE" title="paddle::MatrixPtr">MatrixPtr</a> <code class="descname">checkFgGrad_</code><a class="headerlink" href="#_CPPv2N6paddle13LstmStepLayer12checkFgGrad_E" title="Permalink to this definition">¶</a></dt>
<dd></dd></dl>

<dl class="member">
<dt id="_CPPv2N6paddle13LstmStepLayer12checkOgGrad_E">
<span id="paddle::LstmStepLayer::checkOgGrad___MatrixPtr"></span><span class="target" id="paddleclasspaddle_1_1LstmStepLayer_1ae2b90b34b836a61de780a7b565f7fabc"></span><a class="reference internal" href="../../math/matrix/matrix.html#_CPPv2N6paddle9MatrixPtrE" title="paddle::MatrixPtr">MatrixPtr</a> <code class="descname">checkOgGrad_</code><a class="headerlink" href="#_CPPv2N6paddle13LstmStepLayer12checkOgGrad_E" title="Permalink to this definition">¶</a></dt>
<dd></dd></dl>

<dl class="member">
<dt id="_CPPv2N6paddle13LstmStepLayer7weight_E">
<span id="paddle::LstmStepLayer::weight___std::unique_ptr:Weight:"></span><span class="target" id="paddleclasspaddle_1_1LstmStepLayer_1ad1666ff575f91e5ce616945e6802717b"></span>std::unique_ptr&lt;<a class="reference internal" href="../../parameter/parameter/parameter.html#_CPPv2N6paddle6WeightE" title="paddle::Weight">Weight</a>&gt; <code class="descname">weight_</code><a class="headerlink" href="#_CPPv2N6paddle13LstmStepLayer7weight_E" title="Permalink to this definition">¶</a></dt>
<dd></dd></dl>

</div>
</dd></dl>

</div>
<div class="section" id="lstmcompute">
<h3>LstmCompute<a class="headerlink" href="#lstmcompute" title="Permalink to this headline">¶</a></h3>
<dl class="class">
<dt id="_CPPv2N6paddle11LstmComputeE">
<span id="paddle::LstmCompute"></span><span class="target" id="paddleclasspaddle_1_1LstmCompute"></span><em class="property">class </em><code class="descclassname">paddle::</code><code class="descname">LstmCompute</code><a class="headerlink" href="#_CPPv2N6paddle11LstmComputeE" title="Permalink to this definition">¶</a></dt>
3323
<dd><p>Subclassed by <a class="reference internal" href="#paddleclasspaddle_1_1LstmLayer"><span class="std std-ref">paddle::LstmLayer</span></a>, <a class="reference internal" href="#paddleclasspaddle_1_1LstmStepLayer"><span class="std std-ref">paddle::LstmStepLayer</span></a></p>
3324
<div class="breathe-sectiondef docutils container">
Y
Yu Yang 已提交
3325 3326 3327 3328 3329 3330 3331 3332 3333 3334 3335
<p class="breathe-sectiondef-title rubric">Public Functions</p>
<dl class="function">
<dt id="_CPPv2N6paddle11LstmCompute4initER11LayerConfig">
<span id="paddle::LstmCompute::init__LayerConfigR"></span><span class="target" id="paddleclasspaddle_1_1LstmCompute_1a2901259341430edceeb031a4ffb9de6e"></span>void <code class="descname">init</code><span class="sig-paren">(</span>LayerConfig &amp;<em>config</em><span class="sig-paren">)</span><a class="headerlink" href="#_CPPv2N6paddle11LstmCompute4initER11LayerConfig" title="Permalink to this definition">¶</a></dt>
<dd></dd></dl>

<dl class="function">
<dt>
<em class="property">template </em>&lt;bool <em>useGpu</em>&gt;</dt>
<dt id="_CPPv2N6paddle11LstmCompute12forwardBatchE13hl_lstm_valueii">
<span id="paddle::LstmCompute::forwardBatch__hl_lstm_value.i.i"></span><span class="target" id="paddleclasspaddle_1_1LstmCompute_1ac829b94d8ca20662603956df53c69d16"></span>void <code class="descname">forwardBatch</code><span class="sig-paren">(</span><a class="reference internal" href="../../cuda/utils/utils.html#_CPPv213hl_lstm_value" title="hl_lstm_value">hl_lstm_value</a> <em>value</em>, int <em>frameSize</em>, int <em>batchSize</em><span class="sig-paren">)</span><a class="headerlink" href="#_CPPv2N6paddle11LstmCompute12forwardBatchE13hl_lstm_valueii" title="Permalink to this definition">¶</a></dt>
3336
<dd><p><a class="reference internal" href="#paddleclasspaddle_1_1LstmLayer"><span class="std std-ref">LstmLayer</span></a> batch compute API (forwardBatch, backwardBatch). If use batch compute api, lstm value(and grad) need to be batch structure. Compute order: forwardBatch: for 0 &lt;= id &lt; numBatch backwardBatch: for numBatch &gt; id &gt;= 0 </p>
Y
Yu Yang 已提交
3337 3338 3339 3340 3341 3342 3343 3344 3345 3346 3347 3348 3349 3350
</dd></dl>

<dl class="function">
<dt>
<em class="property">template </em>&lt;bool <em>useGpu</em>&gt;</dt>
<dt id="_CPPv2N6paddle11LstmCompute13backwardBatchE13hl_lstm_value12hl_lstm_gradii">
<span id="paddle::LstmCompute::backwardBatch__hl_lstm_value.hl_lstm_grad.i.i"></span><span class="target" id="paddleclasspaddle_1_1LstmCompute_1a3073e45387fce5f45f8f90d5e9f2dfac"></span>void <code class="descname">backwardBatch</code><span class="sig-paren">(</span><a class="reference internal" href="../../cuda/utils/utils.html#_CPPv213hl_lstm_value" title="hl_lstm_value">hl_lstm_value</a> <em>value</em>, <a class="reference internal" href="../../cuda/utils/utils.html#_CPPv212hl_lstm_grad" title="hl_lstm_grad">hl_lstm_grad</a> <em>grad</em>, int <em>frameSize</em>, int <em>batchSize</em><span class="sig-paren">)</span><a class="headerlink" href="#_CPPv2N6paddle11LstmCompute13backwardBatchE13hl_lstm_value12hl_lstm_gradii" title="Permalink to this definition">¶</a></dt>
<dd></dd></dl>

<dl class="function">
<dt>
<em class="property">template </em>&lt;bool <em>useGpu</em>&gt;</dt>
<dt id="_CPPv2N6paddle11LstmCompute18forwardOneSequenceE13hl_lstm_valuei">
<span id="paddle::LstmCompute::forwardOneSequence__hl_lstm_value.i"></span><span class="target" id="paddleclasspaddle_1_1LstmCompute_1acb017d1cac348c6c4597c7cf19b7d8b9"></span>void <code class="descname">forwardOneSequence</code><span class="sig-paren">(</span><a class="reference internal" href="../../cuda/utils/utils.html#_CPPv213hl_lstm_value" title="hl_lstm_value">hl_lstm_value</a> <em>value</em>, int <em>frameSize</em><span class="sig-paren">)</span><a class="headerlink" href="#_CPPv2N6paddle11LstmCompute18forwardOneSequenceE13hl_lstm_valuei" title="Permalink to this definition">¶</a></dt>
3351
<dd><p><a class="reference internal" href="#paddleclasspaddle_1_1LstmLayer"><span class="std std-ref">LstmLayer</span></a> sequence compute API (forwardOneSequence, backwardOneSequence). Compute order(for each sequence): forwardOneSequence: if (!reversed) for 0 &lt;= seqId &lt; seqLength if (reversed) for seqLength &gt; seqId &gt;= 0 backwardOneSequence: if (!reversed) for seqLength &gt; seqId &gt;= 0 if (reversed) for 0 &lt;= seqId &lt; seqLength </p>
Y
Yu Yang 已提交
3352 3353 3354 3355 3356 3357 3358 3359 3360 3361 3362 3363 3364
</dd></dl>

<dl class="function">
<dt>
<em class="property">template </em>&lt;bool <em>useGpu</em>&gt;</dt>
<dt id="_CPPv2N6paddle11LstmCompute19backwardOneSequenceE13hl_lstm_value12hl_lstm_gradi">
<span id="paddle::LstmCompute::backwardOneSequence__hl_lstm_value.hl_lstm_grad.i"></span><span class="target" id="paddleclasspaddle_1_1LstmCompute_1a2fe33ee1f885aa4624a76e74ca6fa2c1"></span>void <code class="descname">backwardOneSequence</code><span class="sig-paren">(</span><a class="reference internal" href="../../cuda/utils/utils.html#_CPPv213hl_lstm_value" title="hl_lstm_value">hl_lstm_value</a> <em>value</em>, <a class="reference internal" href="../../cuda/utils/utils.html#_CPPv212hl_lstm_grad" title="hl_lstm_grad">hl_lstm_grad</a> <em>grad</em>, int <em>frameSize</em><span class="sig-paren">)</span><a class="headerlink" href="#_CPPv2N6paddle11LstmCompute19backwardOneSequenceE13hl_lstm_value12hl_lstm_gradi" title="Permalink to this definition">¶</a></dt>
<dd></dd></dl>

<dl class="function">
<dt>
<em class="property">template </em>&lt;&gt;</dt>
<dt id="_CPPv2N6paddle11LstmCompute18forwardOneSequenceE13hl_lstm_valuei">
3365
<span class="target" id="paddleclasspaddle_1_1LstmCompute_1acd37b3679f7608988e6c53a6e13381f1"></span>void <code class="descname">forwardOneSequence</code><span class="sig-paren">(</span><a class="reference internal" href="../../cuda/utils/utils.html#_CPPv213hl_lstm_value" title="hl_lstm_value">hl_lstm_value</a> <em>value</em>, int <em>frameSize</em><span class="sig-paren">)</span><a class="headerlink" href="#_CPPv2N6paddle11LstmCompute18forwardOneSequenceE13hl_lstm_valuei" title="Permalink to this definition">¶</a></dt>
Y
Yu Yang 已提交
3366 3367 3368 3369 3370 3371
<dd></dd></dl>

<dl class="function">
<dt>
<em class="property">template </em>&lt;&gt;</dt>
<dt id="_CPPv2N6paddle11LstmCompute19backwardOneSequenceE13hl_lstm_value12hl_lstm_gradi">
3372
<span class="target" id="paddleclasspaddle_1_1LstmCompute_1abca4b43a34eb736e998008e65d09930e"></span>void <code class="descname">backwardOneSequence</code><span class="sig-paren">(</span><a class="reference internal" href="../../cuda/utils/utils.html#_CPPv213hl_lstm_value" title="hl_lstm_value">hl_lstm_value</a> <em>value</em>, <a class="reference internal" href="../../cuda/utils/utils.html#_CPPv212hl_lstm_grad" title="hl_lstm_grad">hl_lstm_grad</a> <em>grad</em>, int <em>frameSize</em><span class="sig-paren">)</span><a class="headerlink" href="#_CPPv2N6paddle11LstmCompute19backwardOneSequenceE13hl_lstm_value12hl_lstm_gradi" title="Permalink to this definition">¶</a></dt>
Y
Yu Yang 已提交
3373 3374 3375 3376 3377 3378
<dd></dd></dl>

<dl class="function">
<dt>
<em class="property">template </em>&lt;&gt;</dt>
<dt id="_CPPv2N6paddle11LstmCompute12forwardBatchE13hl_lstm_valueii">
3379
<span class="target" id="paddleclasspaddle_1_1LstmCompute_1aaa41296c8c04d97bef931bea5f6d500d"></span>void <code class="descname">forwardBatch</code><span class="sig-paren">(</span><a class="reference internal" href="../../cuda/utils/utils.html#_CPPv213hl_lstm_value" title="hl_lstm_value">hl_lstm_value</a> <em>value</em>, int <em>frameSize</em>, int <em>batchSize</em><span class="sig-paren">)</span><a class="headerlink" href="#_CPPv2N6paddle11LstmCompute12forwardBatchE13hl_lstm_valueii" title="Permalink to this definition">¶</a></dt>
Y
Yu Yang 已提交
3380 3381 3382 3383 3384 3385
<dd></dd></dl>

<dl class="function">
<dt>
<em class="property">template </em>&lt;&gt;</dt>
<dt id="_CPPv2N6paddle11LstmCompute13backwardBatchE13hl_lstm_value12hl_lstm_gradii">
3386 3387 3388 3389 3390 3391 3392 3393 3394 3395 3396 3397 3398 3399 3400 3401 3402 3403 3404 3405 3406 3407 3408 3409 3410 3411 3412 3413 3414
<span class="target" id="paddleclasspaddle_1_1LstmCompute_1a0a3fe95b3c613c864cee0fc74e354e49"></span>void <code class="descname">backwardBatch</code><span class="sig-paren">(</span><a class="reference internal" href="../../cuda/utils/utils.html#_CPPv213hl_lstm_value" title="hl_lstm_value">hl_lstm_value</a> <em>value</em>, <a class="reference internal" href="../../cuda/utils/utils.html#_CPPv212hl_lstm_grad" title="hl_lstm_grad">hl_lstm_grad</a> <em>grad</em>, int <em>frameSize</em>, int <em>batchSize</em><span class="sig-paren">)</span><a class="headerlink" href="#_CPPv2N6paddle11LstmCompute13backwardBatchE13hl_lstm_value12hl_lstm_gradii" title="Permalink to this definition">¶</a></dt>
<dd></dd></dl>

<dl class="function">
<dt>
<em class="property">template </em>&lt;&gt;</dt>
<dt>
<span class="target" id="paddleclasspaddle_1_1LstmCompute_1aaa41296c8c04d97bef931bea5f6d500d"></span>void <code class="descname">forwardBatch</code><span class="sig-paren">(</span><a class="reference internal" href="../../cuda/utils/utils.html#_CPPv213hl_lstm_value" title="hl_lstm_value">hl_lstm_value</a> <em>value</em>, int <em>frameSize</em>, int <em>batchSize</em><span class="sig-paren">)</span></dt>
<dd></dd></dl>

<dl class="function">
<dt>
<em class="property">template </em>&lt;&gt;</dt>
<dt>
<span class="target" id="paddleclasspaddle_1_1LstmCompute_1a0a3fe95b3c613c864cee0fc74e354e49"></span>void <code class="descname">backwardBatch</code><span class="sig-paren">(</span><a class="reference internal" href="../../cuda/utils/utils.html#_CPPv213hl_lstm_value" title="hl_lstm_value">hl_lstm_value</a> <em>value</em>, <a class="reference internal" href="../../cuda/utils/utils.html#_CPPv212hl_lstm_grad" title="hl_lstm_grad">hl_lstm_grad</a> <em>grad</em>, int <em>frameSize</em>, int <em>batchSize</em><span class="sig-paren">)</span></dt>
<dd></dd></dl>

<dl class="function">
<dt>
<em class="property">template </em>&lt;&gt;</dt>
<dt>
<span class="target" id="paddleclasspaddle_1_1LstmCompute_1acd37b3679f7608988e6c53a6e13381f1"></span>void <code class="descname">forwardOneSequence</code><span class="sig-paren">(</span><a class="reference internal" href="../../cuda/utils/utils.html#_CPPv213hl_lstm_value" title="hl_lstm_value">hl_lstm_value</a> <em>value</em>, int <em>frameSize</em><span class="sig-paren">)</span></dt>
<dd></dd></dl>

<dl class="function">
<dt>
<em class="property">template </em>&lt;&gt;</dt>
<dt>
<span class="target" id="paddleclasspaddle_1_1LstmCompute_1abca4b43a34eb736e998008e65d09930e"></span>void <code class="descname">backwardOneSequence</code><span class="sig-paren">(</span><a class="reference internal" href="../../cuda/utils/utils.html#_CPPv213hl_lstm_value" title="hl_lstm_value">hl_lstm_value</a> <em>value</em>, <a class="reference internal" href="../../cuda/utils/utils.html#_CPPv212hl_lstm_grad" title="hl_lstm_grad">hl_lstm_grad</a> <em>grad</em>, int <em>frameSize</em><span class="sig-paren">)</span></dt>
Y
Yu Yang 已提交
3415 3416 3417
<dd></dd></dl>

</div>
3418
<div class="breathe-sectiondef docutils container">
Y
Yu Yang 已提交
3419 3420 3421 3422 3423 3424 3425 3426 3427 3428 3429 3430 3431 3432 3433 3434 3435 3436 3437 3438 3439 3440 3441 3442 3443 3444 3445 3446
<p class="breathe-sectiondef-title rubric">Public Members</p>
<dl class="member">
<dt id="_CPPv2N6paddle11LstmCompute11activeNode_E">
<span id="paddle::LstmCompute::activeNode___hl_activation_mode_t"></span><span class="target" id="paddleclasspaddle_1_1LstmCompute_1a956c1b1b43a4fc7195fa827de92a0d61"></span><a class="reference internal" href="../../cuda/utils/utils.html#_CPPv220hl_activation_mode_t" title="hl_activation_mode_t">hl_activation_mode_t</a> <code class="descname">activeNode_</code><a class="headerlink" href="#_CPPv2N6paddle11LstmCompute11activeNode_E" title="Permalink to this definition">¶</a></dt>
<dd></dd></dl>

<dl class="member">
<dt id="_CPPv2N6paddle11LstmCompute11activeGate_E">
<span id="paddle::LstmCompute::activeGate___hl_activation_mode_t"></span><span class="target" id="paddleclasspaddle_1_1LstmCompute_1a65f7acb7397a62e7c77b6139f516ab1f"></span><a class="reference internal" href="../../cuda/utils/utils.html#_CPPv220hl_activation_mode_t" title="hl_activation_mode_t">hl_activation_mode_t</a> <code class="descname">activeGate_</code><a class="headerlink" href="#_CPPv2N6paddle11LstmCompute11activeGate_E" title="Permalink to this definition">¶</a></dt>
<dd></dd></dl>

<dl class="member">
<dt id="_CPPv2N6paddle11LstmCompute12activeState_E">
<span id="paddle::LstmCompute::activeState___hl_activation_mode_t"></span><span class="target" id="paddleclasspaddle_1_1LstmCompute_1ab29f59f2e5c6f1b025d48dcce438a8ea"></span><a class="reference internal" href="../../cuda/utils/utils.html#_CPPv220hl_activation_mode_t" title="hl_activation_mode_t">hl_activation_mode_t</a> <code class="descname">activeState_</code><a class="headerlink" href="#_CPPv2N6paddle11LstmCompute12activeState_E" title="Permalink to this definition">¶</a></dt>
<dd></dd></dl>

</div>
</dd></dl>

</div>
</div>
<div class="section" id="mdlstm">
<h2>MDLSTM<a class="headerlink" href="#mdlstm" title="Permalink to this headline">¶</a></h2>
<div class="section" id="mdlstmlayer">
<h3>MDLstmLayer<a class="headerlink" href="#mdlstmlayer" title="Permalink to this headline">¶</a></h3>
<dl class="class">
<dt id="_CPPv2N6paddle11MDLstmLayerE">
<span id="paddle::MDLstmLayer"></span><span class="target" id="paddleclasspaddle_1_1MDLstmLayer"></span><em class="property">class </em><code class="descclassname">paddle::</code><code class="descname">MDLstmLayer</code><a class="headerlink" href="#_CPPv2N6paddle11MDLstmLayerE" title="Permalink to this definition">¶</a></dt>
3447
<dd><p>Inherits from <a class="reference internal" href="#paddleclasspaddle_1_1LstmLayer"><span class="std std-ref">paddle::LstmLayer</span></a></p>
3448
<div class="breathe-sectiondef docutils container">
Y
Yu Yang 已提交
3449 3450 3451 3452 3453 3454 3455 3456
<p class="breathe-sectiondef-title rubric">Public Functions</p>
<dl class="function">
<dt id="_CPPv2N6paddle11MDLstmLayer11MDLstmLayerERK11LayerConfig">
<span id="paddle::MDLstmLayer::MDLstmLayer__LayerConfigCR"></span><span class="target" id="paddleclasspaddle_1_1MDLstmLayer_1af1d1bd54aab2b59e803377296c82260d"></span><code class="descname">MDLstmLayer</code><span class="sig-paren">(</span><em class="property">const</em> LayerConfig &amp;<em>config</em><span class="sig-paren">)</span><a class="headerlink" href="#_CPPv2N6paddle11MDLstmLayer11MDLstmLayerERK11LayerConfig" title="Permalink to this definition">¶</a></dt>
<dd></dd></dl>

<dl class="function">
<dt id="_CPPv2N6paddle11MDLstmLayer4initERK8LayerMapRK12ParameterMap">
3457
<span id="paddle::MDLstmLayer::init__LayerMapCR.ParameterMapCR"></span><span class="target" id="paddleclasspaddle_1_1MDLstmLayer_1ad2f3499b8504ee78295c76f35f0829c0"></span>bool <code class="descname">init</code><span class="sig-paren">(</span><em class="property">const</em> LayerMap &amp;<em>layerMap</em>, <em class="property">const</em> <a class="reference internal" href="../../parameter/parameter/parameter.html#_CPPv2N6paddle12ParameterMapE" title="paddle::ParameterMap">ParameterMap</a> &amp;<em>parameterMap</em><span class="sig-paren">)</span><a class="headerlink" href="#_CPPv2N6paddle11MDLstmLayer4initERK8LayerMapRK12ParameterMap" title="Permalink to this definition">¶</a></dt>
Y
Yu Yang 已提交
3458 3459 3460 3461 3462
<dd><p>Intialization. For example, adding input layers from layerMap and parameterMap. </p>
</dd></dl>

<dl class="function">
<dt id="_CPPv2N6paddle11MDLstmLayer7forwardE8PassType">
3463
<span id="paddle::MDLstmLayer::forward__PassType"></span><span class="target" id="paddleclasspaddle_1_1MDLstmLayer_1ad03ff2fc65f95abf82ea54c0cb4c7b92"></span>void <code class="descname">forward</code><span class="sig-paren">(</span>PassType <em>passType</em><span class="sig-paren">)</span><a class="headerlink" href="#_CPPv2N6paddle11MDLstmLayer7forwardE8PassType" title="Permalink to this definition">¶</a></dt>
Y
Yu Yang 已提交
3464 3465 3466 3467 3468
<dd><p>Forward propagation. All inherited implementation should call Layer::foward() function. </p>
</dd></dl>

<dl class="function">
<dt id="_CPPv2N6paddle11MDLstmLayer8backwardERK14UpdateCallback">
3469
<span id="paddle::MDLstmLayer::backward__UpdateCallbackCR"></span><span class="target" id="paddleclasspaddle_1_1MDLstmLayer_1ae4014114a5265aba313eb6136e955bf5"></span>void <code class="descname">backward</code><span class="sig-paren">(</span><em class="property">const</em> <a class="reference internal" href="../../parameter/parameter/parameter.html#_CPPv2N6paddle14UpdateCallbackE" title="paddle::UpdateCallback">UpdateCallback</a> &amp;<em>callback</em><span class="sig-paren">)</span><a class="headerlink" href="#_CPPv2N6paddle11MDLstmLayer8backwardERK14UpdateCallback" title="Permalink to this definition">¶</a></dt>
3470
<dd><p>Backward propagation. Should only be called after <a class="reference internal" href="#paddleclasspaddle_1_1Layer_1a12386b3f20dd731e7ceaa2c61667cbe1"><span class="std std-ref">Layer::forward()</span></a> function. </p>
Y
Yu Yang 已提交
3471 3472 3473
</dd></dl>

</div>
3474
<div class="breathe-sectiondef docutils container">
Y
Yu Yang 已提交
3475 3476 3477 3478 3479 3480 3481 3482 3483 3484 3485 3486 3487 3488 3489 3490 3491 3492 3493 3494 3495 3496
<p class="breathe-sectiondef-title rubric">Protected Functions</p>
<dl class="function">
<dt id="_CPPv2N6paddle11MDLstmLayer18forwardOneSequenceEiR13CoordIterator">
<span id="paddle::MDLstmLayer::forwardOneSequence__i.CoordIteratorR"></span><span class="target" id="paddleclasspaddle_1_1MDLstmLayer_1a8f327d5aff8287a905b87d52feae1cd6"></span>void <code class="descname">forwardOneSequence</code><span class="sig-paren">(</span>int <em>start</em>, <a class="reference internal" href="#_CPPv2N6paddle13CoordIteratorE" title="paddle::CoordIterator">CoordIterator</a> &amp;<em>coordIter</em><span class="sig-paren">)</span><a class="headerlink" href="#_CPPv2N6paddle11MDLstmLayer18forwardOneSequenceEiR13CoordIterator" title="Permalink to this definition">¶</a></dt>
<dd></dd></dl>

<dl class="function">
<dt id="_CPPv2N6paddle11MDLstmLayer19backwardOneSequenceEiR13CoordIterator">
<span id="paddle::MDLstmLayer::backwardOneSequence__i.CoordIteratorR"></span><span class="target" id="paddleclasspaddle_1_1MDLstmLayer_1a9ece013357892aba1ae304302a260713"></span>void <code class="descname">backwardOneSequence</code><span class="sig-paren">(</span>int <em>start</em>, <a class="reference internal" href="#_CPPv2N6paddle13CoordIteratorE" title="paddle::CoordIterator">CoordIterator</a> &amp;<em>coordIter</em><span class="sig-paren">)</span><a class="headerlink" href="#_CPPv2N6paddle11MDLstmLayer19backwardOneSequenceEiR13CoordIterator" title="Permalink to this definition">¶</a></dt>
<dd></dd></dl>

<dl class="function">
<dt id="_CPPv2N6paddle11MDLstmLayer26forwardGate2OutputSequenceEiR13CoordIterator">
<span id="paddle::MDLstmLayer::forwardGate2OutputSequence__i.CoordIteratorR"></span><span class="target" id="paddleclasspaddle_1_1MDLstmLayer_1a1491fc112f9cb3a5133eb9f260e871d1"></span>void <code class="descname">forwardGate2OutputSequence</code><span class="sig-paren">(</span>int <em>start</em>, <a class="reference internal" href="#_CPPv2N6paddle13CoordIteratorE" title="paddle::CoordIterator">CoordIterator</a> &amp;<em>coordIter</em><span class="sig-paren">)</span><a class="headerlink" href="#_CPPv2N6paddle11MDLstmLayer26forwardGate2OutputSequenceEiR13CoordIterator" title="Permalink to this definition">¶</a></dt>
<dd></dd></dl>

<dl class="function">
<dt id="_CPPv2N6paddle11MDLstmLayer27backwardGate2OutputSequenceEiR13CoordIterator">
<span id="paddle::MDLstmLayer::backwardGate2OutputSequence__i.CoordIteratorR"></span><span class="target" id="paddleclasspaddle_1_1MDLstmLayer_1afec849401d6abd539358f708e6049333"></span>void <code class="descname">backwardGate2OutputSequence</code><span class="sig-paren">(</span>int <em>start</em>, <a class="reference internal" href="#_CPPv2N6paddle13CoordIteratorE" title="paddle::CoordIterator">CoordIterator</a> &amp;<em>coordIter</em><span class="sig-paren">)</span><a class="headerlink" href="#_CPPv2N6paddle11MDLstmLayer27backwardGate2OutputSequenceEiR13CoordIterator" title="Permalink to this definition">¶</a></dt>
<dd></dd></dl>

</div>
3497
<div class="breathe-sectiondef docutils container">
Y
Yu Yang 已提交
3498 3499 3500 3501 3502 3503 3504 3505 3506 3507 3508 3509 3510 3511 3512 3513 3514 3515 3516 3517 3518 3519 3520 3521 3522 3523 3524 3525 3526 3527 3528 3529 3530 3531 3532 3533 3534 3535 3536 3537 3538 3539 3540 3541 3542 3543 3544 3545 3546 3547 3548 3549 3550 3551 3552 3553 3554 3555 3556 3557 3558 3559 3560 3561 3562 3563 3564 3565 3566 3567 3568 3569 3570 3571 3572 3573 3574 3575 3576 3577 3578 3579 3580 3581 3582
<p class="breathe-sectiondef-title rubric">Protected Attributes</p>
<dl class="member">
<dt id="_CPPv2N6paddle11MDLstmLayer15frameInputGate_E">
<span id="paddle::MDLstmLayer::frameInputGate___std::vector:Argument:"></span><span class="target" id="paddleclasspaddle_1_1MDLstmLayer_1a38aea8b3ae783dc5169fd9d6b94e4545"></span>std::vector&lt;<a class="reference internal" href="../../parameter/parameter/parameter.html#_CPPv2N6paddle8ArgumentE" title="paddle::Argument">Argument</a>&gt; <code class="descname">frameInputGate_</code><a class="headerlink" href="#_CPPv2N6paddle11MDLstmLayer15frameInputGate_E" title="Permalink to this definition">¶</a></dt>
<dd></dd></dl>

<dl class="member">
<dt id="_CPPv2N6paddle11MDLstmLayer16frameForgetGate_E">
<span id="paddle::MDLstmLayer::frameForgetGate___std::vector:Argument:"></span><span class="target" id="paddleclasspaddle_1_1MDLstmLayer_1aafad88a6d81195f9f64bf069f1be48c7"></span>std::vector&lt;<a class="reference internal" href="../../parameter/parameter/parameter.html#_CPPv2N6paddle8ArgumentE" title="paddle::Argument">Argument</a>&gt; <code class="descname">frameForgetGate_</code><a class="headerlink" href="#_CPPv2N6paddle11MDLstmLayer16frameForgetGate_E" title="Permalink to this definition">¶</a></dt>
<dd></dd></dl>

<dl class="member">
<dt id="_CPPv2N6paddle11MDLstmLayer16frameOutputGate_E">
<span id="paddle::MDLstmLayer::frameOutputGate___std::vector:Argument:"></span><span class="target" id="paddleclasspaddle_1_1MDLstmLayer_1a1aafc8d4edbb95a2bde56c3146dbfa86"></span>std::vector&lt;<a class="reference internal" href="../../parameter/parameter/parameter.html#_CPPv2N6paddle8ArgumentE" title="paddle::Argument">Argument</a>&gt; <code class="descname">frameOutputGate_</code><a class="headerlink" href="#_CPPv2N6paddle11MDLstmLayer16frameOutputGate_E" title="Permalink to this definition">¶</a></dt>
<dd></dd></dl>

<dl class="member">
<dt id="_CPPv2N6paddle11MDLstmLayer15frameInputNode_E">
<span id="paddle::MDLstmLayer::frameInputNode___std::vector:Argument:"></span><span class="target" id="paddleclasspaddle_1_1MDLstmLayer_1ab31eb0ded69fc91ff61fd644c1238e54"></span>std::vector&lt;<a class="reference internal" href="../../parameter/parameter/parameter.html#_CPPv2N6paddle8ArgumentE" title="paddle::Argument">Argument</a>&gt; <code class="descname">frameInputNode_</code><a class="headerlink" href="#_CPPv2N6paddle11MDLstmLayer15frameInputNode_E" title="Permalink to this definition">¶</a></dt>
<dd></dd></dl>

<dl class="member">
<dt id="_CPPv2N6paddle11MDLstmLayer10frameGate_E">
<span id="paddle::MDLstmLayer::frameGate___std::vector:Argument:"></span><span class="target" id="paddleclasspaddle_1_1MDLstmLayer_1a32a1fbb9e6a6955780e8c25799624991"></span>std::vector&lt;<a class="reference internal" href="../../parameter/parameter/parameter.html#_CPPv2N6paddle8ArgumentE" title="paddle::Argument">Argument</a>&gt; <code class="descname">frameGate_</code><a class="headerlink" href="#_CPPv2N6paddle11MDLstmLayer10frameGate_E" title="Permalink to this definition">¶</a></dt>
<dd></dd></dl>

<dl class="member">
<dt id="_CPPv2N6paddle11MDLstmLayer11frameState_E">
<span id="paddle::MDLstmLayer::frameState___std::vector:Argument:"></span><span class="target" id="paddleclasspaddle_1_1MDLstmLayer_1a38732cd7cc5c6cb634a9a036b609c585"></span>std::vector&lt;<a class="reference internal" href="../../parameter/parameter/parameter.html#_CPPv2N6paddle8ArgumentE" title="paddle::Argument">Argument</a>&gt; <code class="descname">frameState_</code><a class="headerlink" href="#_CPPv2N6paddle11MDLstmLayer11frameState_E" title="Permalink to this definition">¶</a></dt>
<dd></dd></dl>

<dl class="member">
<dt id="_CPPv2N6paddle11MDLstmLayer15framePreOutput_E">
<span id="paddle::MDLstmLayer::framePreOutput___std::vector:Argument:"></span><span class="target" id="paddleclasspaddle_1_1MDLstmLayer_1a87878b96121e1cca79ce5d77d0fea69e"></span>std::vector&lt;<a class="reference internal" href="../../parameter/parameter/parameter.html#_CPPv2N6paddle8ArgumentE" title="paddle::Argument">Argument</a>&gt; <code class="descname">framePreOutput_</code><a class="headerlink" href="#_CPPv2N6paddle11MDLstmLayer15framePreOutput_E" title="Permalink to this definition">¶</a></dt>
<dd></dd></dl>

<dl class="member">
<dt id="_CPPv2N6paddle11MDLstmLayer12frameOutput_E">
<span id="paddle::MDLstmLayer::frameOutput___std::vector:Argument:"></span><span class="target" id="paddleclasspaddle_1_1MDLstmLayer_1a1b87e8496bf4e4b868ce6c6ae07a6abd"></span>std::vector&lt;<a class="reference internal" href="../../parameter/parameter/parameter.html#_CPPv2N6paddle8ArgumentE" title="paddle::Argument">Argument</a>&gt; <code class="descname">frameOutput_</code><a class="headerlink" href="#_CPPv2N6paddle11MDLstmLayer12frameOutput_E" title="Permalink to this definition">¶</a></dt>
<dd></dd></dl>

<dl class="member">
<dt id="_CPPv2N6paddle11MDLstmLayer15activationGate_E">
<span id="paddle::MDLstmLayer::activationGate___std::unique_ptr:ActivationFunction:"></span><span class="target" id="paddleclasspaddle_1_1MDLstmLayer_1a63f6cbbe4446bcb00c1984145cb28086"></span>std::unique_ptr&lt;<a class="reference internal" href="../activations/index.html#_CPPv2N6paddle18ActivationFunctionE" title="paddle::ActivationFunction">ActivationFunction</a>&gt; <code class="descname">activationGate_</code><a class="headerlink" href="#_CPPv2N6paddle11MDLstmLayer15activationGate_E" title="Permalink to this definition">¶</a></dt>
<dd></dd></dl>

<dl class="member">
<dt id="_CPPv2N6paddle11MDLstmLayer16activationState_E">
<span id="paddle::MDLstmLayer::activationState___std::unique_ptr:ActivationFunction:"></span><span class="target" id="paddleclasspaddle_1_1MDLstmLayer_1a68db4ca28856de6cae646d9a097bc4c6"></span>std::unique_ptr&lt;<a class="reference internal" href="../activations/index.html#_CPPv2N6paddle18ActivationFunctionE" title="paddle::ActivationFunction">ActivationFunction</a>&gt; <code class="descname">activationState_</code><a class="headerlink" href="#_CPPv2N6paddle11MDLstmLayer16activationState_E" title="Permalink to this definition">¶</a></dt>
<dd></dd></dl>

<dl class="member">
<dt id="_CPPv2N6paddle11MDLstmLayer8numDims_E">
<span id="paddle::MDLstmLayer::numDims___i"></span><span class="target" id="paddleclasspaddle_1_1MDLstmLayer_1a21cb3afb40ec3beaa7821db51bea1d2a"></span>int <code class="descname">numDims_</code><a class="headerlink" href="#_CPPv2N6paddle11MDLstmLayer8numDims_E" title="Permalink to this definition">¶</a></dt>
<dd></dd></dl>

<dl class="member">
<dt id="_CPPv2N6paddle11MDLstmLayer10numBlocks_E">
<span id="paddle::MDLstmLayer::numBlocks___s"></span><span class="target" id="paddleclasspaddle_1_1MDLstmLayer_1a892e60d00b381ee5511e9e8de2e66bc5"></span>size_t <code class="descname">numBlocks_</code><a class="headerlink" href="#_CPPv2N6paddle11MDLstmLayer10numBlocks_E" title="Permalink to this definition">¶</a></dt>
<dd></dd></dl>

<dl class="member">
<dt id="_CPPv2N6paddle11MDLstmLayer11directions_E">
<span id="paddle::MDLstmLayer::directions___std::vector:b:"></span><span class="target" id="paddleclasspaddle_1_1MDLstmLayer_1aebd91b89dc54ff39cabdb306bd2922e9"></span>std::vector&lt;bool&gt; <code class="descname">directions_</code><a class="headerlink" href="#_CPPv2N6paddle11MDLstmLayer11directions_E" title="Permalink to this definition">¶</a></dt>
<dd></dd></dl>

<dl class="member">
<dt id="_CPPv2N6paddle11MDLstmLayer7delays_E">
<span id="paddle::MDLstmLayer::delays___std::vector:i:"></span><span class="target" id="paddleclasspaddle_1_1MDLstmLayer_1a79f4c174442de8b294ae9389886575fe"></span>std::vector&lt;int&gt; <code class="descname">delays_</code><a class="headerlink" href="#_CPPv2N6paddle11MDLstmLayer7delays_E" title="Permalink to this definition">¶</a></dt>
<dd></dd></dl>

<dl class="member">
<dt id="_CPPv2N6paddle11MDLstmLayer6dimsV_E">
<span id="paddle::MDLstmLayer::dimsV___std::vector:std::vector:i::"></span><span class="target" id="paddleclasspaddle_1_1MDLstmLayer_1a062170a9f1a289f960e80005eb46664c"></span>std::vector&lt;std::vector&lt;int&gt;&gt; <code class="descname">dimsV_</code><a class="headerlink" href="#_CPPv2N6paddle11MDLstmLayer6dimsV_E" title="Permalink to this definition">¶</a></dt>
<dd></dd></dl>

</div>
</dd></dl>

</div>
<div class="section" id="coorditerator">
<h3>CoordIterator<a class="headerlink" href="#coorditerator" title="Permalink to this headline">¶</a></h3>
<dl class="class">
<dt id="_CPPv2N6paddle13CoordIteratorE">
<span id="paddle::CoordIterator"></span><span class="target" id="paddleclasspaddle_1_1CoordIterator"></span><em class="property">class </em><code class="descclassname">paddle::</code><code class="descname">CoordIterator</code><a class="headerlink" href="#_CPPv2N6paddle13CoordIteratorE" title="Permalink to this definition">¶</a></dt>
3583
<dd><div class="breathe-sectiondef docutils container">
Y
Yu Yang 已提交
3584 3585 3586 3587 3588 3589 3590 3591 3592 3593 3594 3595 3596
<p class="breathe-sectiondef-title rubric">Public Functions</p>
<dl class="function">
<dt id="_CPPv2N6paddle13CoordIterator4stepE6size_tb">
<span id="paddle::CoordIterator::step__s.b"></span><span class="target" id="paddleclasspaddle_1_1CoordIterator_1a3fcabf1de122e1bc57122094aa3551d1"></span>void <code class="descname">step</code><span class="sig-paren">(</span>size_t <em>d</em>, bool <em>reversed</em><span class="sig-paren">)</span><a class="headerlink" href="#_CPPv2N6paddle13CoordIterator4stepE6size_tb" title="Permalink to this definition">¶</a></dt>
<dd></dd></dl>

<dl class="function">
<dt id="_CPPv2N6paddle13CoordIterator13CoordIteratorENSt6vectorIiEENSt6vectorIbEE">
<span id="paddle::CoordIterator::CoordIterator__std::vector:i:.std::vector:b:"></span><span class="target" id="paddleclasspaddle_1_1CoordIterator_1a70b6ece3559e49658f33ca1608397359"></span><code class="descname">CoordIterator</code><span class="sig-paren">(</span>std::vector&lt;int&gt; <em>dim</em>, std::vector&lt;bool&gt; <em>directions</em><span class="sig-paren">)</span><a class="headerlink" href="#_CPPv2N6paddle13CoordIterator13CoordIteratorENSt6vectorIiEENSt6vectorIbEE" title="Permalink to this definition">¶</a></dt>
<dd></dd></dl>

<dl class="function">
<dt id="_CPPv2N6paddle13CoordIteratorppEv">
3597
<span id="paddle::CoordIterator::inc-operator"></span><span class="target" id="paddleclasspaddle_1_1CoordIterator_1ada5a4725f3f7ea099e7badfe184cef44"></span><a class="reference internal" href="#_CPPv2N6paddle13CoordIteratorE" title="paddle::CoordIterator">CoordIterator</a> &amp;<code class="descname">operator++</code><span class="sig-paren">(</span><span class="sig-paren">)</span><a class="headerlink" href="#_CPPv2N6paddle13CoordIteratorppEv" title="Permalink to this definition">¶</a></dt>
Y
Yu Yang 已提交
3598 3599 3600 3601
<dd></dd></dl>

<dl class="function">
<dt id="_CPPv2N6paddle13CoordIteratormmEv">
3602
<span id="paddle::CoordIterator::dec-operator"></span><span class="target" id="paddleclasspaddle_1_1CoordIterator_1a700a14104c452fa91a77ecffd12d74a2"></span><a class="reference internal" href="#_CPPv2N6paddle13CoordIteratorE" title="paddle::CoordIterator">CoordIterator</a> &amp;<code class="descname">operator--</code><span class="sig-paren">(</span><span class="sig-paren">)</span><a class="headerlink" href="#_CPPv2N6paddle13CoordIteratormmEv" title="Permalink to this definition">¶</a></dt>
Y
Yu Yang 已提交
3603 3604 3605 3606 3607 3608 3609 3610 3611 3612 3613 3614 3615 3616 3617 3618 3619 3620 3621 3622 3623 3624 3625 3626 3627 3628 3629 3630 3631 3632 3633 3634 3635 3636 3637 3638 3639 3640 3641 3642 3643 3644 3645
<dd></dd></dl>

<dl class="function">
<dt id="_CPPv2N6paddle13CoordIterator6curPosEv">
<span id="paddle::CoordIterator::curPos"></span><span class="target" id="paddleclasspaddle_1_1CoordIterator_1a2d6d5e1d6efa366404e7651c5eefd0ab"></span>std::vector&lt;int&gt; &amp;<code class="descname">curPos</code><span class="sig-paren">(</span><span class="sig-paren">)</span><a class="headerlink" href="#_CPPv2N6paddle13CoordIterator6curPosEv" title="Permalink to this definition">¶</a></dt>
<dd></dd></dl>

<dl class="function">
<dt id="_CPPv2N6paddle13CoordIterator6offsetEv">
<span id="paddle::CoordIterator::offset"></span><span class="target" id="paddleclasspaddle_1_1CoordIterator_1a012947c3f8081677c59d55351a46205b"></span>int <code class="descname">offset</code><span class="sig-paren">(</span><span class="sig-paren">)</span><a class="headerlink" href="#_CPPv2N6paddle13CoordIterator6offsetEv" title="Permalink to this definition">¶</a></dt>
<dd></dd></dl>

<dl class="function">
<dt id="_CPPv2N6paddle13CoordIterator6offsetERKNSt6vectorIiEE">
<span id="paddle::CoordIterator::offset__std::vector:i:CR"></span><span class="target" id="paddleclasspaddle_1_1CoordIterator_1a3abee425a7e1903696553db243c68c9f"></span>int <code class="descname">offset</code><span class="sig-paren">(</span><em class="property">const</em> std::vector&lt;int&gt; &amp;<em>pos</em><span class="sig-paren">)</span><a class="headerlink" href="#_CPPv2N6paddle13CoordIterator6offsetERKNSt6vectorIiEE" title="Permalink to this definition">¶</a></dt>
<dd></dd></dl>

<dl class="function">
<dt id="_CPPv2N6paddle13CoordIterator5beginEv">
<span id="paddle::CoordIterator::begin"></span><span class="target" id="paddleclasspaddle_1_1CoordIterator_1a73f87c02f8acb0e0b6f09a097ea599b4"></span>std::vector&lt;int&gt; &amp;<code class="descname">begin</code><span class="sig-paren">(</span><span class="sig-paren">)</span><a class="headerlink" href="#_CPPv2N6paddle13CoordIterator5beginEv" title="Permalink to this definition">¶</a></dt>
<dd></dd></dl>

<dl class="function">
<dt id="_CPPv2N6paddle13CoordIterator6rbeginEv">
<span id="paddle::CoordIterator::rbegin"></span><span class="target" id="paddleclasspaddle_1_1CoordIterator_1a33bd70f4072971543d9d9cfb6b861f00"></span>std::vector&lt;int&gt; &amp;<code class="descname">rbegin</code><span class="sig-paren">(</span><span class="sig-paren">)</span><a class="headerlink" href="#_CPPv2N6paddle13CoordIterator6rbeginEv" title="Permalink to this definition">¶</a></dt>
<dd></dd></dl>

<dl class="function">
<dt id="_CPPv2N6paddle13CoordIterator3endEv">
<span id="paddle::CoordIterator::end"></span><span class="target" id="paddleclasspaddle_1_1CoordIterator_1a788ef14b3ffa7c209401baa284fbb5ab"></span>bool <code class="descname">end</code><span class="sig-paren">(</span><span class="sig-paren">)</span><a class="headerlink" href="#_CPPv2N6paddle13CoordIterator3endEv" title="Permalink to this definition">¶</a></dt>
<dd></dd></dl>

<dl class="function">
<dt id="_CPPv2N6paddle13CoordIterator9getPrePosERKNSt6vectorIiEEiRNSt6vectorIiEE">
<span id="paddle::CoordIterator::getPrePos__std::vector:i:CR.i.std::vector:i:R"></span><span class="target" id="paddleclasspaddle_1_1CoordIterator_1a7cbecd56f58bced873f0eb70af558811"></span>bool <code class="descname">getPrePos</code><span class="sig-paren">(</span><em class="property">const</em> std::vector&lt;int&gt; &amp;<em>delays</em>, int <em>idx</em>, std::vector&lt;int&gt; &amp;<em>prePos</em><span class="sig-paren">)</span><a class="headerlink" href="#_CPPv2N6paddle13CoordIterator9getPrePosERKNSt6vectorIiEEiRNSt6vectorIiEE" title="Permalink to this definition">¶</a></dt>
<dd></dd></dl>

<dl class="function">
<dt id="_CPPv2N6paddle13CoordIterator10getNextPosERKNSt6vectorIiEEiRNSt6vectorIiEE">
<span id="paddle::CoordIterator::getNextPos__std::vector:i:CR.i.std::vector:i:R"></span><span class="target" id="paddleclasspaddle_1_1CoordIterator_1a08deffeca6c0681e5ac7ba20a55930b4"></span>bool <code class="descname">getNextPos</code><span class="sig-paren">(</span><em class="property">const</em> std::vector&lt;int&gt; &amp;<em>delays</em>, int <em>idx</em>, std::vector&lt;int&gt; &amp;<em>nextPos</em><span class="sig-paren">)</span><a class="headerlink" href="#_CPPv2N6paddle13CoordIterator10getNextPosERKNSt6vectorIiEEiRNSt6vectorIiEE" title="Permalink to this definition">¶</a></dt>
<dd></dd></dl>

</div>
3646
<div class="breathe-sectiondef docutils container">
Y
Yu Yang 已提交
3647 3648 3649 3650 3651 3652 3653 3654 3655 3656 3657 3658 3659 3660 3661 3662 3663 3664 3665 3666 3667 3668 3669 3670 3671 3672 3673 3674 3675 3676 3677 3678 3679 3680 3681
<p class="breathe-sectiondef-title rubric">Public Members</p>
<dl class="member">
<dt id="_CPPv2N6paddle13CoordIterator5dims_E">
<span id="paddle::CoordIterator::dims___std::vector:i:"></span><span class="target" id="paddleclasspaddle_1_1CoordIterator_1a08ccaa7190f4fe448801a7dc114ae14e"></span>std::vector&lt;int&gt; <code class="descname">dims_</code><a class="headerlink" href="#_CPPv2N6paddle13CoordIterator5dims_E" title="Permalink to this definition">¶</a></dt>
<dd></dd></dl>

<dl class="member">
<dt id="_CPPv2N6paddle13CoordIterator11directions_E">
<span id="paddle::CoordIterator::directions___std::vector:b:"></span><span class="target" id="paddleclasspaddle_1_1CoordIterator_1ac1789b8bd00df2ccaf44150385ed6217"></span>std::vector&lt;bool&gt; <code class="descname">directions_</code><a class="headerlink" href="#_CPPv2N6paddle13CoordIterator11directions_E" title="Permalink to this definition">¶</a></dt>
<dd></dd></dl>

<dl class="member">
<dt id="_CPPv2N6paddle13CoordIterator7curPos_E">
<span id="paddle::CoordIterator::curPos___std::vector:i:"></span><span class="target" id="paddleclasspaddle_1_1CoordIterator_1a08a9cbf9b5408d60ab8dc6e8ecf57d4a"></span>std::vector&lt;int&gt; <code class="descname">curPos_</code><a class="headerlink" href="#_CPPv2N6paddle13CoordIterator7curPos_E" title="Permalink to this definition">¶</a></dt>
<dd></dd></dl>

<dl class="member">
<dt id="_CPPv2N6paddle13CoordIterator4end_E">
<span id="paddle::CoordIterator::end___b"></span><span class="target" id="paddleclasspaddle_1_1CoordIterator_1a934158c1b4dcc73a3311f6617480d24f"></span>bool <code class="descname">end_</code><a class="headerlink" href="#_CPPv2N6paddle13CoordIterator4end_E" title="Permalink to this definition">¶</a></dt>
<dd></dd></dl>

</div>
</dd></dl>

</div>
</div>
<div class="section" id="gru">
<h2>GRU<a class="headerlink" href="#gru" title="Permalink to this headline">¶</a></h2>
<div class="section" id="gatedrecurrentlayer">
<h3>GatedRecurrentLayer<a class="headerlink" href="#gatedrecurrentlayer" title="Permalink to this headline">¶</a></h3>
<dl class="class">
<dt id="_CPPv2N6paddle19GatedRecurrentLayerE">
<span id="paddle::GatedRecurrentLayer"></span><span class="target" id="paddleclasspaddle_1_1GatedRecurrentLayer"></span><em class="property">class </em><code class="descclassname">paddle::</code><code class="descname">GatedRecurrentLayer</code><a class="headerlink" href="#_CPPv2N6paddle19GatedRecurrentLayerE" title="Permalink to this definition">¶</a></dt>
<dd><p>Please refer to &#8220;Junyoung Chung, Empirical Evaluation
of Gated Recurrent Neural Networks on Sequence Modeling&#8221;. </p>
3682
<p><a class="reference internal" href="#paddleclasspaddle_1_1GatedRecurrentLayer"><span class="std std-ref">GatedRecurrentLayer</span></a> takes 1 input layer with size * 3. Input layer is diveded into 3 equal parts: (xz_t, xr_t, xi_t). parameter and biasParameter is also diveded into 3 equal parts:<ul class="simple">
Y
Yu Yang 已提交
3683 3684 3685 3686 3687 3688 3689 3690 3691 3692 3693 3694 3695 3696 3697 3698 3699 3700
<li>parameter consists of (U_z, U_r, U)</li>
<li>baisParameter consists of (bias_z, bias_r, bias_o)</li>
</ul>
</p>
<p><div class="math">
\[\begin{split} update \ gate: z_t = actGate(xz_t + U_z * h_{t-1} + bias_z) \\ reset \ gate: r_t = actGate(xr_t + U_r * h_{t-1} + bias_r) \\ output \ candidate: {h}_t = actNode(xi_t + U * dot(r_t, h_{t-1}) + bias_o) \\ hidden \ activation: h_t = dot((1-z_t), h_{t-1}) + dot(z_t, {h}_t) \\ \end{split}\]</div>
</p>
<p>
The config file is grumemory. <dl class="docutils">
<dt><strong>Note</strong></dt>
<dd><ul class="simple">
<li>dot denotes &#8220;element-wise multiplication&#8221;.</li>
<li>actNode is defined by config active_type</li>
<li>actGate is defined by config actvie_gate_type</li>
</ul>
</dd>
</dl>
</p>
3701
<p>Inherits from <a class="reference internal" href="#paddleclasspaddle_1_1Layer"><span class="std std-ref">paddle::Layer</span></a>, <a class="reference internal" href="#paddleclasspaddle_1_1GruCompute"><span class="std std-ref">paddle::GruCompute</span></a></p>
3702
<div class="breathe-sectiondef docutils container">
Y
Yu Yang 已提交
3703 3704 3705 3706 3707 3708 3709 3710
<p class="breathe-sectiondef-title rubric">Public Functions</p>
<dl class="function">
<dt id="_CPPv2N6paddle19GatedRecurrentLayer19GatedRecurrentLayerERK11LayerConfig">
<span id="paddle::GatedRecurrentLayer::GatedRecurrentLayer__LayerConfigCR"></span><span class="target" id="paddleclasspaddle_1_1GatedRecurrentLayer_1a0b35a6618f7eda290874f0da0b52a44c"></span><code class="descname">GatedRecurrentLayer</code><span class="sig-paren">(</span><em class="property">const</em> LayerConfig &amp;<em>config</em><span class="sig-paren">)</span><a class="headerlink" href="#_CPPv2N6paddle19GatedRecurrentLayer19GatedRecurrentLayerERK11LayerConfig" title="Permalink to this definition">¶</a></dt>
<dd></dd></dl>

<dl class="function">
<dt id="_CPPv2N6paddle19GatedRecurrentLayer4initERK8LayerMapRK12ParameterMap">
3711
<span id="paddle::GatedRecurrentLayer::init__LayerMapCR.ParameterMapCR"></span><span class="target" id="paddleclasspaddle_1_1GatedRecurrentLayer_1a32521c51f0050ac033a848dd006ca3f6"></span>bool <code class="descname">init</code><span class="sig-paren">(</span><em class="property">const</em> LayerMap &amp;<em>layerMap</em>, <em class="property">const</em> <a class="reference internal" href="../../parameter/parameter/parameter.html#_CPPv2N6paddle12ParameterMapE" title="paddle::ParameterMap">ParameterMap</a> &amp;<em>parameterMap</em><span class="sig-paren">)</span><a class="headerlink" href="#_CPPv2N6paddle19GatedRecurrentLayer4initERK8LayerMapRK12ParameterMap" title="Permalink to this definition">¶</a></dt>
Y
Yu Yang 已提交
3712 3713 3714 3715 3716
<dd><p>Intialization. For example, adding input layers from layerMap and parameterMap. </p>
</dd></dl>

<dl class="function">
<dt id="_CPPv2N6paddle19GatedRecurrentLayer7forwardE8PassType">
3717
<span id="paddle::GatedRecurrentLayer::forward__PassType"></span><span class="target" id="paddleclasspaddle_1_1GatedRecurrentLayer_1aa5cc5b36e05da82811a8b073331c0754"></span>void <code class="descname">forward</code><span class="sig-paren">(</span>PassType <em>passType</em><span class="sig-paren">)</span><a class="headerlink" href="#_CPPv2N6paddle19GatedRecurrentLayer7forwardE8PassType" title="Permalink to this definition">¶</a></dt>
Y
Yu Yang 已提交
3718 3719 3720 3721 3722
<dd><p>Forward propagation. All inherited implementation should call Layer::foward() function. </p>
</dd></dl>

<dl class="function">
<dt id="_CPPv2N6paddle19GatedRecurrentLayer8backwardERK14UpdateCallback">
3723
<span id="paddle::GatedRecurrentLayer::backward__UpdateCallbackCR"></span><span class="target" id="paddleclasspaddle_1_1GatedRecurrentLayer_1a59e3943afe32ff94ce365e5dda7c2bea"></span>void <code class="descname">backward</code><span class="sig-paren">(</span><em class="property">const</em> <a class="reference internal" href="../../parameter/parameter/parameter.html#_CPPv2N6paddle14UpdateCallbackE" title="paddle::UpdateCallback">UpdateCallback</a> &amp;<em>callback</em><span class="sig-paren">)</span><a class="headerlink" href="#_CPPv2N6paddle19GatedRecurrentLayer8backwardERK14UpdateCallback" title="Permalink to this definition">¶</a></dt>
3724
<dd><p>Backward propagation. Should only be called after <a class="reference internal" href="#paddleclasspaddle_1_1Layer_1a12386b3f20dd731e7ceaa2c61667cbe1"><span class="std std-ref">Layer::forward()</span></a> function. </p>
Y
Yu Yang 已提交
3725 3726 3727 3728
</dd></dl>

<dl class="function">
<dt id="_CPPv2N6paddle19GatedRecurrentLayer10resetStateEv">
3729
<span id="paddle::GatedRecurrentLayer::resetState"></span><span class="target" id="paddleclasspaddle_1_1GatedRecurrentLayer_1a650b5b73fafc63f3f2e72085abae393c"></span>void <code class="descname">resetState</code><span class="sig-paren">(</span><span class="sig-paren">)</span><a class="headerlink" href="#_CPPv2N6paddle19GatedRecurrentLayer10resetStateEv" title="Permalink to this definition">¶</a></dt>
3730 3731
<dd><p>Reset the internal state variables. Allocate them if they have not been allocated. This function need to called before <a class="reference internal" href="#paddleclasspaddle_1_1Layer_1a12386b3f20dd731e7ceaa2c61667cbe1"><span class="std std-ref">Layer::forward()</span></a> for generating sequence.</p>
<p>This is used for sequence generation. When generating sequence, the calculation at current timestamp depends on the state from previous timestamp. The model needs to keep the information about the previous timestamp in the state variables. Layers such as <a class="reference internal" href="#paddleclasspaddle_1_1RecurrentLayer"><span class="std std-ref">RecurrentLayer</span></a>, <a class="reference internal" href="#paddleclasspaddle_1_1LstmLayer"><span class="std std-ref">LstmLayer</span></a> and ContextLayer have state variables. </p>
Y
Yu Yang 已提交
3732 3733 3734 3735
</dd></dl>

<dl class="function">
<dt id="_CPPv2N6paddle19GatedRecurrentLayer8setStateE13LayerStatePtr">
3736
<span id="paddle::GatedRecurrentLayer::setState__LayerStatePtr"></span><span class="target" id="paddleclasspaddle_1_1GatedRecurrentLayer_1a7b31da7c716db156740baa830d8f8038"></span>void <code class="descname">setState</code><span class="sig-paren">(</span>LayerStatePtr <em>state</em><span class="sig-paren">)</span><a class="headerlink" href="#_CPPv2N6paddle19GatedRecurrentLayer8setStateE13LayerStatePtr" title="Permalink to this definition">¶</a></dt>
Y
Yu Yang 已提交
3737 3738 3739 3740 3741
<dd><p>Set layer state. </p>
</dd></dl>

<dl class="function">
<dt id="_CPPv2N6paddle19GatedRecurrentLayer8getStateEv">
3742
<span id="paddle::GatedRecurrentLayer::getState"></span><span class="target" id="paddleclasspaddle_1_1GatedRecurrentLayer_1a6ce990fa98e3efec7ee66ce464dd9f50"></span>LayerStatePtr <code class="descname">getState</code><span class="sig-paren">(</span><span class="sig-paren">)</span><a class="headerlink" href="#_CPPv2N6paddle19GatedRecurrentLayer8getStateEv" title="Permalink to this definition">¶</a></dt>
Y
Yu Yang 已提交
3743 3744 3745 3746 3747 3748 3749 3750
<dd><p>Get layer state. <dl class="docutils">
<dt><strong>Return</strong></dt>
<dd>A copy of internal state. </dd>
</dl>
</p>
</dd></dl>

</div>
3751
<div class="breathe-sectiondef docutils container">
Y
Yu Yang 已提交
3752 3753 3754 3755 3756 3757 3758 3759 3760 3761 3762 3763 3764 3765 3766 3767 3768 3769 3770 3771 3772 3773
<p class="breathe-sectiondef-title rubric">Protected Functions</p>
<dl class="function">
<dt id="_CPPv2N6paddle19GatedRecurrentLayer15forwardSequenceEi6size_tPKi9MatrixPtr">
<span id="paddle::GatedRecurrentLayer::forwardSequence__i.s.iCP.MatrixPtr"></span><span class="target" id="paddleclasspaddle_1_1GatedRecurrentLayer_1acaa1ba105e1e599bddd1c7dd86cef75e"></span>void <code class="descname">forwardSequence</code><span class="sig-paren">(</span>int <em>batchSize</em>, size_t <em>numSequences</em>, <em class="property">const</em> int *<em>starts</em>, <a class="reference internal" href="../../math/matrix/matrix.html#_CPPv2N6paddle9MatrixPtrE" title="paddle::MatrixPtr">MatrixPtr</a> <em>inputValue</em><span class="sig-paren">)</span><a class="headerlink" href="#_CPPv2N6paddle19GatedRecurrentLayer15forwardSequenceEi6size_tPKi9MatrixPtr" title="Permalink to this definition">¶</a></dt>
<dd></dd></dl>

<dl class="function">
<dt id="_CPPv2N6paddle19GatedRecurrentLayer16backwardSequenceEi6size_tPKi9MatrixPtr">
<span id="paddle::GatedRecurrentLayer::backwardSequence__i.s.iCP.MatrixPtr"></span><span class="target" id="paddleclasspaddle_1_1GatedRecurrentLayer_1aee61809fca46dd32361228a8e64e99cf"></span>void <code class="descname">backwardSequence</code><span class="sig-paren">(</span>int <em>batchSize</em>, size_t <em>numSequences</em>, <em class="property">const</em> int *<em>starts</em>, <a class="reference internal" href="../../math/matrix/matrix.html#_CPPv2N6paddle9MatrixPtrE" title="paddle::MatrixPtr">MatrixPtr</a> <em>inputGrad</em><span class="sig-paren">)</span><a class="headerlink" href="#_CPPv2N6paddle19GatedRecurrentLayer16backwardSequenceEi6size_tPKi9MatrixPtr" title="Permalink to this definition">¶</a></dt>
<dd></dd></dl>

<dl class="function">
<dt id="_CPPv2N6paddle19GatedRecurrentLayer12forwardBatchEi6size_tPKi9MatrixPtr">
<span id="paddle::GatedRecurrentLayer::forwardBatch__i.s.iCP.MatrixPtr"></span><span class="target" id="paddleclasspaddle_1_1GatedRecurrentLayer_1a3187c9316931c40b28446e97e1a29ce1"></span>void <code class="descname">forwardBatch</code><span class="sig-paren">(</span>int <em>batchSize</em>, size_t <em>numSequences</em>, <em class="property">const</em> int *<em>starts</em>, <a class="reference internal" href="../../math/matrix/matrix.html#_CPPv2N6paddle9MatrixPtrE" title="paddle::MatrixPtr">MatrixPtr</a> <em>inputValue</em><span class="sig-paren">)</span><a class="headerlink" href="#_CPPv2N6paddle19GatedRecurrentLayer12forwardBatchEi6size_tPKi9MatrixPtr" title="Permalink to this definition">¶</a></dt>
<dd></dd></dl>

<dl class="function">
<dt id="_CPPv2N6paddle19GatedRecurrentLayer13backwardBatchEi9MatrixPtr">
<span id="paddle::GatedRecurrentLayer::backwardBatch__i.MatrixPtr"></span><span class="target" id="paddleclasspaddle_1_1GatedRecurrentLayer_1a44de2fa852ca498916557f4ea1c1539f"></span>void <code class="descname">backwardBatch</code><span class="sig-paren">(</span>int <em>batchSize</em>, <a class="reference internal" href="../../math/matrix/matrix.html#_CPPv2N6paddle9MatrixPtrE" title="paddle::MatrixPtr">MatrixPtr</a> <em>inputGrad</em><span class="sig-paren">)</span><a class="headerlink" href="#_CPPv2N6paddle19GatedRecurrentLayer13backwardBatchEi9MatrixPtr" title="Permalink to this definition">¶</a></dt>
<dd></dd></dl>

</div>
3774
<div class="breathe-sectiondef docutils container">
Y
Yu Yang 已提交
3775 3776 3777 3778 3779 3780 3781 3782 3783 3784 3785 3786 3787 3788 3789 3790 3791 3792 3793 3794 3795 3796 3797 3798 3799 3800 3801 3802 3803 3804 3805 3806 3807 3808 3809 3810 3811 3812 3813 3814 3815 3816 3817 3818 3819 3820 3821 3822 3823 3824 3825 3826 3827 3828 3829 3830 3831 3832 3833 3834 3835 3836 3837 3838 3839 3840 3841 3842 3843 3844
<p class="breathe-sectiondef-title rubric">Protected Attributes</p>
<dl class="member">
<dt id="_CPPv2N6paddle19GatedRecurrentLayer7weight_E">
<span id="paddle::GatedRecurrentLayer::weight___std::unique_ptr:Weight:"></span><span class="target" id="paddleclasspaddle_1_1GatedRecurrentLayer_1a097388936747564cee3b28d5b931c95c"></span>std::unique_ptr&lt;<a class="reference internal" href="../../parameter/parameter/parameter.html#_CPPv2N6paddle6WeightE" title="paddle::Weight">Weight</a>&gt; <code class="descname">weight_</code><a class="headerlink" href="#_CPPv2N6paddle19GatedRecurrentLayer7weight_E" title="Permalink to this definition">¶</a></dt>
<dd></dd></dl>

<dl class="member">
<dt id="_CPPv2N6paddle19GatedRecurrentLayer11gateWeight_E">
<span id="paddle::GatedRecurrentLayer::gateWeight___std::unique_ptr:Weight:"></span><span class="target" id="paddleclasspaddle_1_1GatedRecurrentLayer_1ae0499e038543fb5be7734db8c53195d3"></span>std::unique_ptr&lt;<a class="reference internal" href="../../parameter/parameter/parameter.html#_CPPv2N6paddle6WeightE" title="paddle::Weight">Weight</a>&gt; <code class="descname">gateWeight_</code><a class="headerlink" href="#_CPPv2N6paddle19GatedRecurrentLayer11gateWeight_E" title="Permalink to this definition">¶</a></dt>
<dd></dd></dl>

<dl class="member">
<dt id="_CPPv2N6paddle19GatedRecurrentLayer12stateWeight_E">
<span id="paddle::GatedRecurrentLayer::stateWeight___std::unique_ptr:Weight:"></span><span class="target" id="paddleclasspaddle_1_1GatedRecurrentLayer_1a0b7ae0f75efe420a5abd4f4f38482805"></span>std::unique_ptr&lt;<a class="reference internal" href="../../parameter/parameter/parameter.html#_CPPv2N6paddle6WeightE" title="paddle::Weight">Weight</a>&gt; <code class="descname">stateWeight_</code><a class="headerlink" href="#_CPPv2N6paddle19GatedRecurrentLayer12stateWeight_E" title="Permalink to this definition">¶</a></dt>
<dd></dd></dl>

<dl class="member">
<dt id="_CPPv2N6paddle19GatedRecurrentLayer5bias_E">
<span id="paddle::GatedRecurrentLayer::bias___std::unique_ptr:Weight:"></span><span class="target" id="paddleclasspaddle_1_1GatedRecurrentLayer_1a46d3a7ce91fb493fe21496b8b84fa837"></span>std::unique_ptr&lt;<a class="reference internal" href="../../parameter/parameter/parameter.html#_CPPv2N6paddle6WeightE" title="paddle::Weight">Weight</a>&gt; <code class="descname">bias_</code><a class="headerlink" href="#_CPPv2N6paddle19GatedRecurrentLayer5bias_E" title="Permalink to this definition">¶</a></dt>
<dd></dd></dl>

<dl class="member">
<dt id="_CPPv2N6paddle19GatedRecurrentLayer5gate_E">
<span id="paddle::GatedRecurrentLayer::gate___Argument"></span><span class="target" id="paddleclasspaddle_1_1GatedRecurrentLayer_1ad35f4327f2be88a89b521435598d3155"></span><a class="reference internal" href="../../parameter/parameter/parameter.html#_CPPv2N6paddle8ArgumentE" title="paddle::Argument">Argument</a> <code class="descname">gate_</code><a class="headerlink" href="#_CPPv2N6paddle19GatedRecurrentLayer5gate_E" title="Permalink to this definition">¶</a></dt>
<dd></dd></dl>

<dl class="member">
<dt id="_CPPv2N6paddle19GatedRecurrentLayer12resetOutput_E">
<span id="paddle::GatedRecurrentLayer::resetOutput___Argument"></span><span class="target" id="paddleclasspaddle_1_1GatedRecurrentLayer_1a1dc8ec53a1cb047d0a44c1a661f8ae6d"></span><a class="reference internal" href="../../parameter/parameter/parameter.html#_CPPv2N6paddle8ArgumentE" title="paddle::Argument">Argument</a> <code class="descname">resetOutput_</code><a class="headerlink" href="#_CPPv2N6paddle19GatedRecurrentLayer12resetOutput_E" title="Permalink to this definition">¶</a></dt>
<dd></dd></dl>

<dl class="member">
<dt id="_CPPv2N6paddle19GatedRecurrentLayer9reversed_E">
<span id="paddle::GatedRecurrentLayer::reversed___b"></span><span class="target" id="paddleclasspaddle_1_1GatedRecurrentLayer_1abf6fc9ab99964bcaf382e288be099355"></span>bool <code class="descname">reversed_</code><a class="headerlink" href="#_CPPv2N6paddle19GatedRecurrentLayer9reversed_E" title="Permalink to this definition">¶</a></dt>
<dd></dd></dl>

<dl class="member">
<dt id="_CPPv2N6paddle19GatedRecurrentLayer9useBatch_E">
<span id="paddle::GatedRecurrentLayer::useBatch___b"></span><span class="target" id="paddleclasspaddle_1_1GatedRecurrentLayer_1ac8bbd3d1c06b64bb112a1df2dd80c3c8"></span>bool <code class="descname">useBatch_</code><a class="headerlink" href="#_CPPv2N6paddle19GatedRecurrentLayer9useBatch_E" title="Permalink to this definition">¶</a></dt>
<dd></dd></dl>

<dl class="member">
<dt id="_CPPv2N6paddle19GatedRecurrentLayer11batchValue_E">
<span id="paddle::GatedRecurrentLayer::batchValue___std::unique_ptr:SequenceToBatch:"></span><span class="target" id="paddleclasspaddle_1_1GatedRecurrentLayer_1a3f940227a91fe048706afd48ee306704"></span>std::unique_ptr&lt;<a class="reference internal" href="#_CPPv2N6paddle15SequenceToBatchE" title="paddle::SequenceToBatch">SequenceToBatch</a>&gt; <code class="descname">batchValue_</code><a class="headerlink" href="#_CPPv2N6paddle19GatedRecurrentLayer11batchValue_E" title="Permalink to this definition">¶</a></dt>
<dd></dd></dl>

<dl class="member">
<dt id="_CPPv2N6paddle19GatedRecurrentLayer10batchGrad_E">
<span id="paddle::GatedRecurrentLayer::batchGrad___std::unique_ptr:SequenceToBatch:"></span><span class="target" id="paddleclasspaddle_1_1GatedRecurrentLayer_1a286648096c70fbe691a826d37a81ce48"></span>std::unique_ptr&lt;<a class="reference internal" href="#_CPPv2N6paddle15SequenceToBatchE" title="paddle::SequenceToBatch">SequenceToBatch</a>&gt; <code class="descname">batchGrad_</code><a class="headerlink" href="#_CPPv2N6paddle19GatedRecurrentLayer10batchGrad_E" title="Permalink to this definition">¶</a></dt>
<dd></dd></dl>

<dl class="member">
<dt id="_CPPv2N6paddle19GatedRecurrentLayer15activationGate_E">
<span id="paddle::GatedRecurrentLayer::activationGate___std::unique_ptr:ActivationFunction:"></span><span class="target" id="paddleclasspaddle_1_1GatedRecurrentLayer_1a21371dd912d656a95a1f50dfca2b7632"></span>std::unique_ptr&lt;<a class="reference internal" href="../activations/index.html#_CPPv2N6paddle18ActivationFunctionE" title="paddle::ActivationFunction">ActivationFunction</a>&gt; <code class="descname">activationGate_</code><a class="headerlink" href="#_CPPv2N6paddle19GatedRecurrentLayer15activationGate_E" title="Permalink to this definition">¶</a></dt>
<dd></dd></dl>

<dl class="member">
<dt id="_CPPv2N6paddle19GatedRecurrentLayer11prevOutput_E">
<span id="paddle::GatedRecurrentLayer::prevOutput___MatrixPtr"></span><span class="target" id="paddleclasspaddle_1_1GatedRecurrentLayer_1a6e1fa4b11435d022732bd5eed17a68e4"></span><a class="reference internal" href="../../math/matrix/matrix.html#_CPPv2N6paddle9MatrixPtrE" title="paddle::MatrixPtr">MatrixPtr</a> <code class="descname">prevOutput_</code><a class="headerlink" href="#_CPPv2N6paddle19GatedRecurrentLayer11prevOutput_E" title="Permalink to this definition">¶</a></dt>
<dd></dd></dl>

</div>
</dd></dl>

</div>
<div class="section" id="grusteplayer">
<h3>GruStepLayer<a class="headerlink" href="#grusteplayer" title="Permalink to this headline">¶</a></h3>
<dl class="class">
<dt id="_CPPv2N6paddle12GruStepLayerE">
<span id="paddle::GruStepLayer"></span><span class="target" id="paddleclasspaddle_1_1GruStepLayer"></span><em class="property">class </em><code class="descclassname">paddle::</code><code class="descname">GruStepLayer</code><a class="headerlink" href="#_CPPv2N6paddle12GruStepLayerE" title="Permalink to this definition">¶</a></dt>
3845
<dd><p><a class="reference internal" href="#paddleclasspaddle_1_1GruStepLayer"><span class="std std-ref">GruStepLayer</span></a> is like <a class="reference internal" href="#paddleclasspaddle_1_1GatedRecurrentLayer"><span class="std std-ref">GatedRecurrentLayer</span></a>, but used in recurrent layer group. <a class="reference internal" href="#paddleclasspaddle_1_1GruStepLayer"><span class="std std-ref">GruStepLayer</span></a> takes 2 input layer. </p>
Y
Yu Yang 已提交
3846 3847 3848 3849 3850 3851 3852 3853 3854 3855 3856 3857 3858 3859 3860 3861 3862 3863 3864 3865 3866 3867 3868 3869 3870 3871
<p><ul class="simple">
<li>input[0] with size * 3 and diveded into 3 equal parts: (xz_t, xr_t, xi_t).</li>
<li>input[1] with size: {prev_out}.</li>
</ul>
</p>
<p>parameter and biasParameter is also diveded into 3 equal parts:<ul>
<li><p class="first">parameter consists of (U_z, U_r, U)</p>
</li>
<li><p class="first">baisParameter consists of (bias_z, bias_r, bias_o)</p>
<p><div class="math">
\[\begin{split} update \ gate: z_t = actGate(xz_t + U_z * prev_out + bias_z) \\ reset \ gate: r_t = actGate(xr_t + U_r * prev_out + bias_r) \\ output \ candidate: {h}_t = actNode(xi_t + U * dot(r_t, prev_out) + bias_o) \\ output: h_t = dot((1-z_t), prev_out) + dot(z_t, prev_out) \end{split}\]</div>
</p>
</li>
</ul>
</p>
<p>
The config file api if gru_step_layer. <dl class="docutils">
<dt><strong>Note</strong></dt>
<dd><ul class="simple">
<li>dot denotes &#8220;element-wise multiplication&#8221;.</li>
<li>actNode is defined by config active_type</li>
<li>actGate is defined by config actvie_gate_type</li>
</ul>
</dd>
</dl>
</p>
3872
<p>Inherits from <a class="reference internal" href="#paddleclasspaddle_1_1Layer"><span class="std std-ref">paddle::Layer</span></a>, <a class="reference internal" href="#paddleclasspaddle_1_1GruCompute"><span class="std std-ref">paddle::GruCompute</span></a></p>
3873
<div class="breathe-sectiondef docutils container">
Y
Yu Yang 已提交
3874 3875 3876 3877 3878 3879 3880 3881 3882 3883 3884 3885 3886
<p class="breathe-sectiondef-title rubric">Public Functions</p>
<dl class="function">
<dt id="_CPPv2N6paddle12GruStepLayer12GruStepLayerERK11LayerConfig">
<span id="paddle::GruStepLayer::GruStepLayer__LayerConfigCR"></span><span class="target" id="paddleclasspaddle_1_1GruStepLayer_1aca5abbe614d6b1166209e668e10223d9"></span><code class="descname">GruStepLayer</code><span class="sig-paren">(</span><em class="property">const</em> LayerConfig &amp;<em>config</em><span class="sig-paren">)</span><a class="headerlink" href="#_CPPv2N6paddle12GruStepLayer12GruStepLayerERK11LayerConfig" title="Permalink to this definition">¶</a></dt>
<dd></dd></dl>

<dl class="function">
<dt id="_CPPv2N6paddle12GruStepLayerD0Ev">
<span id="paddle::GruStepLayer::~GruStepLayer"></span><span class="target" id="paddleclasspaddle_1_1GruStepLayer_1a6dbf1424cd851695441504d5565aac73"></span><code class="descname">~GruStepLayer</code><span class="sig-paren">(</span><span class="sig-paren">)</span><a class="headerlink" href="#_CPPv2N6paddle12GruStepLayerD0Ev" title="Permalink to this definition">¶</a></dt>
<dd></dd></dl>

<dl class="function">
<dt id="_CPPv2N6paddle12GruStepLayer4initERK8LayerMapRK12ParameterMap">
3887
<span id="paddle::GruStepLayer::init__LayerMapCR.ParameterMapCR"></span><span class="target" id="paddleclasspaddle_1_1GruStepLayer_1a8555160607a2348641c9179dbd3417b8"></span>bool <code class="descname">init</code><span class="sig-paren">(</span><em class="property">const</em> LayerMap &amp;<em>layerMap</em>, <em class="property">const</em> <a class="reference internal" href="../../parameter/parameter/parameter.html#_CPPv2N6paddle12ParameterMapE" title="paddle::ParameterMap">ParameterMap</a> &amp;<em>parameterMap</em><span class="sig-paren">)</span><a class="headerlink" href="#_CPPv2N6paddle12GruStepLayer4initERK8LayerMapRK12ParameterMap" title="Permalink to this definition">¶</a></dt>
Y
Yu Yang 已提交
3888 3889 3890 3891 3892
<dd><p>Intialization. For example, adding input layers from layerMap and parameterMap. </p>
</dd></dl>

<dl class="function">
<dt id="_CPPv2N6paddle12GruStepLayer7forwardE8PassType">
3893
<span id="paddle::GruStepLayer::forward__PassType"></span><span class="target" id="paddleclasspaddle_1_1GruStepLayer_1acae11166f62e96a8c8a6fcf6c2059bd3"></span>void <code class="descname">forward</code><span class="sig-paren">(</span>PassType <em>passType</em><span class="sig-paren">)</span><a class="headerlink" href="#_CPPv2N6paddle12GruStepLayer7forwardE8PassType" title="Permalink to this definition">¶</a></dt>
Y
Yu Yang 已提交
3894 3895 3896 3897 3898
<dd><p>Forward propagation. All inherited implementation should call Layer::foward() function. </p>
</dd></dl>

<dl class="function">
<dt id="_CPPv2N6paddle12GruStepLayer8backwardERK14UpdateCallback">
3899
<span id="paddle::GruStepLayer::backward__UpdateCallbackCR"></span><span class="target" id="paddleclasspaddle_1_1GruStepLayer_1a3d67224a4e0db0f6d25a6c59fa9df30e"></span>void <code class="descname">backward</code><span class="sig-paren">(</span><em class="property">const</em> <a class="reference internal" href="../../parameter/parameter/parameter.html#_CPPv2N6paddle14UpdateCallbackE" title="paddle::UpdateCallback">UpdateCallback</a> &amp;<em>callback</em> = nullptr<span class="sig-paren">)</span><a class="headerlink" href="#_CPPv2N6paddle12GruStepLayer8backwardERK14UpdateCallback" title="Permalink to this definition">¶</a></dt>
3900
<dd><p>Backward propagation. Should only be called after <a class="reference internal" href="#paddleclasspaddle_1_1Layer_1a12386b3f20dd731e7ceaa2c61667cbe1"><span class="std std-ref">Layer::forward()</span></a> function. </p>
Y
Yu Yang 已提交
3901 3902 3903
</dd></dl>

</div>
3904
<div class="breathe-sectiondef docutils container">
Y
Yu Yang 已提交
3905 3906 3907 3908 3909 3910 3911 3912 3913 3914 3915 3916 3917 3918 3919 3920 3921 3922 3923 3924 3925 3926 3927 3928 3929 3930 3931 3932 3933 3934
<p class="breathe-sectiondef-title rubric">Protected Attributes</p>
<dl class="member">
<dt id="_CPPv2N6paddle12GruStepLayer5gate_E">
<span id="paddle::GruStepLayer::gate___Argument"></span><span class="target" id="paddleclasspaddle_1_1GruStepLayer_1a1da72326764347897ae4ee7bed505053"></span><a class="reference internal" href="../../parameter/parameter/parameter.html#_CPPv2N6paddle8ArgumentE" title="paddle::Argument">Argument</a> <code class="descname">gate_</code><a class="headerlink" href="#_CPPv2N6paddle12GruStepLayer5gate_E" title="Permalink to this definition">¶</a></dt>
<dd></dd></dl>

<dl class="member">
<dt id="_CPPv2N6paddle12GruStepLayer12resetOutput_E">
<span id="paddle::GruStepLayer::resetOutput___Argument"></span><span class="target" id="paddleclasspaddle_1_1GruStepLayer_1a0008f131aa8216d26ac90fc72956bd67"></span><a class="reference internal" href="../../parameter/parameter/parameter.html#_CPPv2N6paddle8ArgumentE" title="paddle::Argument">Argument</a> <code class="descname">resetOutput_</code><a class="headerlink" href="#_CPPv2N6paddle12GruStepLayer12resetOutput_E" title="Permalink to this definition">¶</a></dt>
<dd></dd></dl>

<dl class="member">
<dt id="_CPPv2N6paddle12GruStepLayer7weight_E">
<span id="paddle::GruStepLayer::weight___std::unique_ptr:Weight:"></span><span class="target" id="paddleclasspaddle_1_1GruStepLayer_1a20143bef6be38cd669c9f09976dd336a"></span>std::unique_ptr&lt;<a class="reference internal" href="../../parameter/parameter/parameter.html#_CPPv2N6paddle6WeightE" title="paddle::Weight">Weight</a>&gt; <code class="descname">weight_</code><a class="headerlink" href="#_CPPv2N6paddle12GruStepLayer7weight_E" title="Permalink to this definition">¶</a></dt>
<dd></dd></dl>

<dl class="member">
<dt id="_CPPv2N6paddle12GruStepLayer5bias_E">
<span id="paddle::GruStepLayer::bias___std::unique_ptr:Weight:"></span><span class="target" id="paddleclasspaddle_1_1GruStepLayer_1af53335c17a3365c0a16e956c4d09d858"></span>std::unique_ptr&lt;<a class="reference internal" href="../../parameter/parameter/parameter.html#_CPPv2N6paddle6WeightE" title="paddle::Weight">Weight</a>&gt; <code class="descname">bias_</code><a class="headerlink" href="#_CPPv2N6paddle12GruStepLayer5bias_E" title="Permalink to this definition">¶</a></dt>
<dd></dd></dl>

</div>
</dd></dl>

</div>
<div class="section" id="grucompute">
<h3>GruCompute<a class="headerlink" href="#grucompute" title="Permalink to this headline">¶</a></h3>
<dl class="class">
<dt id="_CPPv2N6paddle10GruComputeE">
<span id="paddle::GruCompute"></span><span class="target" id="paddleclasspaddle_1_1GruCompute"></span><em class="property">class </em><code class="descclassname">paddle::</code><code class="descname">GruCompute</code><a class="headerlink" href="#_CPPv2N6paddle10GruComputeE" title="Permalink to this definition">¶</a></dt>
3935
<dd><p>Subclassed by <a class="reference internal" href="#paddleclasspaddle_1_1GatedRecurrentLayer"><span class="std std-ref">paddle::GatedRecurrentLayer</span></a>, <a class="reference internal" href="#paddleclasspaddle_1_1GruStepLayer"><span class="std std-ref">paddle::GruStepLayer</span></a></p>
3936
<div class="breathe-sectiondef docutils container">
Y
Yu Yang 已提交
3937 3938 3939 3940 3941 3942 3943 3944 3945 3946 3947 3948 3949 3950 3951 3952 3953 3954 3955 3956 3957 3958 3959 3960
<p class="breathe-sectiondef-title rubric">Public Functions</p>
<dl class="function">
<dt id="_CPPv2N6paddle10GruCompute4initER11LayerConfig">
<span id="paddle::GruCompute::init__LayerConfigR"></span><span class="target" id="paddleclasspaddle_1_1GruCompute_1a3009117795def78c370cc789beb4f9ab"></span>void <code class="descname">init</code><span class="sig-paren">(</span>LayerConfig &amp;<em>config</em><span class="sig-paren">)</span><a class="headerlink" href="#_CPPv2N6paddle10GruCompute4initER11LayerConfig" title="Permalink to this definition">¶</a></dt>
<dd></dd></dl>

<dl class="function">
<dt>
<em class="property">template </em>&lt;bool <em>useGpu</em>&gt;</dt>
<dt id="_CPPv2N6paddle10GruCompute7forwardE12hl_gru_valueii">
<span id="paddle::GruCompute::forward__hl_gru_value.i.i"></span><span class="target" id="paddleclasspaddle_1_1GruCompute_1ab9ab0420e36a7f02894c55c98997ac82"></span>void <code class="descname">forward</code><span class="sig-paren">(</span><a class="reference internal" href="../../cuda/utils/utils.html#_CPPv212hl_gru_value" title="hl_gru_value">hl_gru_value</a> <em>value</em>, int <em>frameSize</em>, int <em>batchSize</em> = 1<span class="sig-paren">)</span><a class="headerlink" href="#_CPPv2N6paddle10GruCompute7forwardE12hl_gru_valueii" title="Permalink to this definition">¶</a></dt>
<dd></dd></dl>

<dl class="function">
<dt>
<em class="property">template </em>&lt;bool <em>useGpu</em>&gt;</dt>
<dt id="_CPPv2N6paddle10GruCompute8backwardE12hl_gru_value11hl_gru_gradii">
<span id="paddle::GruCompute::backward__hl_gru_value.hl_gru_grad.i.i"></span><span class="target" id="paddleclasspaddle_1_1GruCompute_1a5843b981c8e000e4a719f07ec1baa1c7"></span>void <code class="descname">backward</code><span class="sig-paren">(</span><a class="reference internal" href="../../cuda/utils/utils.html#_CPPv212hl_gru_value" title="hl_gru_value">hl_gru_value</a> <em>value</em>, <a class="reference internal" href="../../cuda/utils/utils.html#_CPPv211hl_gru_grad" title="hl_gru_grad">hl_gru_grad</a> <em>grad</em>, int <em>frameSize</em>, int <em>batchSize</em> = 1<span class="sig-paren">)</span><a class="headerlink" href="#_CPPv2N6paddle10GruCompute8backwardE12hl_gru_value11hl_gru_gradii" title="Permalink to this definition">¶</a></dt>
<dd></dd></dl>

<dl class="function">
<dt>
<em class="property">template </em>&lt;&gt;</dt>
<dt id="_CPPv2N6paddle10GruCompute7forwardE12hl_gru_valueii">
3961
<span class="target" id="paddleclasspaddle_1_1GruCompute_1af50cb413ec03eee972eb7c516b14d1a5"></span>void <code class="descname">forward</code><span class="sig-paren">(</span><a class="reference internal" href="../../cuda/utils/utils.html#_CPPv212hl_gru_value" title="hl_gru_value">hl_gru_value</a> <em>value</em>, int <em>frameSize</em>, int <em>batchSize</em><span class="sig-paren">)</span><a class="headerlink" href="#_CPPv2N6paddle10GruCompute7forwardE12hl_gru_valueii" title="Permalink to this definition">¶</a></dt>
Y
Yu Yang 已提交
3962 3963 3964 3965 3966 3967
<dd></dd></dl>

<dl class="function">
<dt>
<em class="property">template </em>&lt;&gt;</dt>
<dt id="_CPPv2N6paddle10GruCompute8backwardE12hl_gru_value11hl_gru_gradii">
3968 3969 3970 3971 3972 3973 3974 3975 3976 3977 3978 3979 3980 3981 3982
<span class="target" id="paddleclasspaddle_1_1GruCompute_1a6952523f29f3ba6e3ab8500a2604b7c3"></span>void <code class="descname">backward</code><span class="sig-paren">(</span><a class="reference internal" href="../../cuda/utils/utils.html#_CPPv212hl_gru_value" title="hl_gru_value">hl_gru_value</a> <em>value</em>, <a class="reference internal" href="../../cuda/utils/utils.html#_CPPv211hl_gru_grad" title="hl_gru_grad">hl_gru_grad</a> <em>grad</em>, int <em>frameSize</em>, int <em>batchSize</em><span class="sig-paren">)</span><a class="headerlink" href="#_CPPv2N6paddle10GruCompute8backwardE12hl_gru_value11hl_gru_gradii" title="Permalink to this definition">¶</a></dt>
<dd></dd></dl>

<dl class="function">
<dt>
<em class="property">template </em>&lt;&gt;</dt>
<dt>
<span class="target" id="paddleclasspaddle_1_1GruCompute_1af50cb413ec03eee972eb7c516b14d1a5"></span>void <code class="descname">forward</code><span class="sig-paren">(</span><a class="reference internal" href="../../cuda/utils/utils.html#_CPPv212hl_gru_value" title="hl_gru_value">hl_gru_value</a> <em>value</em>, int <em>frameSize</em>, int <em>batchSize</em><span class="sig-paren">)</span></dt>
<dd></dd></dl>

<dl class="function">
<dt>
<em class="property">template </em>&lt;&gt;</dt>
<dt>
<span class="target" id="paddleclasspaddle_1_1GruCompute_1a6952523f29f3ba6e3ab8500a2604b7c3"></span>void <code class="descname">backward</code><span class="sig-paren">(</span><a class="reference internal" href="../../cuda/utils/utils.html#_CPPv212hl_gru_value" title="hl_gru_value">hl_gru_value</a> <em>value</em>, <a class="reference internal" href="../../cuda/utils/utils.html#_CPPv211hl_gru_grad" title="hl_gru_grad">hl_gru_grad</a> <em>grad</em>, int <em>frameSize</em>, int <em>batchSize</em><span class="sig-paren">)</span></dt>
Y
Yu Yang 已提交
3983 3984 3985
<dd></dd></dl>

</div>
3986
<div class="breathe-sectiondef docutils container">
Y
Yu Yang 已提交
3987 3988 3989 3990 3991 3992 3993 3994 3995 3996 3997 3998 3999 4000 4001 4002 4003 4004 4005 4006 4007 4008 4009 4010
<p class="breathe-sectiondef-title rubric">Public Members</p>
<dl class="member">
<dt id="_CPPv2N6paddle10GruCompute11activeNode_E">
<span id="paddle::GruCompute::activeNode___hl_activation_mode_t"></span><span class="target" id="paddleclasspaddle_1_1GruCompute_1a3163f341c19b3fddfb24fb46f87ea063"></span><a class="reference internal" href="../../cuda/utils/utils.html#_CPPv220hl_activation_mode_t" title="hl_activation_mode_t">hl_activation_mode_t</a> <code class="descname">activeNode_</code><a class="headerlink" href="#_CPPv2N6paddle10GruCompute11activeNode_E" title="Permalink to this definition">¶</a></dt>
<dd></dd></dl>

<dl class="member">
<dt id="_CPPv2N6paddle10GruCompute11activeGate_E">
<span id="paddle::GruCompute::activeGate___hl_activation_mode_t"></span><span class="target" id="paddleclasspaddle_1_1GruCompute_1ac00fc9186abb73e1c91eae1419fb98df"></span><a class="reference internal" href="../../cuda/utils/utils.html#_CPPv220hl_activation_mode_t" title="hl_activation_mode_t">hl_activation_mode_t</a> <code class="descname">activeGate_</code><a class="headerlink" href="#_CPPv2N6paddle10GruCompute11activeGate_E" title="Permalink to this definition">¶</a></dt>
<dd></dd></dl>

</div>
</dd></dl>

</div>
</div>
</div>
<div class="section" id="recurrent-layer-group">
<h1>Recurrent Layer Group<a class="headerlink" href="#recurrent-layer-group" title="Permalink to this headline">¶</a></h1>
<div class="section" id="agentlayer">
<h2>AgentLayer<a class="headerlink" href="#agentlayer" title="Permalink to this headline">¶</a></h2>
<dl class="class">
<dt id="_CPPv2N6paddle10AgentLayerE">
<span id="paddle::AgentLayer"></span><span class="target" id="paddleclasspaddle_1_1AgentLayer"></span><em class="property">class </em><code class="descclassname">paddle::</code><code class="descname">AgentLayer</code><a class="headerlink" href="#_CPPv2N6paddle10AgentLayerE" title="Permalink to this definition">¶</a></dt>
4011 4012 4013
<dd><p><a class="reference internal" href="#paddleclasspaddle_1_1AgentLayer"><span class="std std-ref">AgentLayer</span></a> use as a virtual input of another layer in config, before execute forward/backward, setRealLayer() should be called to set one and only one real layer </p>
<p>Inherits from <a class="reference internal" href="#paddleclasspaddle_1_1Layer"><span class="std std-ref">paddle::Layer</span></a></p>
<p>Subclassed by <a class="reference internal" href="#paddleclasspaddle_1_1SequenceAgentLayer"><span class="std std-ref">paddle::SequenceAgentLayer</span></a></p>
4014
<div class="breathe-sectiondef docutils container">
Y
Yu Yang 已提交
4015 4016 4017 4018 4019 4020 4021 4022 4023 4024 4025 4026 4027
<p class="breathe-sectiondef-title rubric">Public Functions</p>
<dl class="function">
<dt id="_CPPv2N6paddle10AgentLayer10AgentLayerERK11LayerConfig">
<span id="paddle::AgentLayer::AgentLayer__LayerConfigCR"></span><span class="target" id="paddleclasspaddle_1_1AgentLayer_1ad83af4d5cf5ce04192301978a14a14cb"></span><code class="descname">AgentLayer</code><span class="sig-paren">(</span><em class="property">const</em> LayerConfig &amp;<em>config</em><span class="sig-paren">)</span><a class="headerlink" href="#_CPPv2N6paddle10AgentLayer10AgentLayerERK11LayerConfig" title="Permalink to this definition">¶</a></dt>
<dd></dd></dl>

<dl class="function">
<dt id="_CPPv2N6paddle10AgentLayerD0Ev">
<span id="paddle::AgentLayer::~AgentLayer"></span><span class="target" id="paddleclasspaddle_1_1AgentLayer_1aa1dd6c395e22e0e9bc4a4b804d78f3bc"></span><code class="descname">~AgentLayer</code><span class="sig-paren">(</span><span class="sig-paren">)</span><a class="headerlink" href="#_CPPv2N6paddle10AgentLayerD0Ev" title="Permalink to this definition">¶</a></dt>
<dd></dd></dl>

<dl class="function">
<dt id="_CPPv2N6paddle10AgentLayer4initERK8LayerMapRK12ParameterMap">
4028
<span id="paddle::AgentLayer::init__LayerMapCR.ParameterMapCR"></span><span class="target" id="paddleclasspaddle_1_1AgentLayer_1a0b382958594db7e5158c2caecf5dd4ef"></span>bool <code class="descname">init</code><span class="sig-paren">(</span><em class="property">const</em> LayerMap &amp;<em>layerMap</em>, <em class="property">const</em> <a class="reference internal" href="../../parameter/parameter/parameter.html#_CPPv2N6paddle12ParameterMapE" title="paddle::ParameterMap">ParameterMap</a> &amp;<em>parameterMap</em><span class="sig-paren">)</span><a class="headerlink" href="#_CPPv2N6paddle10AgentLayer4initERK8LayerMapRK12ParameterMap" title="Permalink to this definition">¶</a></dt>
Y
Yu Yang 已提交
4029 4030 4031 4032 4033 4034 4035 4036 4037 4038
<dd><p>Intialization. For example, adding input layers from layerMap and parameterMap. </p>
</dd></dl>

<dl class="function">
<dt id="_CPPv2N6paddle10AgentLayer12setRealLayerE8LayerPtri">
<span id="paddle::AgentLayer::setRealLayer__LayerPtr.i"></span><span class="target" id="paddleclasspaddle_1_1AgentLayer_1a9c0f1ac402a30980b23cfd6577404c5f"></span>void <code class="descname">setRealLayer</code><span class="sig-paren">(</span>LayerPtr <em>layer</em>, int <em>numSamples</em> = 0<span class="sig-paren">)</span><a class="headerlink" href="#_CPPv2N6paddle10AgentLayer12setRealLayerE8LayerPtri" title="Permalink to this definition">¶</a></dt>
<dd></dd></dl>

<dl class="function">
<dt id="_CPPv2N6paddle10AgentLayer7forwardE8PassType">
4039
<span id="paddle::AgentLayer::forward__PassType"></span><span class="target" id="paddleclasspaddle_1_1AgentLayer_1ab409ed4b65cf4bad855fe6b5e6d64f07"></span>void <code class="descname">forward</code><span class="sig-paren">(</span>PassType <em>passType</em><span class="sig-paren">)</span><a class="headerlink" href="#_CPPv2N6paddle10AgentLayer7forwardE8PassType" title="Permalink to this definition">¶</a></dt>
Y
Yu Yang 已提交
4040 4041 4042 4043 4044
<dd><p>Forward propagation. All inherited implementation should call Layer::foward() function. </p>
</dd></dl>

<dl class="function">
<dt id="_CPPv2N6paddle10AgentLayer8backwardERK14UpdateCallback">
4045
<span id="paddle::AgentLayer::backward__UpdateCallbackCR"></span><span class="target" id="paddleclasspaddle_1_1AgentLayer_1a0950aa8a30696b2caa7d6f14847fb774"></span>void <code class="descname">backward</code><span class="sig-paren">(</span><em class="property">const</em> <a class="reference internal" href="../../parameter/parameter/parameter.html#_CPPv2N6paddle14UpdateCallbackE" title="paddle::UpdateCallback">UpdateCallback</a> &amp;<em>callback</em> = nullptr<span class="sig-paren">)</span><a class="headerlink" href="#_CPPv2N6paddle10AgentLayer8backwardERK14UpdateCallback" title="Permalink to this definition">¶</a></dt>
4046
<dd><p>Backward propagation. Should only be called after <a class="reference internal" href="#paddleclasspaddle_1_1Layer_1a12386b3f20dd731e7ceaa2c61667cbe1"><span class="std std-ref">Layer::forward()</span></a> function. </p>
Y
Yu Yang 已提交
4047 4048 4049
</dd></dl>

</div>
4050
<div class="breathe-sectiondef docutils container">
Y
Yu Yang 已提交
4051 4052 4053 4054 4055 4056 4057 4058 4059 4060 4061 4062 4063 4064 4065 4066 4067 4068 4069 4070
<p class="breathe-sectiondef-title rubric">Protected Attributes</p>
<dl class="member">
<dt id="_CPPv2N6paddle10AgentLayer10realLayer_E">
<span id="paddle::AgentLayer::realLayer___LayerPtr"></span><span class="target" id="paddleclasspaddle_1_1AgentLayer_1aa590e92444031372395d3960238944d8"></span>LayerPtr <code class="descname">realLayer_</code><a class="headerlink" href="#_CPPv2N6paddle10AgentLayer10realLayer_E" title="Permalink to this definition">¶</a></dt>
<dd></dd></dl>

<dl class="member">
<dt id="_CPPv2N6paddle10AgentLayer11numSamples_E">
<span id="paddle::AgentLayer::numSamples___i"></span><span class="target" id="paddleclasspaddle_1_1AgentLayer_1a25875adfd20e1531ac96c82533a7630d"></span>int <code class="descname">numSamples_</code><a class="headerlink" href="#_CPPv2N6paddle10AgentLayer11numSamples_E" title="Permalink to this definition">¶</a></dt>
<dd></dd></dl>

</div>
</dd></dl>

</div>
<div class="section" id="sequenceagentlayer">
<h2>SequenceAgentLayer<a class="headerlink" href="#sequenceagentlayer" title="Permalink to this headline">¶</a></h2>
<dl class="class">
<dt id="_CPPv2N6paddle18SequenceAgentLayerE">
<span id="paddle::SequenceAgentLayer"></span><span class="target" id="paddleclasspaddle_1_1SequenceAgentLayer"></span><em class="property">class </em><code class="descclassname">paddle::</code><code class="descname">SequenceAgentLayer</code><a class="headerlink" href="#_CPPv2N6paddle18SequenceAgentLayerE" title="Permalink to this definition">¶</a></dt>
4071 4072
<dd><p>like <a class="reference internal" href="#paddleclasspaddle_1_1AgentLayer"><span class="std std-ref">AgentLayer</span></a>, but use first <em>numSamples</em> sequences </p>
<p>Inherits from <a class="reference internal" href="#paddleclasspaddle_1_1AgentLayer"><span class="std std-ref">paddle::AgentLayer</span></a></p>
4073
<div class="breathe-sectiondef docutils container">
Y
Yu Yang 已提交
4074 4075 4076 4077 4078 4079 4080 4081 4082 4083 4084 4085 4086
<p class="breathe-sectiondef-title rubric">Public Functions</p>
<dl class="function">
<dt id="_CPPv2N6paddle18SequenceAgentLayer18SequenceAgentLayerERK11LayerConfig">
<span id="paddle::SequenceAgentLayer::SequenceAgentLayer__LayerConfigCR"></span><span class="target" id="paddleclasspaddle_1_1SequenceAgentLayer_1a7b16aa33e1bbc5abc967d40dd91e3809"></span><code class="descname">SequenceAgentLayer</code><span class="sig-paren">(</span><em class="property">const</em> LayerConfig &amp;<em>config</em><span class="sig-paren">)</span><a class="headerlink" href="#_CPPv2N6paddle18SequenceAgentLayer18SequenceAgentLayerERK11LayerConfig" title="Permalink to this definition">¶</a></dt>
<dd></dd></dl>

<dl class="function">
<dt id="_CPPv2N6paddle18SequenceAgentLayerD0Ev">
<span id="paddle::SequenceAgentLayer::~SequenceAgentLayer"></span><span class="target" id="paddleclasspaddle_1_1SequenceAgentLayer_1a948750a16298b7e532fcc0a9ffcdda43"></span><code class="descname">~SequenceAgentLayer</code><span class="sig-paren">(</span><span class="sig-paren">)</span><a class="headerlink" href="#_CPPv2N6paddle18SequenceAgentLayerD0Ev" title="Permalink to this definition">¶</a></dt>
<dd></dd></dl>

<dl class="function">
<dt id="_CPPv2N6paddle18SequenceAgentLayer7forwardE8PassType">
4087
<span id="paddle::SequenceAgentLayer::forward__PassType"></span><span class="target" id="paddleclasspaddle_1_1SequenceAgentLayer_1a8ad70f219bdf3fc6090c4ff95b45be41"></span>void <code class="descname">forward</code><span class="sig-paren">(</span>PassType <em>passType</em><span class="sig-paren">)</span><a class="headerlink" href="#_CPPv2N6paddle18SequenceAgentLayer7forwardE8PassType" title="Permalink to this definition">¶</a></dt>
Y
Yu Yang 已提交
4088 4089 4090 4091 4092
<dd><p>Forward propagation. All inherited implementation should call Layer::foward() function. </p>
</dd></dl>

<dl class="function">
<dt id="_CPPv2N6paddle18SequenceAgentLayer8backwardERK14UpdateCallback">
4093
<span id="paddle::SequenceAgentLayer::backward__UpdateCallbackCR"></span><span class="target" id="paddleclasspaddle_1_1SequenceAgentLayer_1af3debea2f2b4a0e20afa94f6aad01f78"></span>void <code class="descname">backward</code><span class="sig-paren">(</span><em class="property">const</em> <a class="reference internal" href="../../parameter/parameter/parameter.html#_CPPv2N6paddle14UpdateCallbackE" title="paddle::UpdateCallback">UpdateCallback</a> &amp;<em>callback</em> = nullptr<span class="sig-paren">)</span><a class="headerlink" href="#_CPPv2N6paddle18SequenceAgentLayer8backwardERK14UpdateCallback" title="Permalink to this definition">¶</a></dt>
4094
<dd><p>Backward propagation. Should only be called after <a class="reference internal" href="#paddleclasspaddle_1_1Layer_1a12386b3f20dd731e7ceaa2c61667cbe1"><span class="std std-ref">Layer::forward()</span></a> function. </p>
Y
Yu Yang 已提交
4095 4096 4097 4098 4099 4100 4101 4102 4103 4104 4105
</dd></dl>

</div>
</dd></dl>

</div>
<div class="section" id="gatheragentlayer">
<h2>GatherAgentLayer<a class="headerlink" href="#gatheragentlayer" title="Permalink to this headline">¶</a></h2>
<dl class="class">
<dt id="_CPPv2N6paddle16GatherAgentLayerE">
<span id="paddle::GatherAgentLayer"></span><span class="target" id="paddleclasspaddle_1_1GatherAgentLayer"></span><em class="property">class </em><code class="descclassname">paddle::</code><code class="descname">GatherAgentLayer</code><a class="headerlink" href="#_CPPv2N6paddle16GatherAgentLayerE" title="Permalink to this definition">¶</a></dt>
4106 4107 4108
<dd><p>Like <a class="reference internal" href="#paddleclasspaddle_1_1AgentLayer"><span class="std std-ref">AgentLayer</span></a>, but it can gather many real layers. Each real layer give a few rows of a sequence, after gather all real layers, <a class="reference internal" href="#paddleclasspaddle_1_1GatherAgentLayer"><span class="std std-ref">GatherAgentLayer</span></a> collect a complete sequence. </p>
<p>Inherits from <a class="reference internal" href="#paddleclasspaddle_1_1Layer"><span class="std std-ref">paddle::Layer</span></a></p>
<p>Subclassed by <a class="reference internal" href="#paddleclasspaddle_1_1SequenceGatherAgentLayer"><span class="std std-ref">paddle::SequenceGatherAgentLayer</span></a></p>
4109
<div class="breathe-sectiondef docutils container">
Y
Yu Yang 已提交
4110 4111 4112 4113 4114 4115 4116 4117
<p class="breathe-sectiondef-title rubric">Public Functions</p>
<dl class="function">
<dt id="_CPPv2N6paddle16GatherAgentLayer16GatherAgentLayerERK11LayerConfig">
<span id="paddle::GatherAgentLayer::GatherAgentLayer__LayerConfigCR"></span><span class="target" id="paddleclasspaddle_1_1GatherAgentLayer_1aba5d16c5ca1ec3b97230cb6c156941f0"></span><code class="descname">GatherAgentLayer</code><span class="sig-paren">(</span><em class="property">const</em> LayerConfig &amp;<em>config</em><span class="sig-paren">)</span><a class="headerlink" href="#_CPPv2N6paddle16GatherAgentLayer16GatherAgentLayerERK11LayerConfig" title="Permalink to this definition">¶</a></dt>
<dd></dd></dl>

<dl class="function">
<dt id="_CPPv2N6paddle16GatherAgentLayerD0Ev">
4118
<span id="paddle::GatherAgentLayer::~GatherAgentLayer"></span><span class="target" id="paddleclasspaddle_1_1GatherAgentLayer_1a27e43fa0b4298d0408384d08124b1d49"></span><em class="property">virtual</em> <code class="descname">~GatherAgentLayer</code><span class="sig-paren">(</span><span class="sig-paren">)</span><a class="headerlink" href="#_CPPv2N6paddle16GatherAgentLayerD0Ev" title="Permalink to this definition">¶</a></dt>
Y
Yu Yang 已提交
4119 4120 4121 4122
<dd></dd></dl>

<dl class="function">
<dt id="_CPPv2N6paddle16GatherAgentLayer4initERK8LayerMapRK12ParameterMap">
4123
<span id="paddle::GatherAgentLayer::init__LayerMapCR.ParameterMapCR"></span><span class="target" id="paddleclasspaddle_1_1GatherAgentLayer_1af65581b85bf4c6066cd85faaba6b0c17"></span>bool <code class="descname">init</code><span class="sig-paren">(</span><em class="property">const</em> LayerMap &amp;<em>layerMap</em>, <em class="property">const</em> <a class="reference internal" href="../../parameter/parameter/parameter.html#_CPPv2N6paddle12ParameterMapE" title="paddle::ParameterMap">ParameterMap</a> &amp;<em>parameterMap</em><span class="sig-paren">)</span><a class="headerlink" href="#_CPPv2N6paddle16GatherAgentLayer4initERK8LayerMapRK12ParameterMap" title="Permalink to this definition">¶</a></dt>
Y
Yu Yang 已提交
4124 4125 4126 4127 4128 4129 4130 4131 4132 4133 4134 4135 4136 4137 4138
<dd><p>Intialization. For example, adding input layers from layerMap and parameterMap. </p>
</dd></dl>

<dl class="function">
<dt id="_CPPv2N6paddle16GatherAgentLayer21copyIdAndSequenceInfoERK8ArgumentRK10IVectorPtrRKNSt6vectorIiEE">
<span id="paddle::GatherAgentLayer::copyIdAndSequenceInfo__ArgumentCR.IVectorPtrCR.std::vector:i:CR"></span><span class="target" id="paddleclasspaddle_1_1GatherAgentLayer_1ab5fc9649c97de99628fa17b55aca955a"></span>void <code class="descname">copyIdAndSequenceInfo</code><span class="sig-paren">(</span><em class="property">const</em> <a class="reference internal" href="../../parameter/parameter/parameter.html#_CPPv2N6paddle8ArgumentE" title="paddle::Argument">Argument</a> &amp;<em>input</em>, <em class="property">const</em> <a class="reference internal" href="../../math/matrix/matrix.html#_CPPv2N6paddle10IVectorPtrE" title="paddle::IVectorPtr">IVectorPtr</a> &amp;<em>allIds</em>, <em class="property">const</em> std::vector&lt;int&gt; &amp;<em>idIndex</em><span class="sig-paren">)</span><a class="headerlink" href="#_CPPv2N6paddle16GatherAgentLayer21copyIdAndSequenceInfoERK8ArgumentRK10IVectorPtrRKNSt6vectorIiEE" title="Permalink to this definition">¶</a></dt>
<dd></dd></dl>

<dl class="function">
<dt id="_CPPv2N6paddle16GatherAgentLayer12addRealLayerE8LayerPtr">
<span id="paddle::GatherAgentLayer::addRealLayer__LayerPtr"></span><span class="target" id="paddleclasspaddle_1_1GatherAgentLayer_1a0545bbace8c05701a1be16c4a6189d70"></span>void <code class="descname">addRealLayer</code><span class="sig-paren">(</span>LayerPtr <em>layer</em><span class="sig-paren">)</span><a class="headerlink" href="#_CPPv2N6paddle16GatherAgentLayer12addRealLayerE8LayerPtr" title="Permalink to this definition">¶</a></dt>
<dd></dd></dl>

<dl class="function">
<dt id="_CPPv2N6paddle16GatherAgentLayer7forwardE8PassType">
4139
<span id="paddle::GatherAgentLayer::forward__PassType"></span><span class="target" id="paddleclasspaddle_1_1GatherAgentLayer_1ae91b8d6523f31a2d31a1b04ec6487f02"></span>void <code class="descname">forward</code><span class="sig-paren">(</span>PassType <em>passType</em><span class="sig-paren">)</span><a class="headerlink" href="#_CPPv2N6paddle16GatherAgentLayer7forwardE8PassType" title="Permalink to this definition">¶</a></dt>
Y
Yu Yang 已提交
4140 4141 4142 4143 4144
<dd><p>Forward propagation. All inherited implementation should call Layer::foward() function. </p>
</dd></dl>

<dl class="function">
<dt id="_CPPv2N6paddle16GatherAgentLayer8backwardERK14UpdateCallback">
4145
<span id="paddle::GatherAgentLayer::backward__UpdateCallbackCR"></span><span class="target" id="paddleclasspaddle_1_1GatherAgentLayer_1af15b7b072fb289584a0acc8af8d2707c"></span>void <code class="descname">backward</code><span class="sig-paren">(</span><em class="property">const</em> <a class="reference internal" href="../../parameter/parameter/parameter.html#_CPPv2N6paddle14UpdateCallbackE" title="paddle::UpdateCallback">UpdateCallback</a> &amp;<em>callback</em><span class="sig-paren">)</span><a class="headerlink" href="#_CPPv2N6paddle16GatherAgentLayer8backwardERK14UpdateCallback" title="Permalink to this definition">¶</a></dt>
4146
<dd><p>Backward propagation. Should only be called after <a class="reference internal" href="#paddleclasspaddle_1_1Layer_1a12386b3f20dd731e7ceaa2c61667cbe1"><span class="std std-ref">Layer::forward()</span></a> function. </p>
Y
Yu Yang 已提交
4147 4148 4149
</dd></dl>

</div>
4150
<div class="breathe-sectiondef docutils container">
Y
Yu Yang 已提交
4151 4152 4153 4154 4155 4156 4157 4158 4159 4160 4161 4162 4163 4164 4165 4166 4167 4168 4169 4170 4171 4172 4173 4174 4175 4176 4177 4178 4179 4180
<p class="breathe-sectiondef-title rubric">Protected Attributes</p>
<dl class="member">
<dt id="_CPPv2N6paddle16GatherAgentLayer11realLayers_E">
<span id="paddle::GatherAgentLayer::realLayers___std::vector:LayerPtr:"></span><span class="target" id="paddleclasspaddle_1_1GatherAgentLayer_1afce22ba09244c08c2ef5cb663355e418"></span>std::vector&lt;LayerPtr&gt; <code class="descname">realLayers_</code><a class="headerlink" href="#_CPPv2N6paddle16GatherAgentLayer11realLayers_E" title="Permalink to this definition">¶</a></dt>
<dd></dd></dl>

<dl class="member">
<dt id="_CPPv2N6paddle16GatherAgentLayer7idsVec_E">
<span id="paddle::GatherAgentLayer::idsVec___std::vector:IVectorPtr:"></span><span class="target" id="paddleclasspaddle_1_1GatherAgentLayer_1ac34dfb99fd1151129051bd67dd33ed85"></span>std::vector&lt;<a class="reference internal" href="../../math/matrix/matrix.html#_CPPv2N6paddle10IVectorPtrE" title="paddle::IVectorPtr">IVectorPtr</a>&gt; <code class="descname">idsVec_</code><a class="headerlink" href="#_CPPv2N6paddle16GatherAgentLayer7idsVec_E" title="Permalink to this definition">¶</a></dt>
<dd></dd></dl>

<dl class="member">
<dt id="_CPPv2N6paddle16GatherAgentLayer7allIds_E">
<span id="paddle::GatherAgentLayer::allIds___IVectorPtr"></span><span class="target" id="paddleclasspaddle_1_1GatherAgentLayer_1a70ad4614de8b17adef65799e1d7c7f2a"></span><a class="reference internal" href="../../math/matrix/matrix.html#_CPPv2N6paddle10IVectorPtrE" title="paddle::IVectorPtr">IVectorPtr</a> <code class="descname">allIds_</code><a class="headerlink" href="#_CPPv2N6paddle16GatherAgentLayer7allIds_E" title="Permalink to this definition">¶</a></dt>
<dd></dd></dl>

<dl class="member">
<dt id="_CPPv2N6paddle16GatherAgentLayer8idIndex_E">
<span id="paddle::GatherAgentLayer::idIndex___std::vector:i:"></span><span class="target" id="paddleclasspaddle_1_1GatherAgentLayer_1a8e04600e19fe1c76221abeab7ab4f122"></span>std::vector&lt;int&gt; <code class="descname">idIndex_</code><a class="headerlink" href="#_CPPv2N6paddle16GatherAgentLayer8idIndex_E" title="Permalink to this definition">¶</a></dt>
<dd></dd></dl>

</div>
</dd></dl>

</div>
<div class="section" id="sequencegatheragentlayer">
<h2>SequenceGatherAgentLayer<a class="headerlink" href="#sequencegatheragentlayer" title="Permalink to this headline">¶</a></h2>
<dl class="class">
<dt id="_CPPv2N6paddle24SequenceGatherAgentLayerE">
<span id="paddle::SequenceGatherAgentLayer"></span><span class="target" id="paddleclasspaddle_1_1SequenceGatherAgentLayer"></span><em class="property">class </em><code class="descclassname">paddle::</code><code class="descname">SequenceGatherAgentLayer</code><a class="headerlink" href="#_CPPv2N6paddle24SequenceGatherAgentLayerE" title="Permalink to this definition">¶</a></dt>
4181 4182
<dd><p>Like <a class="reference internal" href="#paddleclasspaddle_1_1GatherAgentLayer"><span class="std std-ref">GatherAgentLayer</span></a>, but select a few sequence in real layer. <em>ids</em> in addRealLayer() are the ids of selected sequence. It&#8217;s used to reorder sequence output. </p>
<p>Inherits from <a class="reference internal" href="#paddleclasspaddle_1_1GatherAgentLayer"><span class="std std-ref">paddle::GatherAgentLayer</span></a></p>
4183
<div class="breathe-sectiondef docutils container">
Y
Yu Yang 已提交
4184 4185 4186 4187 4188 4189 4190 4191
<p class="breathe-sectiondef-title rubric">Public Functions</p>
<dl class="function">
<dt id="_CPPv2N6paddle24SequenceGatherAgentLayer24SequenceGatherAgentLayerERK11LayerConfig">
<span id="paddle::SequenceGatherAgentLayer::SequenceGatherAgentLayer__LayerConfigCR"></span><span class="target" id="paddleclasspaddle_1_1SequenceGatherAgentLayer_1a1f119fd1cab2e8777e77a28af1a70b98"></span><code class="descname">SequenceGatherAgentLayer</code><span class="sig-paren">(</span><em class="property">const</em> LayerConfig &amp;<em>config</em><span class="sig-paren">)</span><a class="headerlink" href="#_CPPv2N6paddle24SequenceGatherAgentLayer24SequenceGatherAgentLayerERK11LayerConfig" title="Permalink to this definition">¶</a></dt>
<dd></dd></dl>

<dl class="function">
<dt id="_CPPv2N6paddle24SequenceGatherAgentLayerD0Ev">
4192
<span id="paddle::SequenceGatherAgentLayer::~SequenceGatherAgentLayer"></span><span class="target" id="paddleclasspaddle_1_1SequenceGatherAgentLayer_1af7240b8a6b87bf085f5194ecbaa4bdad"></span><em class="property">virtual</em> <code class="descname">~SequenceGatherAgentLayer</code><span class="sig-paren">(</span><span class="sig-paren">)</span><a class="headerlink" href="#_CPPv2N6paddle24SequenceGatherAgentLayerD0Ev" title="Permalink to this definition">¶</a></dt>
Y
Yu Yang 已提交
4193 4194 4195 4196
<dd></dd></dl>

<dl class="function">
<dt id="_CPPv2N6paddle24SequenceGatherAgentLayer7forwardE8PassType">
4197
<span id="paddle::SequenceGatherAgentLayer::forward__PassType"></span><span class="target" id="paddleclasspaddle_1_1SequenceGatherAgentLayer_1a50784b1fd9901faff1cfd7ed147b6b78"></span>void <code class="descname">forward</code><span class="sig-paren">(</span>PassType <em>passType</em><span class="sig-paren">)</span><a class="headerlink" href="#_CPPv2N6paddle24SequenceGatherAgentLayer7forwardE8PassType" title="Permalink to this definition">¶</a></dt>
Y
Yu Yang 已提交
4198 4199 4200 4201 4202
<dd><p>Forward propagation. All inherited implementation should call Layer::foward() function. </p>
</dd></dl>

<dl class="function">
<dt id="_CPPv2N6paddle24SequenceGatherAgentLayer8backwardERK14UpdateCallback">
4203
<span id="paddle::SequenceGatherAgentLayer::backward__UpdateCallbackCR"></span><span class="target" id="paddleclasspaddle_1_1SequenceGatherAgentLayer_1ad2a03942b8ddfedeae2776fd515c0cd2"></span>void <code class="descname">backward</code><span class="sig-paren">(</span><em class="property">const</em> <a class="reference internal" href="../../parameter/parameter/parameter.html#_CPPv2N6paddle14UpdateCallbackE" title="paddle::UpdateCallback">UpdateCallback</a> &amp;<em>callback</em><span class="sig-paren">)</span><a class="headerlink" href="#_CPPv2N6paddle24SequenceGatherAgentLayer8backwardERK14UpdateCallback" title="Permalink to this definition">¶</a></dt>
4204
<dd><p>Backward propagation. Should only be called after <a class="reference internal" href="#paddleclasspaddle_1_1Layer_1a12386b3f20dd731e7ceaa2c61667cbe1"><span class="std std-ref">Layer::forward()</span></a> function. </p>
Y
Yu Yang 已提交
4205 4206 4207 4208 4209 4210 4211 4212 4213 4214 4215
</dd></dl>

</div>
</dd></dl>

</div>
<div class="section" id="scatteragentlayer">
<h2>ScatterAgentLayer<a class="headerlink" href="#scatteragentlayer" title="Permalink to this headline">¶</a></h2>
<dl class="class">
<dt id="_CPPv2N6paddle17ScatterAgentLayerE">
<span id="paddle::ScatterAgentLayer"></span><span class="target" id="paddleclasspaddle_1_1ScatterAgentLayer"></span><em class="property">class </em><code class="descclassname">paddle::</code><code class="descname">ScatterAgentLayer</code><a class="headerlink" href="#_CPPv2N6paddle17ScatterAgentLayerE" title="Permalink to this definition">¶</a></dt>
4216 4217 4218
<dd><p>Like <a class="reference internal" href="#paddleclasspaddle_1_1AgentLayer"><span class="std std-ref">AgentLayer</span></a>, but only select a few rows in real layer. [idIndex, idIndex + idSize) of <em>ids</em> in setRealLayerAndOutput() are the selected row ids. It&#8217;s used to scatter one layer&#8217;s output to many small submodels. <a class="reference internal" href="#paddleclasspaddle_1_1ScatterAgentLayer"><span class="std std-ref">ScatterAgentLayer</span></a> can support ids real layer, if it is, the agent will select a few ids in real layer. </p>
<p>Inherits from <a class="reference internal" href="#paddleclasspaddle_1_1Layer"><span class="std std-ref">paddle::Layer</span></a></p>
<p>Subclassed by <a class="reference internal" href="#paddleclasspaddle_1_1SequenceScatterAgentLayer"><span class="std std-ref">paddle::SequenceScatterAgentLayer</span></a></p>
4219
<div class="breathe-sectiondef docutils container">
Y
Yu Yang 已提交
4220 4221 4222 4223 4224 4225 4226 4227
<p class="breathe-sectiondef-title rubric">Public Functions</p>
<dl class="function">
<dt id="_CPPv2N6paddle17ScatterAgentLayer17ScatterAgentLayerERK11LayerConfig">
<span id="paddle::ScatterAgentLayer::ScatterAgentLayer__LayerConfigCR"></span><span class="target" id="paddleclasspaddle_1_1ScatterAgentLayer_1af42ce91035860fcc0ce572eb6d31b39f"></span><code class="descname">ScatterAgentLayer</code><span class="sig-paren">(</span><em class="property">const</em> LayerConfig &amp;<em>config</em><span class="sig-paren">)</span><a class="headerlink" href="#_CPPv2N6paddle17ScatterAgentLayer17ScatterAgentLayerERK11LayerConfig" title="Permalink to this definition">¶</a></dt>
<dd></dd></dl>

<dl class="function">
<dt id="_CPPv2N6paddle17ScatterAgentLayerD0Ev">
4228
<span id="paddle::ScatterAgentLayer::~ScatterAgentLayer"></span><span class="target" id="paddleclasspaddle_1_1ScatterAgentLayer_1a9d0b2220cda1a35a9f26b24311601cfe"></span><em class="property">virtual</em> <code class="descname">~ScatterAgentLayer</code><span class="sig-paren">(</span><span class="sig-paren">)</span><a class="headerlink" href="#_CPPv2N6paddle17ScatterAgentLayerD0Ev" title="Permalink to this definition">¶</a></dt>
Y
Yu Yang 已提交
4229 4230 4231 4232
<dd></dd></dl>

<dl class="function">
<dt id="_CPPv2N6paddle17ScatterAgentLayer4initERK8LayerMapRK12ParameterMap">
4233
<span id="paddle::ScatterAgentLayer::init__LayerMapCR.ParameterMapCR"></span><span class="target" id="paddleclasspaddle_1_1ScatterAgentLayer_1a1898acc71a9f05d096af361c7e22c9c8"></span>bool <code class="descname">init</code><span class="sig-paren">(</span><em class="property">const</em> LayerMap &amp;<em>layerMap</em>, <em class="property">const</em> <a class="reference internal" href="../../parameter/parameter/parameter.html#_CPPv2N6paddle12ParameterMapE" title="paddle::ParameterMap">ParameterMap</a> &amp;<em>parameterMap</em><span class="sig-paren">)</span><a class="headerlink" href="#_CPPv2N6paddle17ScatterAgentLayer4initERK8LayerMapRK12ParameterMap" title="Permalink to this definition">¶</a></dt>
Y
Yu Yang 已提交
4234 4235 4236 4237 4238 4239 4240 4241 4242
<dd><p>Intialization. For example, adding input layers from layerMap and parameterMap. </p>
</dd></dl>

<dl class="function">
<dt id="_CPPv2N6paddle17ScatterAgentLayer12setRealLayerE8LayerPtrRKNSt6vectorIiEEb">
<span id="paddle::ScatterAgentLayer::setRealLayer__LayerPtr.std::vector:i:CR.b"></span><span class="target" id="paddleclasspaddle_1_1ScatterAgentLayer_1abc1b52a1a9b0fa738300450626e24b80"></span>void <code class="descname">setRealLayer</code><span class="sig-paren">(</span>LayerPtr <em>layer</em>, <em class="property">const</em> std::vector&lt;int&gt; &amp;<em>ids</em>, bool <em>copyId</em> = false<span class="sig-paren">)</span><a class="headerlink" href="#_CPPv2N6paddle17ScatterAgentLayer12setRealLayerE8LayerPtrRKNSt6vectorIiEEb" title="Permalink to this definition">¶</a></dt>
<dd><p>set real layer in generation </p>
<p><dl class="docutils">
<dt><strong>Parameters</strong></dt>
4243 4244 4245 4246
<dd><ul class="breatheparameterlist first last simple">
<li><code class="docutils literal"><span class="pre">layer[input]</span></code>: realLayer </li>
<li><code class="docutils literal"><span class="pre">ids[input]</span></code>: row id in real layer </li>
<li><code class="docutils literal"><span class="pre">copyId[input]</span></code>: whether to copy a cpu version of ids, false(default) in <a class="reference internal" href="#paddleclasspaddle_1_1ScatterAgentLayer"><span class="std std-ref">ScatterAgentLayer</span></a>, and true in <a class="reference internal" href="#paddleclasspaddle_1_1SequenceScatterAgentLayer"><span class="std std-ref">SequenceScatterAgentLayer</span></a>. </li>
Y
Yu Yang 已提交
4247 4248 4249 4250 4251 4252 4253 4254 4255 4256 4257 4258 4259 4260 4261 4262 4263 4264
</ul>
</dd>
</dl>
</p>
</dd></dl>

<dl class="function">
<dt id="_CPPv2N6paddle17ScatterAgentLayer21setRealLayerAndOutputE8LayerPtrRK8ArgumentRK10IVectorPtrii">
<span id="paddle::ScatterAgentLayer::setRealLayerAndOutput__LayerPtr.ArgumentCR.IVectorPtrCR.i.i"></span><span class="target" id="paddleclasspaddle_1_1ScatterAgentLayer_1a4c546ca174d0d4f3b29ef40dfcf23e16"></span>void <code class="descname">setRealLayerAndOutput</code><span class="sig-paren">(</span>LayerPtr <em>layer</em>, <em class="property">const</em> <a class="reference internal" href="../../parameter/parameter/parameter.html#_CPPv2N6paddle8ArgumentE" title="paddle::Argument">Argument</a> &amp;<em>outArg</em>, <em class="property">const</em> <a class="reference internal" href="../../math/matrix/matrix.html#_CPPv2N6paddle10IVectorPtrE" title="paddle::IVectorPtr">IVectorPtr</a> &amp;<em>ids</em>, int <em>idIndex</em>, int <em>idSize</em><span class="sig-paren">)</span><a class="headerlink" href="#_CPPv2N6paddle17ScatterAgentLayer21setRealLayerAndOutputE8LayerPtrRK8ArgumentRK10IVectorPtrii" title="Permalink to this definition">¶</a></dt>
<dd></dd></dl>

<dl class="function">
<dt id="_CPPv2N6paddle17ScatterAgentLayer25setSequenceStartPositionsERK16ICpuGpuVectorPtrii">
<span id="paddle::ScatterAgentLayer::setSequenceStartPositions__ICpuGpuVectorPtrCR.i.i"></span><span class="target" id="paddleclasspaddle_1_1ScatterAgentLayer_1a277b93420fb9dc4a6b03f85dac26acb0"></span>void <code class="descname">setSequenceStartPositions</code><span class="sig-paren">(</span><em class="property">const</em> <a class="reference internal" href="../../math/matrix/matrix.html#_CPPv2N6paddle16ICpuGpuVectorPtrE" title="paddle::ICpuGpuVectorPtr">ICpuGpuVectorPtr</a> &amp;<em>sequenceStartPositions</em>, int <em>seqStartPosIndex</em>, int <em>numSequences</em><span class="sig-paren">)</span><a class="headerlink" href="#_CPPv2N6paddle17ScatterAgentLayer25setSequenceStartPositionsERK16ICpuGpuVectorPtrii" title="Permalink to this definition">¶</a></dt>
<dd></dd></dl>

<dl class="function">
<dt id="_CPPv2N6paddle17ScatterAgentLayer7forwardE8PassType">
4265
<span id="paddle::ScatterAgentLayer::forward__PassType"></span><span class="target" id="paddleclasspaddle_1_1ScatterAgentLayer_1ab5c25307b68a38fc6b77efa8251384ea"></span>void <code class="descname">forward</code><span class="sig-paren">(</span>PassType <em>passType</em><span class="sig-paren">)</span><a class="headerlink" href="#_CPPv2N6paddle17ScatterAgentLayer7forwardE8PassType" title="Permalink to this definition">¶</a></dt>
Y
Yu Yang 已提交
4266 4267 4268 4269 4270
<dd><p>Forward propagation. All inherited implementation should call Layer::foward() function. </p>
</dd></dl>

<dl class="function">
<dt id="_CPPv2N6paddle17ScatterAgentLayer8backwardERK14UpdateCallback">
4271
<span id="paddle::ScatterAgentLayer::backward__UpdateCallbackCR"></span><span class="target" id="paddleclasspaddle_1_1ScatterAgentLayer_1a42916224e6e58bd6b1afa220417b8e41"></span>void <code class="descname">backward</code><span class="sig-paren">(</span><em class="property">const</em> <a class="reference internal" href="../../parameter/parameter/parameter.html#_CPPv2N6paddle14UpdateCallbackE" title="paddle::UpdateCallback">UpdateCallback</a> &amp;<em>callback</em><span class="sig-paren">)</span><a class="headerlink" href="#_CPPv2N6paddle17ScatterAgentLayer8backwardERK14UpdateCallback" title="Permalink to this definition">¶</a></dt>
4272
<dd><p>Backward propagation. Should only be called after <a class="reference internal" href="#paddleclasspaddle_1_1Layer_1a12386b3f20dd731e7ceaa2c61667cbe1"><span class="std std-ref">Layer::forward()</span></a> function. </p>
Y
Yu Yang 已提交
4273 4274 4275
</dd></dl>

</div>
4276
<div class="breathe-sectiondef docutils container">
Y
Yu Yang 已提交
4277 4278 4279 4280 4281 4282 4283 4284 4285 4286 4287 4288 4289 4290 4291 4292 4293 4294 4295 4296 4297 4298 4299 4300 4301 4302 4303 4304 4305 4306 4307 4308 4309 4310 4311 4312 4313 4314 4315 4316 4317 4318 4319 4320 4321 4322 4323 4324 4325 4326
<p class="breathe-sectiondef-title rubric">Protected Attributes</p>
<dl class="member">
<dt id="_CPPv2N6paddle17ScatterAgentLayer10realLayer_E">
<span id="paddle::ScatterAgentLayer::realLayer___LayerPtr"></span><span class="target" id="paddleclasspaddle_1_1ScatterAgentLayer_1a49e6e90c78faad2d6d01fdd128bd2e8a"></span>LayerPtr <code class="descname">realLayer_</code><a class="headerlink" href="#_CPPv2N6paddle17ScatterAgentLayer10realLayer_E" title="Permalink to this definition">¶</a></dt>
<dd></dd></dl>

<dl class="member">
<dt id="_CPPv2N6paddle17ScatterAgentLayer4ids_E">
<span id="paddle::ScatterAgentLayer::ids___IVectorPtr"></span><span class="target" id="paddleclasspaddle_1_1ScatterAgentLayer_1a3daa90577952061a63aa1f4d76257344"></span><a class="reference internal" href="../../math/matrix/matrix.html#_CPPv2N6paddle10IVectorPtrE" title="paddle::IVectorPtr">IVectorPtr</a> <code class="descname">ids_</code><a class="headerlink" href="#_CPPv2N6paddle17ScatterAgentLayer4ids_E" title="Permalink to this definition">¶</a></dt>
<dd></dd></dl>

<dl class="member">
<dt id="_CPPv2N6paddle17ScatterAgentLayer7cpuIds_E">
<span id="paddle::ScatterAgentLayer::cpuIds___IVectorPtr"></span><span class="target" id="paddleclasspaddle_1_1ScatterAgentLayer_1aff084df3fd6c05bee8cca0f58fa396b7"></span><a class="reference internal" href="../../math/matrix/matrix.html#_CPPv2N6paddle10IVectorPtrE" title="paddle::IVectorPtr">IVectorPtr</a> <code class="descname">cpuIds_</code><a class="headerlink" href="#_CPPv2N6paddle17ScatterAgentLayer7cpuIds_E" title="Permalink to this definition">¶</a></dt>
<dd></dd></dl>

<dl class="member">
<dt id="_CPPv2N6paddle17ScatterAgentLayer11realOutArg_E">
<span id="paddle::ScatterAgentLayer::realOutArg___Argument"></span><span class="target" id="paddleclasspaddle_1_1ScatterAgentLayer_1a2aedc7e1fe22798b5bb0a200beee8fec"></span><a class="reference internal" href="../../parameter/parameter/parameter.html#_CPPv2N6paddle8ArgumentE" title="paddle::Argument">Argument</a> <code class="descname">realOutArg_</code><a class="headerlink" href="#_CPPv2N6paddle17ScatterAgentLayer11realOutArg_E" title="Permalink to this definition">¶</a></dt>
<dd></dd></dl>

<dl class="member">
<dt id="_CPPv2N6paddle17ScatterAgentLayer8idIndex_E">
<span id="paddle::ScatterAgentLayer::idIndex___i"></span><span class="target" id="paddleclasspaddle_1_1ScatterAgentLayer_1afa60ac16c428fa733715bc018fbaf37b"></span>int <code class="descname">idIndex_</code><a class="headerlink" href="#_CPPv2N6paddle17ScatterAgentLayer8idIndex_E" title="Permalink to this definition">¶</a></dt>
<dd></dd></dl>

<dl class="member">
<dt id="_CPPv2N6paddle17ScatterAgentLayer7idSize_E">
<span id="paddle::ScatterAgentLayer::idSize___i"></span><span class="target" id="paddleclasspaddle_1_1ScatterAgentLayer_1a8735c7ba57998210b8d65cda234b709c"></span>int <code class="descname">idSize_</code><a class="headerlink" href="#_CPPv2N6paddle17ScatterAgentLayer7idSize_E" title="Permalink to this definition">¶</a></dt>
<dd></dd></dl>

<dl class="member">
<dt id="_CPPv2N6paddle17ScatterAgentLayer17seqStartPosIndex_E">
<span id="paddle::ScatterAgentLayer::seqStartPosIndex___i"></span><span class="target" id="paddleclasspaddle_1_1ScatterAgentLayer_1a129dcf5a2ab6a87a0c7b5b82cad918d6"></span>int <code class="descname">seqStartPosIndex_</code><a class="headerlink" href="#_CPPv2N6paddle17ScatterAgentLayer17seqStartPosIndex_E" title="Permalink to this definition">¶</a></dt>
<dd></dd></dl>

<dl class="member">
<dt id="_CPPv2N6paddle17ScatterAgentLayer13numSequences_E">
<span id="paddle::ScatterAgentLayer::numSequences___i"></span><span class="target" id="paddleclasspaddle_1_1ScatterAgentLayer_1a2a388c6ef3ac04e777d790cc0edabb40"></span>int <code class="descname">numSequences_</code><a class="headerlink" href="#_CPPv2N6paddle17ScatterAgentLayer13numSequences_E" title="Permalink to this definition">¶</a></dt>
<dd></dd></dl>

</div>
</dd></dl>

</div>
<div class="section" id="sequencescatteragentlayer">
<h2>SequenceScatterAgentLayer<a class="headerlink" href="#sequencescatteragentlayer" title="Permalink to this headline">¶</a></h2>
<dl class="class">
<dt id="_CPPv2N6paddle25SequenceScatterAgentLayerE">
<span id="paddle::SequenceScatterAgentLayer"></span><span class="target" id="paddleclasspaddle_1_1SequenceScatterAgentLayer"></span><em class="property">class </em><code class="descclassname">paddle::</code><code class="descname">SequenceScatterAgentLayer</code><a class="headerlink" href="#_CPPv2N6paddle25SequenceScatterAgentLayerE" title="Permalink to this definition">¶</a></dt>
4327 4328
<dd><p>Like <a class="reference internal" href="#paddleclasspaddle_1_1ScatterAgentLayer"><span class="std std-ref">ScatterAgentLayer</span></a>, but select a few sequence in real layer. <em>ids</em> in <a class="reference internal" href="#paddleclasspaddle_1_1ScatterAgentLayer_1abc1b52a1a9b0fa738300450626e24b80"><span class="std std-ref">setRealLayer()</span></a> or setRealLayerAndOutput() are the ids of selected sequence. It&#8217;s used to reorder sequence input. </p>
<p>Inherits from <a class="reference internal" href="#paddleclasspaddle_1_1ScatterAgentLayer"><span class="std std-ref">paddle::ScatterAgentLayer</span></a></p>
4329
<div class="breathe-sectiondef docutils container">
Y
Yu Yang 已提交
4330 4331 4332 4333 4334 4335 4336 4337
<p class="breathe-sectiondef-title rubric">Public Functions</p>
<dl class="function">
<dt id="_CPPv2N6paddle25SequenceScatterAgentLayer25SequenceScatterAgentLayerERK11LayerConfig">
<span id="paddle::SequenceScatterAgentLayer::SequenceScatterAgentLayer__LayerConfigCR"></span><span class="target" id="paddleclasspaddle_1_1SequenceScatterAgentLayer_1a6f5b0406695a164cc0f8e339a666c31d"></span><code class="descname">SequenceScatterAgentLayer</code><span class="sig-paren">(</span><em class="property">const</em> LayerConfig &amp;<em>config</em><span class="sig-paren">)</span><a class="headerlink" href="#_CPPv2N6paddle25SequenceScatterAgentLayer25SequenceScatterAgentLayerERK11LayerConfig" title="Permalink to this definition">¶</a></dt>
<dd></dd></dl>

<dl class="function">
<dt id="_CPPv2N6paddle25SequenceScatterAgentLayerD0Ev">
4338
<span id="paddle::SequenceScatterAgentLayer::~SequenceScatterAgentLayer"></span><span class="target" id="paddleclasspaddle_1_1SequenceScatterAgentLayer_1a9e68a48d37b4ff5d7ba51df40ea62ece"></span><em class="property">virtual</em> <code class="descname">~SequenceScatterAgentLayer</code><span class="sig-paren">(</span><span class="sig-paren">)</span><a class="headerlink" href="#_CPPv2N6paddle25SequenceScatterAgentLayerD0Ev" title="Permalink to this definition">¶</a></dt>
Y
Yu Yang 已提交
4339 4340 4341 4342
<dd></dd></dl>

<dl class="function">
<dt id="_CPPv2N6paddle25SequenceScatterAgentLayer7forwardE8PassType">
4343
<span id="paddle::SequenceScatterAgentLayer::forward__PassType"></span><span class="target" id="paddleclasspaddle_1_1SequenceScatterAgentLayer_1ab72dfdd597a119bf7bd8a38bd30779dc"></span>void <code class="descname">forward</code><span class="sig-paren">(</span>PassType <em>passType</em><span class="sig-paren">)</span><a class="headerlink" href="#_CPPv2N6paddle25SequenceScatterAgentLayer7forwardE8PassType" title="Permalink to this definition">¶</a></dt>
Y
Yu Yang 已提交
4344 4345 4346 4347 4348
<dd><p>Forward propagation. All inherited implementation should call Layer::foward() function. </p>
</dd></dl>

<dl class="function">
<dt id="_CPPv2N6paddle25SequenceScatterAgentLayer8backwardERK14UpdateCallback">
4349
<span id="paddle::SequenceScatterAgentLayer::backward__UpdateCallbackCR"></span><span class="target" id="paddleclasspaddle_1_1SequenceScatterAgentLayer_1a1291cb81cad09a25499493e54c479898"></span>void <code class="descname">backward</code><span class="sig-paren">(</span><em class="property">const</em> <a class="reference internal" href="../../parameter/parameter/parameter.html#_CPPv2N6paddle14UpdateCallbackE" title="paddle::UpdateCallback">UpdateCallback</a> &amp;<em>callback</em><span class="sig-paren">)</span><a class="headerlink" href="#_CPPv2N6paddle25SequenceScatterAgentLayer8backwardERK14UpdateCallback" title="Permalink to this definition">¶</a></dt>
4350
<dd><p>Backward propagation. Should only be called after <a class="reference internal" href="#paddleclasspaddle_1_1Layer_1a12386b3f20dd731e7ceaa2c61667cbe1"><span class="std std-ref">Layer::forward()</span></a> function. </p>
Y
Yu Yang 已提交
4351 4352 4353
</dd></dl>

</div>
4354
<div class="breathe-sectiondef docutils container">
Y
Yu Yang 已提交
4355 4356 4357
<p class="breathe-sectiondef-title rubric">Protected Attributes</p>
<dl class="member">
<dt id="_CPPv2N6paddle25SequenceScatterAgentLayer14inputStartPos_E">
4358
<span id="paddle::SequenceScatterAgentLayer::inputStartPos___ICpuGpuVectorPtr"></span><span class="target" id="paddleclasspaddle_1_1SequenceScatterAgentLayer_1acfcf479183ea7b96c05968d2a5ce414e"></span><a class="reference internal" href="../../math/matrix/matrix.html#_CPPv2N6paddle16ICpuGpuVectorPtrE" title="paddle::ICpuGpuVectorPtr">ICpuGpuVectorPtr</a> <code class="descname">inputStartPos_</code><a class="headerlink" href="#_CPPv2N6paddle25SequenceScatterAgentLayer14inputStartPos_E" title="Permalink to this definition">¶</a></dt>
Y
Yu Yang 已提交
4359 4360 4361 4362 4363 4364 4365 4366 4367 4368 4369
<dd></dd></dl>

</div>
</dd></dl>

</div>
<div class="section" id="getoutputlayer">
<h2>GetOutputLayer<a class="headerlink" href="#getoutputlayer" title="Permalink to this headline">¶</a></h2>
<dl class="class">
<dt id="_CPPv2N6paddle14GetOutputLayerE">
<span id="paddle::GetOutputLayer"></span><span class="target" id="paddleclasspaddle_1_1GetOutputLayer"></span><em class="property">class </em><code class="descclassname">paddle::</code><code class="descname">GetOutputLayer</code><a class="headerlink" href="#_CPPv2N6paddle14GetOutputLayerE" title="Permalink to this definition">¶</a></dt>
4370
<dd><p>Inherits from <a class="reference internal" href="#paddleclasspaddle_1_1Layer"><span class="std std-ref">paddle::Layer</span></a></p>
4371
<div class="breathe-sectiondef docutils container">
Y
Yu Yang 已提交
4372 4373 4374 4375 4376 4377 4378 4379 4380 4381 4382 4383 4384
<p class="breathe-sectiondef-title rubric">Public Functions</p>
<dl class="function">
<dt id="_CPPv2N6paddle14GetOutputLayer14GetOutputLayerERK11LayerConfig">
<span id="paddle::GetOutputLayer::GetOutputLayer__LayerConfigCR"></span><span class="target" id="paddleclasspaddle_1_1GetOutputLayer_1a5b7da01b6b1a6d4240dc01ab16c38914"></span><code class="descname">GetOutputLayer</code><span class="sig-paren">(</span><em class="property">const</em> LayerConfig &amp;<em>config</em><span class="sig-paren">)</span><a class="headerlink" href="#_CPPv2N6paddle14GetOutputLayer14GetOutputLayerERK11LayerConfig" title="Permalink to this definition">¶</a></dt>
<dd></dd></dl>

<dl class="function">
<dt id="_CPPv2N6paddle14GetOutputLayerD0Ev">
<span id="paddle::GetOutputLayer::~GetOutputLayer"></span><span class="target" id="paddleclasspaddle_1_1GetOutputLayer_1acbfc6a85dd93684b6f1942133e50cd84"></span><code class="descname">~GetOutputLayer</code><span class="sig-paren">(</span><span class="sig-paren">)</span><a class="headerlink" href="#_CPPv2N6paddle14GetOutputLayerD0Ev" title="Permalink to this definition">¶</a></dt>
<dd></dd></dl>

<dl class="function">
<dt id="_CPPv2N6paddle14GetOutputLayer4initERK8LayerMapRK12ParameterMap">
4385
<span id="paddle::GetOutputLayer::init__LayerMapCR.ParameterMapCR"></span><span class="target" id="paddleclasspaddle_1_1GetOutputLayer_1ab0ba5351b7afb2c08b388cdc179f77a9"></span>bool <code class="descname">init</code><span class="sig-paren">(</span><em class="property">const</em> LayerMap &amp;<em>layerMap</em>, <em class="property">const</em> <a class="reference internal" href="../../parameter/parameter/parameter.html#_CPPv2N6paddle12ParameterMapE" title="paddle::ParameterMap">ParameterMap</a> &amp;<em>parameterMap</em><span class="sig-paren">)</span><a class="headerlink" href="#_CPPv2N6paddle14GetOutputLayer4initERK8LayerMapRK12ParameterMap" title="Permalink to this definition">¶</a></dt>
Y
Yu Yang 已提交
4386 4387 4388 4389 4390
<dd><p>Intialization. For example, adding input layers from layerMap and parameterMap. </p>
</dd></dl>

<dl class="function">
<dt id="_CPPv2N6paddle14GetOutputLayer7forwardE8PassType">
4391
<span id="paddle::GetOutputLayer::forward__PassType"></span><span class="target" id="paddleclasspaddle_1_1GetOutputLayer_1a53357e65c5fcd40f16b2f927a6613d81"></span>void <code class="descname">forward</code><span class="sig-paren">(</span>PassType <em>passType</em><span class="sig-paren">)</span><a class="headerlink" href="#_CPPv2N6paddle14GetOutputLayer7forwardE8PassType" title="Permalink to this definition">¶</a></dt>
Y
Yu Yang 已提交
4392 4393 4394 4395 4396
<dd><p>Forward propagation. All inherited implementation should call Layer::foward() function. </p>
</dd></dl>

<dl class="function">
<dt id="_CPPv2N6paddle14GetOutputLayer8backwardERK14UpdateCallback">
4397
<span id="paddle::GetOutputLayer::backward__UpdateCallbackCR"></span><span class="target" id="paddleclasspaddle_1_1GetOutputLayer_1ad5f8733aa949b46758079d8b9bae28b1"></span>void <code class="descname">backward</code><span class="sig-paren">(</span><em class="property">const</em> <a class="reference internal" href="../../parameter/parameter/parameter.html#_CPPv2N6paddle14UpdateCallbackE" title="paddle::UpdateCallback">UpdateCallback</a> &amp;<em>callback</em> = nullptr<span class="sig-paren">)</span><a class="headerlink" href="#_CPPv2N6paddle14GetOutputLayer8backwardERK14UpdateCallback" title="Permalink to this definition">¶</a></dt>
4398
<dd><p>Backward propagation. Should only be called after <a class="reference internal" href="#paddleclasspaddle_1_1Layer_1a12386b3f20dd731e7ceaa2c61667cbe1"><span class="std std-ref">Layer::forward()</span></a> function. </p>
Y
Yu Yang 已提交
4399 4400 4401 4402 4403 4404 4405 4406 4407 4408 4409 4410
</dd></dl>

</div>
</dd></dl>

</div>
</div>
<div class="section" id="mixed-layer">
<h1>Mixed Layer<a class="headerlink" href="#mixed-layer" title="Permalink to this headline">¶</a></h1>
<dl class="class">
<dt id="_CPPv2N6paddle10MixedLayerE">
<span id="paddle::MixedLayer"></span><span class="target" id="paddleclasspaddle_1_1MixedLayer"></span><em class="property">class </em><code class="descclassname">paddle::</code><code class="descname">MixedLayer</code><a class="headerlink" href="#_CPPv2N6paddle10MixedLayerE" title="Permalink to this definition">¶</a></dt>
4411
<dd><p>A mixed layer has multiple input layers. Each input layer was processed by a <a class="reference internal" href="#paddleclasspaddle_1_1Projection"><span class="std std-ref">Projection</span></a> or <a class="reference internal" href="#paddleclasspaddle_1_1Operator"><span class="std std-ref">Operator</span></a>. The results of all projections or Operators are summed together with bias (if configured), and then go through an activation function and dropout (if configured).</p>
Y
Yu Yang 已提交
4412
<p>The config file api is mixed_layer. </p>
4413
<p>Inherits from <a class="reference internal" href="#paddleclasspaddle_1_1Layer"><span class="std std-ref">paddle::Layer</span></a></p>
4414
<div class="breathe-sectiondef docutils container">
Y
Yu Yang 已提交
4415 4416 4417 4418 4419 4420 4421 4422 4423 4424 4425 4426 4427
<p class="breathe-sectiondef-title rubric">Public Functions</p>
<dl class="function">
<dt id="_CPPv2N6paddle10MixedLayer10MixedLayerERK11LayerConfig">
<span id="paddle::MixedLayer::MixedLayer__LayerConfigCR"></span><span class="target" id="paddleclasspaddle_1_1MixedLayer_1af86d58e20dec3fc15e6cd04229486498"></span><code class="descname">MixedLayer</code><span class="sig-paren">(</span><em class="property">const</em> LayerConfig &amp;<em>config</em><span class="sig-paren">)</span><a class="headerlink" href="#_CPPv2N6paddle10MixedLayer10MixedLayerERK11LayerConfig" title="Permalink to this definition">¶</a></dt>
<dd></dd></dl>

<dl class="function">
<dt id="_CPPv2N6paddle10MixedLayerD0Ev">
<span id="paddle::MixedLayer::~MixedLayer"></span><span class="target" id="paddleclasspaddle_1_1MixedLayer_1a5071ba59d16359015bcbf9652d1dc52c"></span><code class="descname">~MixedLayer</code><span class="sig-paren">(</span><span class="sig-paren">)</span><a class="headerlink" href="#_CPPv2N6paddle10MixedLayerD0Ev" title="Permalink to this definition">¶</a></dt>
<dd></dd></dl>

<dl class="function">
<dt id="_CPPv2N6paddle10MixedLayer4initERK8LayerMapRK12ParameterMap">
4428
<span id="paddle::MixedLayer::init__LayerMapCR.ParameterMapCR"></span><span class="target" id="paddleclasspaddle_1_1MixedLayer_1aa45bffbcfe1ce64272a3332d736d111b"></span>bool <code class="descname">init</code><span class="sig-paren">(</span><em class="property">const</em> LayerMap &amp;<em>layerMap</em>, <em class="property">const</em> <a class="reference internal" href="../../parameter/parameter/parameter.html#_CPPv2N6paddle12ParameterMapE" title="paddle::ParameterMap">ParameterMap</a> &amp;<em>parameterMap</em><span class="sig-paren">)</span><a class="headerlink" href="#_CPPv2N6paddle10MixedLayer4initERK8LayerMapRK12ParameterMap" title="Permalink to this definition">¶</a></dt>
Y
Yu Yang 已提交
4429 4430 4431 4432 4433
<dd><p>Intialization. For example, adding input layers from layerMap and parameterMap. </p>
</dd></dl>

<dl class="function">
<dt id="_CPPv2N6paddle10MixedLayer8prefetchEv">
4434
<span id="paddle::MixedLayer::prefetch"></span><span class="target" id="paddleclasspaddle_1_1MixedLayer_1a99872128ac07e93c73bbc042fd937714"></span>void <code class="descname">prefetch</code><span class="sig-paren">(</span><span class="sig-paren">)</span><a class="headerlink" href="#_CPPv2N6paddle10MixedLayer8prefetchEv" title="Permalink to this definition">¶</a></dt>
Y
Yu Yang 已提交
4435 4436 4437 4438 4439
<dd><p>If use sparse row matrix as parameter, prefetch feature ids in input label. </p>
</dd></dl>

<dl class="function">
<dt id="_CPPv2N6paddle10MixedLayer7forwardE8PassType">
4440
<span id="paddle::MixedLayer::forward__PassType"></span><span class="target" id="paddleclasspaddle_1_1MixedLayer_1ae6dee301640e9ed6e089bb4106e774ca"></span>void <code class="descname">forward</code><span class="sig-paren">(</span>PassType <em>passType</em><span class="sig-paren">)</span><a class="headerlink" href="#_CPPv2N6paddle10MixedLayer7forwardE8PassType" title="Permalink to this definition">¶</a></dt>
Y
Yu Yang 已提交
4441 4442 4443 4444 4445
<dd><p>Forward propagation. All inherited implementation should call Layer::foward() function. </p>
</dd></dl>

<dl class="function">
<dt id="_CPPv2N6paddle10MixedLayer8backwardERK14UpdateCallback">
4446
<span id="paddle::MixedLayer::backward__UpdateCallbackCR"></span><span class="target" id="paddleclasspaddle_1_1MixedLayer_1acb085ef5d6fa828f7059df4b0254e604"></span>void <code class="descname">backward</code><span class="sig-paren">(</span><em class="property">const</em> <a class="reference internal" href="../../parameter/parameter/parameter.html#_CPPv2N6paddle14UpdateCallbackE" title="paddle::UpdateCallback">UpdateCallback</a> &amp;<em>callback</em> = nullptr<span class="sig-paren">)</span><a class="headerlink" href="#_CPPv2N6paddle10MixedLayer8backwardERK14UpdateCallback" title="Permalink to this definition">¶</a></dt>
4447
<dd><p>Backward propagation. Should only be called after <a class="reference internal" href="#paddleclasspaddle_1_1Layer_1a12386b3f20dd731e7ceaa2c61667cbe1"><span class="std std-ref">Layer::forward()</span></a> function. </p>
Y
Yu Yang 已提交
4448 4449 4450 4451
</dd></dl>

<dl class="function">
<dt id="_CPPv2N6paddle10MixedLayer10resetStateEv">
4452
<span id="paddle::MixedLayer::resetState"></span><span class="target" id="paddleclasspaddle_1_1MixedLayer_1acf0ba9aa0745db69b3acae559760500f"></span>void <code class="descname">resetState</code><span class="sig-paren">(</span><span class="sig-paren">)</span><a class="headerlink" href="#_CPPv2N6paddle10MixedLayer10resetStateEv" title="Permalink to this definition">¶</a></dt>
4453 4454
<dd><p>Reset the internal state variables. Allocate them if they have not been allocated. This function need to called before <a class="reference internal" href="#paddleclasspaddle_1_1Layer_1a12386b3f20dd731e7ceaa2c61667cbe1"><span class="std std-ref">Layer::forward()</span></a> for generating sequence.</p>
<p>This is used for sequence generation. When generating sequence, the calculation at current timestamp depends on the state from previous timestamp. The model needs to keep the information about the previous timestamp in the state variables. Layers such as <a class="reference internal" href="#paddleclasspaddle_1_1RecurrentLayer"><span class="std std-ref">RecurrentLayer</span></a>, <a class="reference internal" href="#paddleclasspaddle_1_1LstmLayer"><span class="std std-ref">LstmLayer</span></a> and ContextLayer have state variables. </p>
Y
Yu Yang 已提交
4455 4456 4457 4458
</dd></dl>

<dl class="function">
<dt id="_CPPv2N6paddle10MixedLayer8setStateE13LayerStatePtr">
4459
<span id="paddle::MixedLayer::setState__LayerStatePtr"></span><span class="target" id="paddleclasspaddle_1_1MixedLayer_1a5579240e96b3cd8908598869f366dd08"></span>void <code class="descname">setState</code><span class="sig-paren">(</span>LayerStatePtr <em>state</em><span class="sig-paren">)</span><a class="headerlink" href="#_CPPv2N6paddle10MixedLayer8setStateE13LayerStatePtr" title="Permalink to this definition">¶</a></dt>
4460
<dd><p><a class="reference internal" href="#paddleclasspaddle_1_1MixedLayer_1a5579240e96b3cd8908598869f366dd08"><span class="std std-ref">setState()</span></a> should be called after <a class="reference internal" href="#paddleclasspaddle_1_1MixedLayer_1a4f27014678d54c3fa6e909550562b0e8"><span class="std std-ref">getState()</span></a>. <a class="reference internal" href="../../parameter/parameter/parameter.html#paddlestructpaddle_1_1Argument"><span class="std std-ref">Argument</span></a> state consists of all projections states. </p>
Y
Yu Yang 已提交
4461 4462 4463 4464
</dd></dl>

<dl class="function">
<dt id="_CPPv2N6paddle10MixedLayer8getStateEv">
4465
<span id="paddle::MixedLayer::getState"></span><span class="target" id="paddleclasspaddle_1_1MixedLayer_1a4f27014678d54c3fa6e909550562b0e8"></span>LayerStatePtr <code class="descname">getState</code><span class="sig-paren">(</span><span class="sig-paren">)</span><a class="headerlink" href="#_CPPv2N6paddle10MixedLayer8getStateEv" title="Permalink to this definition">¶</a></dt>
Y
Yu Yang 已提交
4466 4467 4468 4469
<dd><p>Return state which consists of all projections states. </p>
</dd></dl>

</div>
4470
<div class="breathe-sectiondef docutils container">
Y
Yu Yang 已提交
4471 4472 4473 4474 4475 4476 4477 4478 4479 4480 4481 4482 4483 4484 4485 4486 4487 4488 4489 4490 4491 4492
<p class="breathe-sectiondef-title rubric">Protected Attributes</p>
<dl class="member">
<dt id="_CPPv2N6paddle10MixedLayer12projections_E">
<span id="paddle::MixedLayer::projections___std::vector:std::unique_ptr:Projection::"></span><span class="target" id="paddleclasspaddle_1_1MixedLayer_1ac0e8ea87683d582f3a60127b3a3611e7"></span>std::vector&lt;std::unique_ptr&lt;<a class="reference internal" href="#_CPPv2N6paddle10ProjectionE" title="paddle::Projection">Projection</a>&gt;&gt; <code class="descname">projections_</code><a class="headerlink" href="#_CPPv2N6paddle10MixedLayer12projections_E" title="Permalink to this definition">¶</a></dt>
<dd></dd></dl>

<dl class="member">
<dt id="_CPPv2N6paddle10MixedLayer10operators_E">
<span id="paddle::MixedLayer::operators___std::vector:std::unique_ptr:Operator::"></span><span class="target" id="paddleclasspaddle_1_1MixedLayer_1aee6cd5143f06a1f4356847e7afb5dfd6"></span>std::vector&lt;std::unique_ptr&lt;<a class="reference internal" href="#_CPPv2N6paddle8OperatorE" title="paddle::Operator">Operator</a>&gt;&gt; <code class="descname">operators_</code><a class="headerlink" href="#_CPPv2N6paddle10MixedLayer10operators_E" title="Permalink to this definition">¶</a></dt>
<dd></dd></dl>

<dl class="member">
<dt id="_CPPv2N6paddle10MixedLayer26projectionStateMatrixSize_E">
<span id="paddle::MixedLayer::projectionStateMatrixSize___std::vector:i:"></span><span class="target" id="paddleclasspaddle_1_1MixedLayer_1a861abe64af262c28b5180e013d7ac394"></span>std::vector&lt;int&gt; <code class="descname">projectionStateMatrixSize_</code><a class="headerlink" href="#_CPPv2N6paddle10MixedLayer26projectionStateMatrixSize_E" title="Permalink to this definition">¶</a></dt>
<dd><p>the matrix size of projection state </p>
</dd></dl>

<dl class="member">
<dt id="_CPPv2N6paddle10MixedLayer7biases_E">
<span id="paddle::MixedLayer::biases___std::unique_ptr:Weight:"></span><span class="target" id="paddleclasspaddle_1_1MixedLayer_1afa712f4fb96124f1fd7512e4b48b0662"></span>std::unique_ptr&lt;<a class="reference internal" href="../../parameter/parameter/parameter.html#_CPPv2N6paddle6WeightE" title="paddle::Weight">Weight</a>&gt; <code class="descname">biases_</code><a class="headerlink" href="#_CPPv2N6paddle10MixedLayer7biases_E" title="Permalink to this definition">¶</a></dt>
<dd></dd></dl>

4493 4494 4495 4496 4497
<dl class="member">
<dt id="_CPPv2N6paddle10MixedLayer11sharedBias_E">
<span id="paddle::MixedLayer::sharedBias___b"></span><span class="target" id="paddleclasspaddle_1_1MixedLayer_1a51db7a9c897eb8ea0ab1c6b7d50d4322"></span>bool <code class="descname">sharedBias_</code><a class="headerlink" href="#_CPPv2N6paddle10MixedLayer11sharedBias_E" title="Permalink to this definition">¶</a></dt>
<dd></dd></dl>

Y
Yu Yang 已提交
4498 4499 4500 4501 4502 4503 4504 4505
</div>
</dd></dl>

<div class="section" id="dotmulprojection">
<h2>DotMulProjection<a class="headerlink" href="#dotmulprojection" title="Permalink to this headline">¶</a></h2>
<dl class="class">
<dt id="_CPPv2N6paddle16DotMulProjectionE">
<span id="paddle::DotMulProjection"></span><span class="target" id="paddleclasspaddle_1_1DotMulProjection"></span><em class="property">class </em><code class="descclassname">paddle::</code><code class="descname">DotMulProjection</code><a class="headerlink" href="#_CPPv2N6paddle16DotMulProjectionE" title="Permalink to this definition">¶</a></dt>
4506
<dd><p><a class="reference internal" href="#paddleclasspaddle_1_1DotMulProjection"><span class="std std-ref">DotMulProjection</span></a> performs element-wise multiplication with weight: <div class="math">
Y
Yu Yang 已提交
4507 4508 4509
\[ out.row[i] += in.row[i] .* weight \]</div>
 where <span class="math">\(.*\)</span> means element-wise multiplication.</p>
<p>The config file api is dotmul_projection. </p>
4510
<p>Inherits from <a class="reference internal" href="#paddleclasspaddle_1_1Projection"><span class="std std-ref">paddle::Projection</span></a></p>
4511
<div class="breathe-sectiondef docutils container">
Y
Yu Yang 已提交
4512 4513 4514 4515 4516 4517 4518 4519
<p class="breathe-sectiondef-title rubric">Public Functions</p>
<dl class="function">
<dt id="_CPPv2N6paddle16DotMulProjection16DotMulProjectionERK16ProjectionConfigRK12ParameterPtrb">
<span id="paddle::DotMulProjection::DotMulProjection__ProjectionConfigCR.ParameterPtrCR.b"></span><span class="target" id="paddleclasspaddle_1_1DotMulProjection_1a34daa523b82609f234055c521f95b33a"></span><code class="descname">DotMulProjection</code><span class="sig-paren">(</span><em class="property">const</em> ProjectionConfig &amp;<em>config</em>, <em class="property">const</em> <a class="reference internal" href="../../parameter/parameter/parameter.html#_CPPv2N6paddle12ParameterPtrE" title="paddle::ParameterPtr">ParameterPtr</a> &amp;<em>parameter</em>, bool <em>useGpu</em><span class="sig-paren">)</span><a class="headerlink" href="#_CPPv2N6paddle16DotMulProjection16DotMulProjectionERK16ProjectionConfigRK12ParameterPtrb" title="Permalink to this definition">¶</a></dt>
<dd></dd></dl>

<dl class="function">
<dt id="_CPPv2N6paddle16DotMulProjection7forwardEv">
4520
<span id="paddle::DotMulProjection::forward"></span><span class="target" id="paddleclasspaddle_1_1DotMulProjection_1a8c996d856be139effb9ddb69d3585678"></span>void <code class="descname">forward</code><span class="sig-paren">(</span><span class="sig-paren">)</span><a class="headerlink" href="#_CPPv2N6paddle16DotMulProjection7forwardEv" title="Permalink to this definition">¶</a></dt>
Y
Yu Yang 已提交
4521 4522 4523 4524
<dd></dd></dl>

<dl class="function">
<dt id="_CPPv2N6paddle16DotMulProjection8backwardERK14UpdateCallback">
4525
<span id="paddle::DotMulProjection::backward__UpdateCallbackCR"></span><span class="target" id="paddleclasspaddle_1_1DotMulProjection_1a8ec2144020f213cdfd4de3ce19a751cd"></span>void <code class="descname">backward</code><span class="sig-paren">(</span><em class="property">const</em> <a class="reference internal" href="../../parameter/parameter/parameter.html#_CPPv2N6paddle14UpdateCallbackE" title="paddle::UpdateCallback">UpdateCallback</a> &amp;<em>callback</em><span class="sig-paren">)</span><a class="headerlink" href="#_CPPv2N6paddle16DotMulProjection8backwardERK14UpdateCallback" title="Permalink to this definition">¶</a></dt>
Y
Yu Yang 已提交
4526 4527 4528
<dd></dd></dl>

</div>
4529
<div class="breathe-sectiondef docutils container">
Y
Yu Yang 已提交
4530 4531 4532 4533 4534 4535 4536 4537 4538 4539 4540 4541 4542 4543 4544 4545
<p class="breathe-sectiondef-title rubric">Protected Attributes</p>
<dl class="member">
<dt id="_CPPv2N6paddle16DotMulProjection7weight_E">
<span id="paddle::DotMulProjection::weight___std::unique_ptr:Weight:"></span><span class="target" id="paddleclasspaddle_1_1DotMulProjection_1a1a6abc3c67a7f339cb94d32df34c50ec"></span>std::unique_ptr&lt;<a class="reference internal" href="../../parameter/parameter/parameter.html#_CPPv2N6paddle6WeightE" title="paddle::Weight">Weight</a>&gt; <code class="descname">weight_</code><a class="headerlink" href="#_CPPv2N6paddle16DotMulProjection7weight_E" title="Permalink to this definition">¶</a></dt>
<dd><p>shared memory with parameter </p>
</dd></dl>

</div>
</dd></dl>

</div>
<div class="section" id="dotmuloperator">
<h2>DotMulOperator<a class="headerlink" href="#dotmuloperator" title="Permalink to this headline">¶</a></h2>
<dl class="class">
<dt id="_CPPv2N6paddle14DotMulOperatorE">
<span id="paddle::DotMulOperator"></span><span class="target" id="paddleclasspaddle_1_1DotMulOperator"></span><em class="property">class </em><code class="descclassname">paddle::</code><code class="descname">DotMulOperator</code><a class="headerlink" href="#_CPPv2N6paddle14DotMulOperatorE" title="Permalink to this definition">¶</a></dt>
4546
<dd><p><a class="reference internal" href="#paddleclasspaddle_1_1DotMulOperator"><span class="std std-ref">DotMulOperator</span></a> takes two inputs, performs element-wise multiplication: <div class="math">
Y
Yu Yang 已提交
4547 4548 4549
\[ out.row[i] += scale * (in1.row[i] .* in2.row[i]) \]</div>
 where <span class="math">\(.*\)</span> means element-wise multiplication, and scale is a config scalar, its default value is one.</p>
<p>The config file api is dotmul_operator. </p>
4550
<p>Inherits from <a class="reference internal" href="#paddleclasspaddle_1_1Operator"><span class="std std-ref">paddle::Operator</span></a></p>
4551
<div class="breathe-sectiondef docutils container">
Y
Yu Yang 已提交
4552 4553 4554 4555 4556 4557 4558 4559
<p class="breathe-sectiondef-title rubric">Public Functions</p>
<dl class="function">
<dt id="_CPPv2N6paddle14DotMulOperator14DotMulOperatorERK14OperatorConfigb">
<span id="paddle::DotMulOperator::DotMulOperator__OperatorConfigCR.b"></span><span class="target" id="paddleclasspaddle_1_1DotMulOperator_1a65f6b3c90c10dbe1860a420e95f4e029"></span><code class="descname">DotMulOperator</code><span class="sig-paren">(</span><em class="property">const</em> OperatorConfig &amp;<em>config</em>, bool <em>useGpu</em><span class="sig-paren">)</span><a class="headerlink" href="#_CPPv2N6paddle14DotMulOperator14DotMulOperatorERK14OperatorConfigb" title="Permalink to this definition">¶</a></dt>
<dd></dd></dl>

<dl class="function">
<dt id="_CPPv2N6paddle14DotMulOperator7forwardEv">
4560
<span id="paddle::DotMulOperator::forward"></span><span class="target" id="paddleclasspaddle_1_1DotMulOperator_1ae424ee175ef97428f53bb4d9f868d272"></span>void <code class="descname">forward</code><span class="sig-paren">(</span><span class="sig-paren">)</span><a class="headerlink" href="#_CPPv2N6paddle14DotMulOperator7forwardEv" title="Permalink to this definition">¶</a></dt>
Y
Yu Yang 已提交
4561 4562 4563 4564
<dd></dd></dl>

<dl class="function">
<dt id="_CPPv2N6paddle14DotMulOperator8backwardEv">
4565
<span id="paddle::DotMulOperator::backward"></span><span class="target" id="paddleclasspaddle_1_1DotMulOperator_1a6bd7763a1b5c2486681e496e5108cc52"></span>void <code class="descname">backward</code><span class="sig-paren">(</span><span class="sig-paren">)</span><a class="headerlink" href="#_CPPv2N6paddle14DotMulOperator8backwardEv" title="Permalink to this definition">¶</a></dt>
Y
Yu Yang 已提交
4566 4567 4568 4569 4570 4571 4572 4573 4574 4575 4576
<dd></dd></dl>

</div>
</dd></dl>

</div>
<div class="section" id="fullmatrixprojection">
<h2>FullMatrixProjection<a class="headerlink" href="#fullmatrixprojection" title="Permalink to this headline">¶</a></h2>
<dl class="class">
<dt id="_CPPv2N6paddle20FullMatrixProjectionE">
<span id="paddle::FullMatrixProjection"></span><span class="target" id="paddleclasspaddle_1_1FullMatrixProjection"></span><em class="property">class </em><code class="descclassname">paddle::</code><code class="descname">FullMatrixProjection</code><a class="headerlink" href="#_CPPv2N6paddle20FullMatrixProjectionE" title="Permalink to this definition">¶</a></dt>
4577
<dd><p><a class="reference internal" href="#paddleclasspaddle_1_1FullMatrixProjection"><span class="std std-ref">FullMatrixProjection</span></a> performs full matrix multiplication: <div class="math">
Y
Yu Yang 已提交
4578 4579 4580
\[ out.row[i] += in.row[i] * weight \]</div>
</p>
<p>The config file api is full_matrix_projection. </p>
4581
<p>Inherits from <a class="reference internal" href="#paddleclasspaddle_1_1Projection"><span class="std std-ref">paddle::Projection</span></a></p>
4582
<div class="breathe-sectiondef docutils container">
Y
Yu Yang 已提交
4583 4584 4585 4586 4587 4588 4589 4590
<p class="breathe-sectiondef-title rubric">Public Functions</p>
<dl class="function">
<dt id="_CPPv2N6paddle20FullMatrixProjection20FullMatrixProjectionERK16ProjectionConfigRK12ParameterPtrb">
<span id="paddle::FullMatrixProjection::FullMatrixProjection__ProjectionConfigCR.ParameterPtrCR.b"></span><span class="target" id="paddleclasspaddle_1_1FullMatrixProjection_1a5177a9faeb979e1c7c6d2cd4c17bdccc"></span><code class="descname">FullMatrixProjection</code><span class="sig-paren">(</span><em class="property">const</em> ProjectionConfig &amp;<em>config</em>, <em class="property">const</em> <a class="reference internal" href="../../parameter/parameter/parameter.html#_CPPv2N6paddle12ParameterPtrE" title="paddle::ParameterPtr">ParameterPtr</a> &amp;<em>parameter</em>, bool <em>useGpu</em><span class="sig-paren">)</span><a class="headerlink" href="#_CPPv2N6paddle20FullMatrixProjection20FullMatrixProjectionERK16ProjectionConfigRK12ParameterPtrb" title="Permalink to this definition">¶</a></dt>
<dd></dd></dl>

<dl class="function">
<dt id="_CPPv2N6paddle20FullMatrixProjection7forwardEv">
4591
<span id="paddle::FullMatrixProjection::forward"></span><span class="target" id="paddleclasspaddle_1_1FullMatrixProjection_1aa2ac3051f7907351c76e1ccd4d9e6c85"></span>void <code class="descname">forward</code><span class="sig-paren">(</span><span class="sig-paren">)</span><a class="headerlink" href="#_CPPv2N6paddle20FullMatrixProjection7forwardEv" title="Permalink to this definition">¶</a></dt>
Y
Yu Yang 已提交
4592 4593 4594 4595
<dd></dd></dl>

<dl class="function">
<dt id="_CPPv2N6paddle20FullMatrixProjection8backwardERK14UpdateCallback">
4596
<span id="paddle::FullMatrixProjection::backward__UpdateCallbackCR"></span><span class="target" id="paddleclasspaddle_1_1FullMatrixProjection_1ab9cb2080b96b4f30c6f6c302abedb2be"></span>void <code class="descname">backward</code><span class="sig-paren">(</span><em class="property">const</em> <a class="reference internal" href="../../parameter/parameter/parameter.html#_CPPv2N6paddle14UpdateCallbackE" title="paddle::UpdateCallback">UpdateCallback</a> &amp;<em>callback</em><span class="sig-paren">)</span><a class="headerlink" href="#_CPPv2N6paddle20FullMatrixProjection8backwardERK14UpdateCallback" title="Permalink to this definition">¶</a></dt>
Y
Yu Yang 已提交
4597 4598 4599
<dd></dd></dl>

</div>
4600
<div class="breathe-sectiondef docutils container">
Y
Yu Yang 已提交
4601 4602 4603 4604 4605 4606 4607 4608 4609 4610 4611 4612 4613 4614 4615
<p class="breathe-sectiondef-title rubric">Protected Attributes</p>
<dl class="member">
<dt id="_CPPv2N6paddle20FullMatrixProjection7weight_E">
<span id="paddle::FullMatrixProjection::weight___std::unique_ptr:Weight:"></span><span class="target" id="paddleclasspaddle_1_1FullMatrixProjection_1a24121bc70120030e16d5d391b25b2005"></span>std::unique_ptr&lt;<a class="reference internal" href="../../parameter/parameter/parameter.html#_CPPv2N6paddle6WeightE" title="paddle::Weight">Weight</a>&gt; <code class="descname">weight_</code><a class="headerlink" href="#_CPPv2N6paddle20FullMatrixProjection7weight_E" title="Permalink to this definition">¶</a></dt>
<dd></dd></dl>

</div>
</dd></dl>

</div>
<div class="section" id="identityprojection">
<h2>IdentityProjection<a class="headerlink" href="#identityprojection" title="Permalink to this headline">¶</a></h2>
<dl class="class">
<dt id="_CPPv2N6paddle18IdentityProjectionE">
<span id="paddle::IdentityProjection"></span><span class="target" id="paddleclasspaddle_1_1IdentityProjection"></span><em class="property">class </em><code class="descclassname">paddle::</code><code class="descname">IdentityProjection</code><a class="headerlink" href="#_CPPv2N6paddle18IdentityProjectionE" title="Permalink to this definition">¶</a></dt>
4616
<dd><p><a class="reference internal" href="#paddleclasspaddle_1_1IdentityProjection"><span class="std std-ref">IdentityProjection</span></a> performs addition: <div class="math">
Y
Yu Yang 已提交
4617 4618 4619
\[ out.row[i] += in.row[i] \]</div>
</p>
<p>The config file api is identity_projection. </p>
4620
<p>Inherits from <a class="reference internal" href="#paddleclasspaddle_1_1Projection"><span class="std std-ref">paddle::Projection</span></a></p>
4621
<div class="breathe-sectiondef docutils container">
Y
Yu Yang 已提交
4622 4623 4624 4625 4626 4627
<p class="breathe-sectiondef-title rubric">Public Functions</p>
<dl class="function">
<dt id="_CPPv2N6paddle18IdentityProjection18IdentityProjectionERK16ProjectionConfigRK12ParameterPtrb">
<span id="paddle::IdentityProjection::IdentityProjection__ProjectionConfigCR.ParameterPtrCR.b"></span><span class="target" id="paddleclasspaddle_1_1IdentityProjection_1a345af15e606d43e337d48862c65fb2cd"></span><code class="descname">IdentityProjection</code><span class="sig-paren">(</span><em class="property">const</em> ProjectionConfig &amp;<em>config</em>, <em class="property">const</em> <a class="reference internal" href="../../parameter/parameter/parameter.html#_CPPv2N6paddle12ParameterPtrE" title="paddle::ParameterPtr">ParameterPtr</a> &amp;<em>parameter</em>, bool <em>useGpu</em><span class="sig-paren">)</span><a class="headerlink" href="#_CPPv2N6paddle18IdentityProjection18IdentityProjectionERK16ProjectionConfigRK12ParameterPtrb" title="Permalink to this definition">¶</a></dt>
<dd><p>Constructed function. <dl class="docutils">
<dt><strong>Note</strong></dt>
4628
<dd><a class="reference internal" href="#paddleclasspaddle_1_1IdentityProjection"><span class="std std-ref">IdentityProjection</span></a> should not have any parameter. </dd>
Y
Yu Yang 已提交
4629 4630 4631 4632 4633 4634
</dl>
</p>
</dd></dl>

<dl class="function">
<dt id="_CPPv2N6paddle18IdentityProjection7forwardEv">
4635
<span id="paddle::IdentityProjection::forward"></span><span class="target" id="paddleclasspaddle_1_1IdentityProjection_1aaeedf5150116924ed25a521ccb62eae7"></span>void <code class="descname">forward</code><span class="sig-paren">(</span><span class="sig-paren">)</span><a class="headerlink" href="#_CPPv2N6paddle18IdentityProjection7forwardEv" title="Permalink to this definition">¶</a></dt>
Y
Yu Yang 已提交
4636 4637 4638 4639
<dd></dd></dl>

<dl class="function">
<dt id="_CPPv2N6paddle18IdentityProjection8backwardERK14UpdateCallback">
4640
<span id="paddle::IdentityProjection::backward__UpdateCallbackCR"></span><span class="target" id="paddleclasspaddle_1_1IdentityProjection_1aede7505a3781333c0dc3e10184a8ee68"></span>void <code class="descname">backward</code><span class="sig-paren">(</span><em class="property">const</em> <a class="reference internal" href="../../parameter/parameter/parameter.html#_CPPv2N6paddle14UpdateCallbackE" title="paddle::UpdateCallback">UpdateCallback</a> &amp;<em>callback</em><span class="sig-paren">)</span><a class="headerlink" href="#_CPPv2N6paddle18IdentityProjection8backwardERK14UpdateCallback" title="Permalink to this definition">¶</a></dt>
Y
Yu Yang 已提交
4641 4642 4643 4644 4645 4646 4647 4648 4649 4650 4651
<dd></dd></dl>

</div>
</dd></dl>

</div>
<div class="section" id="identityoffsetprojection">
<h2>IdentityOffsetProjection<a class="headerlink" href="#identityoffsetprojection" title="Permalink to this headline">¶</a></h2>
<dl class="class">
<dt id="_CPPv2N6paddle24IdentityOffsetProjectionE">
<span id="paddle::IdentityOffsetProjection"></span><span class="target" id="paddleclasspaddle_1_1IdentityOffsetProjection"></span><em class="property">class </em><code class="descclassname">paddle::</code><code class="descname">IdentityOffsetProjection</code><a class="headerlink" href="#_CPPv2N6paddle24IdentityOffsetProjectionE" title="Permalink to this definition">¶</a></dt>
4652
<dd><p><a class="reference internal" href="#paddleclasspaddle_1_1IdentityOffsetProjection"><span class="std std-ref">IdentityOffsetProjection</span></a> likes <a class="reference internal" href="#paddleclasspaddle_1_1IdentityProjection"><span class="std std-ref">IdentityProjection</span></a>, but layer size may be smaller than input size. It selects dimensions [offset, offset+layer_size) from input to perform addition: <div class="math">
Y
Yu Yang 已提交
4653 4654 4655
\[ out.row[i] += in.row[i + \textrm{offset}] \]</div>
</p>
<p>The config file api is identity_projection. </p>
4656
<p>Inherits from <a class="reference internal" href="#paddleclasspaddle_1_1Projection"><span class="std std-ref">paddle::Projection</span></a></p>
4657
<div class="breathe-sectiondef docutils container">
Y
Yu Yang 已提交
4658 4659 4660 4661 4662 4663
<p class="breathe-sectiondef-title rubric">Public Functions</p>
<dl class="function">
<dt id="_CPPv2N6paddle24IdentityOffsetProjection24IdentityOffsetProjectionERK16ProjectionConfigRK12ParameterPtrb">
<span id="paddle::IdentityOffsetProjection::IdentityOffsetProjection__ProjectionConfigCR.ParameterPtrCR.b"></span><span class="target" id="paddleclasspaddle_1_1IdentityOffsetProjection_1a0f9c91d8d113d0a3f405a6c8bdab3484"></span><code class="descname">IdentityOffsetProjection</code><span class="sig-paren">(</span><em class="property">const</em> ProjectionConfig &amp;<em>config</em>, <em class="property">const</em> <a class="reference internal" href="../../parameter/parameter/parameter.html#_CPPv2N6paddle12ParameterPtrE" title="paddle::ParameterPtr">ParameterPtr</a> &amp;<em>parameter</em>, bool <em>useGpu</em><span class="sig-paren">)</span><a class="headerlink" href="#_CPPv2N6paddle24IdentityOffsetProjection24IdentityOffsetProjectionERK16ProjectionConfigRK12ParameterPtrb" title="Permalink to this definition">¶</a></dt>
<dd><p>Constructed function. <dl class="docutils">
<dt><strong>Note</strong></dt>
4664
<dd><a class="reference internal" href="#paddleclasspaddle_1_1IdentityOffsetProjection"><span class="std std-ref">IdentityOffsetProjection</span></a> should not have any parameter. </dd>
Y
Yu Yang 已提交
4665 4666 4667 4668 4669 4670
</dl>
</p>
</dd></dl>

<dl class="function">
<dt id="_CPPv2N6paddle24IdentityOffsetProjection7forwardEv">
4671
<span id="paddle::IdentityOffsetProjection::forward"></span><span class="target" id="paddleclasspaddle_1_1IdentityOffsetProjection_1a0b89e89c1fe93e1e76484c2a6d91cf1f"></span>void <code class="descname">forward</code><span class="sig-paren">(</span><span class="sig-paren">)</span><a class="headerlink" href="#_CPPv2N6paddle24IdentityOffsetProjection7forwardEv" title="Permalink to this definition">¶</a></dt>
Y
Yu Yang 已提交
4672 4673 4674 4675
<dd></dd></dl>

<dl class="function">
<dt id="_CPPv2N6paddle24IdentityOffsetProjection8backwardERK14UpdateCallback">
4676
<span id="paddle::IdentityOffsetProjection::backward__UpdateCallbackCR"></span><span class="target" id="paddleclasspaddle_1_1IdentityOffsetProjection_1ab10505d6111d8fdcff3051f113e6db41"></span>void <code class="descname">backward</code><span class="sig-paren">(</span><em class="property">const</em> <a class="reference internal" href="../../parameter/parameter/parameter.html#_CPPv2N6paddle14UpdateCallbackE" title="paddle::UpdateCallback">UpdateCallback</a> &amp;<em>callback</em><span class="sig-paren">)</span><a class="headerlink" href="#_CPPv2N6paddle24IdentityOffsetProjection8backwardERK14UpdateCallback" title="Permalink to this definition">¶</a></dt>
Y
Yu Yang 已提交
4677 4678 4679 4680 4681 4682 4683 4684 4685 4686 4687 4688 4689 4690 4691 4692 4693 4694 4695 4696
<dd></dd></dl>

</div>
</dd></dl>

</div>
<div class="section" id="tableprojection">
<h2>TableProjection<a class="headerlink" href="#tableprojection" title="Permalink to this headline">¶</a></h2>
<dl class="class">
<dt id="_CPPv2N6paddle15TableProjectionE">
<span id="paddle::TableProjection"></span><span class="target" id="paddleclasspaddle_1_1TableProjection"></span><em class="property">class </em><code class="descclassname">paddle::</code><code class="descname">TableProjection</code><a class="headerlink" href="#_CPPv2N6paddle15TableProjectionE" title="Permalink to this definition">¶</a></dt>
<dd><p>Table projection takes index data input. It select rows from parameter where row_id is in input_ids: <div class="math">
\[ out.row[i] += table.row[ids[i]] \]</div>
 where <span class="math">\(out\)</span> is out, <span class="math">\(table\)</span> is parameter, <span class="math">\(ids\)</span> is input_ids, and <span class="math">\(i\)</span> is row_id.</p>
<p>The config file api is table_projection.</p>
<p><dl class="docutils">
<dt><strong>Note</strong></dt>
<dd>If <span class="math">\(ids[i] = -1\)</span>, it will be ignored. </dd>
</dl>
</p>
4697
<p>Inherits from <a class="reference internal" href="#paddleclasspaddle_1_1Projection"><span class="std std-ref">paddle::Projection</span></a></p>
4698
<div class="breathe-sectiondef docutils container">
Y
Yu Yang 已提交
4699 4700 4701 4702 4703 4704 4705 4706
<p class="breathe-sectiondef-title rubric">Public Functions</p>
<dl class="function">
<dt id="_CPPv2N6paddle15TableProjection15TableProjectionERK16ProjectionConfigRK12ParameterPtrb">
<span id="paddle::TableProjection::TableProjection__ProjectionConfigCR.ParameterPtrCR.b"></span><span class="target" id="paddleclasspaddle_1_1TableProjection_1a5cc0935584d7c61417b60d9bda164f59"></span><code class="descname">TableProjection</code><span class="sig-paren">(</span><em class="property">const</em> ProjectionConfig &amp;<em>config</em>, <em class="property">const</em> <a class="reference internal" href="../../parameter/parameter/parameter.html#_CPPv2N6paddle12ParameterPtrE" title="paddle::ParameterPtr">ParameterPtr</a> &amp;<em>parameter</em>, bool <em>useGpu</em><span class="sig-paren">)</span><a class="headerlink" href="#_CPPv2N6paddle15TableProjection15TableProjectionERK16ProjectionConfigRK12ParameterPtrb" title="Permalink to this definition">¶</a></dt>
<dd></dd></dl>

<dl class="function">
<dt id="_CPPv2N6paddle15TableProjection8prefetchEPK8Argument">
4707
<span id="paddle::TableProjection::prefetch__ArgumentCP"></span><span class="target" id="paddleclasspaddle_1_1TableProjection_1ae349432d32ee5db776bf69ca22c87c7f"></span>void <code class="descname">prefetch</code><span class="sig-paren">(</span><em class="property">const</em> <a class="reference internal" href="../../parameter/parameter/parameter.html#_CPPv2N6paddle8ArgumentE" title="paddle::Argument">Argument</a> *<em>in</em><span class="sig-paren">)</span><a class="headerlink" href="#_CPPv2N6paddle15TableProjection8prefetchEPK8Argument" title="Permalink to this definition">¶</a></dt>
Y
Yu Yang 已提交
4708 4709 4710 4711 4712
<dd><p>If use sparse row matrix as parameter, prefetch feature ids in input label. </p>
</dd></dl>

<dl class="function">
<dt id="_CPPv2N6paddle15TableProjection7forwardEv">
4713
<span id="paddle::TableProjection::forward"></span><span class="target" id="paddleclasspaddle_1_1TableProjection_1a5705524712f8dd81a5ed02ce8f9f127e"></span>void <code class="descname">forward</code><span class="sig-paren">(</span><span class="sig-paren">)</span><a class="headerlink" href="#_CPPv2N6paddle15TableProjection7forwardEv" title="Permalink to this definition">¶</a></dt>
Y
Yu Yang 已提交
4714 4715 4716 4717
<dd></dd></dl>

<dl class="function">
<dt id="_CPPv2N6paddle15TableProjection8backwardERK14UpdateCallback">
4718
<span id="paddle::TableProjection::backward__UpdateCallbackCR"></span><span class="target" id="paddleclasspaddle_1_1TableProjection_1a2740b4be2e18a2c40a32cb051d986bac"></span>void <code class="descname">backward</code><span class="sig-paren">(</span><em class="property">const</em> <a class="reference internal" href="../../parameter/parameter/parameter.html#_CPPv2N6paddle14UpdateCallbackE" title="paddle::UpdateCallback">UpdateCallback</a> &amp;<em>callback</em><span class="sig-paren">)</span><a class="headerlink" href="#_CPPv2N6paddle15TableProjection8backwardERK14UpdateCallback" title="Permalink to this definition">¶</a></dt>
Y
Yu Yang 已提交
4719 4720 4721
<dd></dd></dl>

</div>
4722
<div class="breathe-sectiondef docutils container">
Y
Yu Yang 已提交
4723 4724 4725 4726 4727 4728 4729 4730 4731 4732 4733 4734 4735 4736 4737
<p class="breathe-sectiondef-title rubric">Protected Attributes</p>
<dl class="member">
<dt id="_CPPv2N6paddle15TableProjection6table_E">
<span id="paddle::TableProjection::table___std::unique_ptr:Weight:"></span><span class="target" id="paddleclasspaddle_1_1TableProjection_1acade6c4301826a64079ae27ffb4720c0"></span>std::unique_ptr&lt;<a class="reference internal" href="../../parameter/parameter/parameter.html#_CPPv2N6paddle6WeightE" title="paddle::Weight">Weight</a>&gt; <code class="descname">table_</code><a class="headerlink" href="#_CPPv2N6paddle15TableProjection6table_E" title="Permalink to this definition">¶</a></dt>
<dd></dd></dl>

</div>
</dd></dl>

</div>
<div class="section" id="transposedfullmatrixprojection">
<h2>TransposedFullMatrixProjection<a class="headerlink" href="#transposedfullmatrixprojection" title="Permalink to this headline">¶</a></h2>
<dl class="class">
<dt id="_CPPv2N6paddle30TransposedFullMatrixProjectionE">
<span id="paddle::TransposedFullMatrixProjection"></span><span class="target" id="paddleclasspaddle_1_1TransposedFullMatrixProjection"></span><em class="property">class </em><code class="descclassname">paddle::</code><code class="descname">TransposedFullMatrixProjection</code><a class="headerlink" href="#_CPPv2N6paddle30TransposedFullMatrixProjectionE" title="Permalink to this definition">¶</a></dt>
4738
<dd><p><a class="reference internal" href="#paddleclasspaddle_1_1TransposedFullMatrixProjection"><span class="std std-ref">TransposedFullMatrixProjection</span></a> performs full matrix multiplication: out.row[i] += in.row[i] * weight.transpose. </p>
Y
Yu Yang 已提交
4739
<p>The config file api is trans_full_matrix_projection. </p>
4740
<p>Inherits from <a class="reference internal" href="#paddleclasspaddle_1_1Projection"><span class="std std-ref">paddle::Projection</span></a></p>
4741
<div class="breathe-sectiondef docutils container">
Y
Yu Yang 已提交
4742 4743 4744 4745 4746 4747 4748 4749
<p class="breathe-sectiondef-title rubric">Public Functions</p>
<dl class="function">
<dt id="_CPPv2N6paddle30TransposedFullMatrixProjection30TransposedFullMatrixProjectionERK16ProjectionConfig12ParameterPtrb">
<span id="paddle::TransposedFullMatrixProjection::TransposedFullMatrixProjection__ProjectionConfigCR.ParameterPtr.b"></span><span class="target" id="paddleclasspaddle_1_1TransposedFullMatrixProjection_1a3d469040cae2561ce4ddb00672d4bb8e"></span><code class="descname">TransposedFullMatrixProjection</code><span class="sig-paren">(</span><em class="property">const</em> ProjectionConfig &amp;<em>config</em>, <a class="reference internal" href="../../parameter/parameter/parameter.html#_CPPv2N6paddle12ParameterPtrE" title="paddle::ParameterPtr">ParameterPtr</a> <em>parameter</em>, bool <em>useGPu</em><span class="sig-paren">)</span><a class="headerlink" href="#_CPPv2N6paddle30TransposedFullMatrixProjection30TransposedFullMatrixProjectionERK16ProjectionConfig12ParameterPtrb" title="Permalink to this definition">¶</a></dt>
<dd></dd></dl>

<dl class="function">
<dt id="_CPPv2N6paddle30TransposedFullMatrixProjection7forwardEv">
4750
<span id="paddle::TransposedFullMatrixProjection::forward"></span><span class="target" id="paddleclasspaddle_1_1TransposedFullMatrixProjection_1a59864b8c9b17e585ce6208a76711589a"></span>void <code class="descname">forward</code><span class="sig-paren">(</span><span class="sig-paren">)</span><a class="headerlink" href="#_CPPv2N6paddle30TransposedFullMatrixProjection7forwardEv" title="Permalink to this definition">¶</a></dt>
Y
Yu Yang 已提交
4751 4752 4753 4754
<dd></dd></dl>

<dl class="function">
<dt id="_CPPv2N6paddle30TransposedFullMatrixProjection8backwardERK14UpdateCallback">
4755
<span id="paddle::TransposedFullMatrixProjection::backward__UpdateCallbackCR"></span><span class="target" id="paddleclasspaddle_1_1TransposedFullMatrixProjection_1a2f26d55a0bf07e9fab2e7d7de82c276c"></span>void <code class="descname">backward</code><span class="sig-paren">(</span><em class="property">const</em> <a class="reference internal" href="../../parameter/parameter/parameter.html#_CPPv2N6paddle14UpdateCallbackE" title="paddle::UpdateCallback">UpdateCallback</a> &amp;<em>callback</em><span class="sig-paren">)</span><a class="headerlink" href="#_CPPv2N6paddle30TransposedFullMatrixProjection8backwardERK14UpdateCallback" title="Permalink to this definition">¶</a></dt>
Y
Yu Yang 已提交
4756 4757 4758
<dd></dd></dl>

</div>
4759
<div class="breathe-sectiondef docutils container">
Y
Yu Yang 已提交
4760 4761 4762 4763 4764 4765 4766 4767 4768 4769 4770 4771 4772 4773 4774 4775 4776 4777 4778 4779
<p class="breathe-sectiondef-title rubric">Protected Attributes</p>
<dl class="member">
<dt id="_CPPv2N6paddle30TransposedFullMatrixProjection7weight_E">
<span id="paddle::TransposedFullMatrixProjection::weight___std::unique_ptr:Weight:"></span><span class="target" id="paddleclasspaddle_1_1TransposedFullMatrixProjection_1acf4fec18d4ff7d0acb75b3d7328e30a2"></span>std::unique_ptr&lt;<a class="reference internal" href="../../parameter/parameter/parameter.html#_CPPv2N6paddle6WeightE" title="paddle::Weight">Weight</a>&gt; <code class="descname">weight_</code><a class="headerlink" href="#_CPPv2N6paddle30TransposedFullMatrixProjection7weight_E" title="Permalink to this definition">¶</a></dt>
<dd></dd></dl>

</div>
</dd></dl>

</div>
</div>
<div class="section" id="aggregate-layers">
<h1>Aggregate Layers<a class="headerlink" href="#aggregate-layers" title="Permalink to this headline">¶</a></h1>
<div class="section" id="aggregate">
<h2>Aggregate<a class="headerlink" href="#aggregate" title="Permalink to this headline">¶</a></h2>
<div class="section" id="averagelayer">
<h3>AverageLayer<a class="headerlink" href="#averagelayer" title="Permalink to this headline">¶</a></h3>
<dl class="class">
<dt id="_CPPv2N6paddle12AverageLayerE">
<span id="paddle::AverageLayer"></span><span class="target" id="paddleclasspaddle_1_1AverageLayer"></span><em class="property">class </em><code class="descclassname">paddle::</code><code class="descname">AverageLayer</code><a class="headerlink" href="#_CPPv2N6paddle12AverageLayerE" title="Permalink to this definition">¶</a></dt>
4780 4781 4782
<dd><p>A layer for &#8220;internal average&#8221; for sequence input. Input: one or more sequences. Each sequence contains some instances. If SequenceLevel = kNonSeq: Output: output size is the number of input sequences (NOT input instances) output[i] = average_{for each instance in this sequence}{input[i]} If SequenceLevel = kSeq: Check input sequence must has sub-sequence Output: output size is the number of input sub-sequences output[i] = average_{for each instance in this sub-sequence}{input[i]}</p>
<p>The config file api is pooling_layer. </p>
<p>Inherits from paddle::SequencePoolLayer</p>
4783
<div class="breathe-sectiondef docutils container">
Y
Yu Yang 已提交
4784 4785 4786 4787 4788 4789 4790 4791 4792 4793 4794 4795 4796 4797 4798 4799 4800 4801 4802 4803 4804 4805 4806
<p class="breathe-sectiondef-title rubric">Public Types</p>
<dl class="type">
<dt id="_CPPv2N6paddle12AverageLayer15AverageStrategyE">
<span id="paddle::AverageLayer::AverageStrategy"></span><span class="target" id="paddleclasspaddle_1_1AverageLayer_1aa26f5a4f7be61eaf8dfc44c16b943e4c"></span><em class="property">enum </em><code class="descname">AverageStrategy</code><a class="headerlink" href="#_CPPv2N6paddle12AverageLayer15AverageStrategyE" title="Permalink to this definition">¶</a></dt>
<dd><p><em>Values:</em></p>
<dl class="member">
<dt id="_CPPv2N6paddle12AverageLayer8kAverageE">
<span id="paddle::AverageLayer::kAverage"></span><span class="target" id="paddleclasspaddle_1_1AverageLayer_1aa26f5a4f7be61eaf8dfc44c16b943e4ca2aa761522f585922691ba60f37cbb1a9"></span><code class="descname">kAverage</code> = 0<a class="headerlink" href="#_CPPv2N6paddle12AverageLayer8kAverageE" title="Permalink to this definition">¶</a></dt>
<dd></dd></dl>

<dl class="member">
<dt id="_CPPv2N6paddle12AverageLayer4kSumE">
<span id="paddle::AverageLayer::kSum"></span><span class="target" id="paddleclasspaddle_1_1AverageLayer_1aa26f5a4f7be61eaf8dfc44c16b943e4cae70f844d2e826dcceb640b6889ac0b93"></span><code class="descname">kSum</code> = 1<a class="headerlink" href="#_CPPv2N6paddle12AverageLayer4kSumE" title="Permalink to this definition">¶</a></dt>
<dd></dd></dl>

<dl class="member">
<dt id="_CPPv2N6paddle12AverageLayer19kAverageSquareRootNE">
<span id="paddle::AverageLayer::kAverageSquareRootN"></span><span class="target" id="paddleclasspaddle_1_1AverageLayer_1aa26f5a4f7be61eaf8dfc44c16b943e4ca7edfae11ceb3c1cee072b749bf9ce26f"></span><code class="descname">kAverageSquareRootN</code> = 2<a class="headerlink" href="#_CPPv2N6paddle12AverageLayer19kAverageSquareRootNE" title="Permalink to this definition">¶</a></dt>
<dd></dd></dl>

</dd></dl>

</div>
4807
<div class="breathe-sectiondef docutils container">
Y
Yu Yang 已提交
4808 4809 4810 4811 4812 4813 4814 4815 4816 4817 4818 4819 4820
<p class="breathe-sectiondef-title rubric">Public Functions</p>
<dl class="function">
<dt id="_CPPv2N6paddle12AverageLayer12AverageLayerERK11LayerConfig">
<span id="paddle::AverageLayer::AverageLayer__LayerConfigCR"></span><span class="target" id="paddleclasspaddle_1_1AverageLayer_1a4b1da2125bf37055a7cc9a1e23aa5aba"></span><code class="descname">AverageLayer</code><span class="sig-paren">(</span><em class="property">const</em> LayerConfig &amp;<em>config</em><span class="sig-paren">)</span><a class="headerlink" href="#_CPPv2N6paddle12AverageLayer12AverageLayerERK11LayerConfig" title="Permalink to this definition">¶</a></dt>
<dd></dd></dl>

<dl class="function">
<dt id="_CPPv2N6paddle12AverageLayerD0Ev">
<span id="paddle::AverageLayer::~AverageLayer"></span><span class="target" id="paddleclasspaddle_1_1AverageLayer_1a25a9ff72833f9634e3d7f71f75f880c5"></span><code class="descname">~AverageLayer</code><span class="sig-paren">(</span><span class="sig-paren">)</span><a class="headerlink" href="#_CPPv2N6paddle12AverageLayerD0Ev" title="Permalink to this definition">¶</a></dt>
<dd></dd></dl>

<dl class="function">
<dt id="_CPPv2N6paddle12AverageLayer4initERK8LayerMapRK12ParameterMap">
4821
<span id="paddle::AverageLayer::init__LayerMapCR.ParameterMapCR"></span><span class="target" id="paddleclasspaddle_1_1AverageLayer_1a2c913fc92af6a6e527b64e7bae968dea"></span>bool <code class="descname">init</code><span class="sig-paren">(</span><em class="property">const</em> LayerMap &amp;<em>layerMap</em>, <em class="property">const</em> <a class="reference internal" href="../../parameter/parameter/parameter.html#_CPPv2N6paddle12ParameterMapE" title="paddle::ParameterMap">ParameterMap</a> &amp;<em>parameterMap</em><span class="sig-paren">)</span><a class="headerlink" href="#_CPPv2N6paddle12AverageLayer4initERK8LayerMapRK12ParameterMap" title="Permalink to this definition">¶</a></dt>
Y
Yu Yang 已提交
4822 4823 4824 4825 4826
<dd><p>Intialization. For example, adding input layers from layerMap and parameterMap. </p>
</dd></dl>

<dl class="function">
<dt id="_CPPv2N6paddle12AverageLayer7forwardE8PassType">
4827
<span id="paddle::AverageLayer::forward__PassType"></span><span class="target" id="paddleclasspaddle_1_1AverageLayer_1aeaf645fcd66d6bc2f9d0ca2145787e51"></span>void <code class="descname">forward</code><span class="sig-paren">(</span>PassType <em>passType</em><span class="sig-paren">)</span><a class="headerlink" href="#_CPPv2N6paddle12AverageLayer7forwardE8PassType" title="Permalink to this definition">¶</a></dt>
Y
Yu Yang 已提交
4828 4829 4830 4831 4832
<dd><p>Forward propagation. All inherited implementation should call Layer::foward() function. </p>
</dd></dl>

<dl class="function">
<dt id="_CPPv2N6paddle12AverageLayer8backwardERK14UpdateCallback">
4833
<span id="paddle::AverageLayer::backward__UpdateCallbackCR"></span><span class="target" id="paddleclasspaddle_1_1AverageLayer_1a7e45feb655dd01ce373f3a50b0488442"></span>void <code class="descname">backward</code><span class="sig-paren">(</span><em class="property">const</em> <a class="reference internal" href="../../parameter/parameter/parameter.html#_CPPv2N6paddle14UpdateCallbackE" title="paddle::UpdateCallback">UpdateCallback</a> &amp;<em>callback</em> = nullptr<span class="sig-paren">)</span><a class="headerlink" href="#_CPPv2N6paddle12AverageLayer8backwardERK14UpdateCallback" title="Permalink to this definition">¶</a></dt>
4834
<dd><p>Backward propagation. Should only be called after <a class="reference internal" href="#paddleclasspaddle_1_1Layer_1a12386b3f20dd731e7ceaa2c61667cbe1"><span class="std std-ref">Layer::forward()</span></a> function. </p>
Y
Yu Yang 已提交
4835 4836 4837
</dd></dl>

</div>
4838
<div class="breathe-sectiondef docutils container">
Y
Yu Yang 已提交
4839 4840 4841 4842 4843 4844 4845 4846 4847 4848 4849 4850 4851 4852 4853 4854 4855 4856 4857 4858 4859 4860 4861 4862 4863
<p class="breathe-sectiondef-title rubric">Protected Attributes</p>
<dl class="member">
<dt id="_CPPv2N6paddle12AverageLayer7outMtx_E">
<span id="paddle::AverageLayer::outMtx___MatrixPtr"></span><span class="target" id="paddleclasspaddle_1_1AverageLayer_1a2c4e23c7f31232e8cf37500f15f99501"></span><a class="reference internal" href="../../math/matrix/matrix.html#_CPPv2N6paddle9MatrixPtrE" title="paddle::MatrixPtr">MatrixPtr</a> <code class="descname">outMtx_</code><a class="headerlink" href="#_CPPv2N6paddle12AverageLayer7outMtx_E" title="Permalink to this definition">¶</a></dt>
<dd></dd></dl>

<dl class="member">
<dt id="_CPPv2N6paddle12AverageLayer8dataMtx_E">
<span id="paddle::AverageLayer::dataMtx___MatrixPtr"></span><span class="target" id="paddleclasspaddle_1_1AverageLayer_1a1c9a938e637180fdcf44f5c65f7f5e08"></span><a class="reference internal" href="../../math/matrix/matrix.html#_CPPv2N6paddle9MatrixPtrE" title="paddle::MatrixPtr">MatrixPtr</a> <code class="descname">dataMtx_</code><a class="headerlink" href="#_CPPv2N6paddle12AverageLayer8dataMtx_E" title="Permalink to this definition">¶</a></dt>
<dd></dd></dl>

<dl class="member">
<dt id="_CPPv2N6paddle12AverageLayer5mode_E">
<span id="paddle::AverageLayer::mode___i"></span><span class="target" id="paddleclasspaddle_1_1AverageLayer_1a42e68dd62e779c9d528313569f695d9c"></span>int <code class="descname">mode_</code><a class="headerlink" href="#_CPPv2N6paddle12AverageLayer5mode_E" title="Permalink to this definition">¶</a></dt>
<dd></dd></dl>

</div>
</dd></dl>

</div>
<div class="section" id="maxlayer">
<h3>MaxLayer<a class="headerlink" href="#maxlayer" title="Permalink to this headline">¶</a></h3>
<dl class="class">
<dt id="_CPPv2N6paddle8MaxLayerE">
<span id="paddle::MaxLayer"></span><span class="target" id="paddleclasspaddle_1_1MaxLayer"></span><em class="property">class </em><code class="descclassname">paddle::</code><code class="descname">MaxLayer</code><a class="headerlink" href="#_CPPv2N6paddle8MaxLayerE" title="Permalink to this definition">¶</a></dt>
4864 4865 4866
<dd><p>A layer for &#8220;internal max&#8221; for sequence input. Input: one or more sequences. Each sequence contains some instances. If SequenceLevel = kNonSeq: Output: output size is the number of input sequences (NOT input instances) output[i] = max_{for each instance in this sequence}{input[i]} If SequenceLevel = kSeq: Check input sequence must has sub-sequence Output: output size is the number of input sub-sequences output[i] = max_{for each instance in this sub-sequence}{input[i]}</p>
<p>The config file api is pooling_layer. </p>
<p>Inherits from paddle::SequencePoolLayer</p>
4867
<div class="breathe-sectiondef docutils container">
Y
Yu Yang 已提交
4868 4869 4870 4871 4872 4873 4874 4875 4876 4877 4878 4879 4880
<p class="breathe-sectiondef-title rubric">Public Functions</p>
<dl class="function">
<dt id="_CPPv2N6paddle8MaxLayer8MaxLayerERK11LayerConfig">
<span id="paddle::MaxLayer::MaxLayer__LayerConfigCR"></span><span class="target" id="paddleclasspaddle_1_1MaxLayer_1ae2ebece689aab88b9493dcdc0fe2c945"></span><code class="descname">MaxLayer</code><span class="sig-paren">(</span><em class="property">const</em> LayerConfig &amp;<em>config</em><span class="sig-paren">)</span><a class="headerlink" href="#_CPPv2N6paddle8MaxLayer8MaxLayerERK11LayerConfig" title="Permalink to this definition">¶</a></dt>
<dd></dd></dl>

<dl class="function">
<dt id="_CPPv2N6paddle8MaxLayerD0Ev">
<span id="paddle::MaxLayer::~MaxLayer"></span><span class="target" id="paddleclasspaddle_1_1MaxLayer_1a8d0827ae857b0257f90cab989930e522"></span><code class="descname">~MaxLayer</code><span class="sig-paren">(</span><span class="sig-paren">)</span><a class="headerlink" href="#_CPPv2N6paddle8MaxLayerD0Ev" title="Permalink to this definition">¶</a></dt>
<dd></dd></dl>

<dl class="function">
<dt id="_CPPv2N6paddle8MaxLayer4initERK8LayerMapRK12ParameterMap">
4881
<span id="paddle::MaxLayer::init__LayerMapCR.ParameterMapCR"></span><span class="target" id="paddleclasspaddle_1_1MaxLayer_1af9d1278dd039d0012e9cf6170c7f0d1f"></span>bool <code class="descname">init</code><span class="sig-paren">(</span><em class="property">const</em> LayerMap &amp;<em>layerMap</em>, <em class="property">const</em> <a class="reference internal" href="../../parameter/parameter/parameter.html#_CPPv2N6paddle12ParameterMapE" title="paddle::ParameterMap">ParameterMap</a> &amp;<em>parameterMap</em><span class="sig-paren">)</span><a class="headerlink" href="#_CPPv2N6paddle8MaxLayer4initERK8LayerMapRK12ParameterMap" title="Permalink to this definition">¶</a></dt>
Y
Yu Yang 已提交
4882 4883 4884 4885 4886
<dd><p>Intialization. For example, adding input layers from layerMap and parameterMap. </p>
</dd></dl>

<dl class="function">
<dt id="_CPPv2N6paddle8MaxLayer7forwardE8PassType">
4887
<span id="paddle::MaxLayer::forward__PassType"></span><span class="target" id="paddleclasspaddle_1_1MaxLayer_1a9c41e855b567e75d848af83c16b0b7bd"></span>void <code class="descname">forward</code><span class="sig-paren">(</span>PassType <em>passType</em><span class="sig-paren">)</span><a class="headerlink" href="#_CPPv2N6paddle8MaxLayer7forwardE8PassType" title="Permalink to this definition">¶</a></dt>
Y
Yu Yang 已提交
4888 4889 4890 4891 4892
<dd><p>Forward propagation. All inherited implementation should call Layer::foward() function. </p>
</dd></dl>

<dl class="function">
<dt id="_CPPv2N6paddle8MaxLayer8backwardERK14UpdateCallback">
4893
<span id="paddle::MaxLayer::backward__UpdateCallbackCR"></span><span class="target" id="paddleclasspaddle_1_1MaxLayer_1ad389303bed7d8556dad738dea90da351"></span>void <code class="descname">backward</code><span class="sig-paren">(</span><em class="property">const</em> <a class="reference internal" href="../../parameter/parameter/parameter.html#_CPPv2N6paddle14UpdateCallbackE" title="paddle::UpdateCallback">UpdateCallback</a> &amp;<em>callback</em> = nullptr<span class="sig-paren">)</span><a class="headerlink" href="#_CPPv2N6paddle8MaxLayer8backwardERK14UpdateCallback" title="Permalink to this definition">¶</a></dt>
4894
<dd><p>Backward propagation. Should only be called after <a class="reference internal" href="#paddleclasspaddle_1_1Layer_1a12386b3f20dd731e7ceaa2c61667cbe1"><span class="std std-ref">Layer::forward()</span></a> function. </p>
Y
Yu Yang 已提交
4895 4896 4897
</dd></dl>

</div>
4898
<div class="breathe-sectiondef docutils container">
Y
Yu Yang 已提交
4899 4900 4901 4902 4903 4904 4905 4906 4907 4908 4909 4910 4911 4912 4913
<p class="breathe-sectiondef-title rubric">Protected Attributes</p>
<dl class="member">
<dt id="_CPPv2N6paddle8MaxLayer9maxIndex_E">
<span id="paddle::MaxLayer::maxIndex___IVectorPtr"></span><span class="target" id="paddleclasspaddle_1_1MaxLayer_1a5dbae052a0a5b706455256c1a94618f9"></span><a class="reference internal" href="../../math/matrix/matrix.html#_CPPv2N6paddle10IVectorPtrE" title="paddle::IVectorPtr">IVectorPtr</a> <code class="descname">maxIndex_</code><a class="headerlink" href="#_CPPv2N6paddle8MaxLayer9maxIndex_E" title="Permalink to this definition">¶</a></dt>
<dd></dd></dl>

</div>
</dd></dl>

</div>
<div class="section" id="sequencelastinstancelayer">
<h3>SequenceLastInstanceLayer<a class="headerlink" href="#sequencelastinstancelayer" title="Permalink to this headline">¶</a></h3>
<dl class="class">
<dt id="_CPPv2N6paddle25SequenceLastInstanceLayerE">
<span id="paddle::SequenceLastInstanceLayer"></span><span class="target" id="paddleclasspaddle_1_1SequenceLastInstanceLayer"></span><em class="property">class </em><code class="descclassname">paddle::</code><code class="descname">SequenceLastInstanceLayer</code><a class="headerlink" href="#_CPPv2N6paddle25SequenceLastInstanceLayerE" title="Permalink to this definition">¶</a></dt>
4914 4915 4916
<dd><p>A layer for extracting the last instance of the input sequence. Input: a sequence If SequenceLevel = kNonseq: Output: a sequence containing only the last instance of the input sequence If SequenceLevel = kSeq: Check input sequence must has sub-sequence Output: a sequence containing only the last instance of each sub-sequence of the input sequence</p>
<p>The config file api is last_seq and first_seq. </p>
<p>Inherits from paddle::SequencePoolLayer</p>
4917
<div class="breathe-sectiondef docutils container">
Y
Yu Yang 已提交
4918 4919 4920 4921 4922 4923 4924 4925 4926 4927 4928 4929 4930
<p class="breathe-sectiondef-title rubric">Public Functions</p>
<dl class="function">
<dt id="_CPPv2N6paddle25SequenceLastInstanceLayer25SequenceLastInstanceLayerERK11LayerConfig">
<span id="paddle::SequenceLastInstanceLayer::SequenceLastInstanceLayer__LayerConfigCR"></span><span class="target" id="paddleclasspaddle_1_1SequenceLastInstanceLayer_1ac6a0fecb92538048ea0ecbee0cf4d498"></span><code class="descname">SequenceLastInstanceLayer</code><span class="sig-paren">(</span><em class="property">const</em> LayerConfig &amp;<em>config</em><span class="sig-paren">)</span><a class="headerlink" href="#_CPPv2N6paddle25SequenceLastInstanceLayer25SequenceLastInstanceLayerERK11LayerConfig" title="Permalink to this definition">¶</a></dt>
<dd></dd></dl>

<dl class="function">
<dt id="_CPPv2N6paddle25SequenceLastInstanceLayerD0Ev">
<span id="paddle::SequenceLastInstanceLayer::~SequenceLastInstanceLayer"></span><span class="target" id="paddleclasspaddle_1_1SequenceLastInstanceLayer_1a94a3f23f62089996daa9b3fc7148ef39"></span><code class="descname">~SequenceLastInstanceLayer</code><span class="sig-paren">(</span><span class="sig-paren">)</span><a class="headerlink" href="#_CPPv2N6paddle25SequenceLastInstanceLayerD0Ev" title="Permalink to this definition">¶</a></dt>
<dd></dd></dl>

<dl class="function">
<dt id="_CPPv2N6paddle25SequenceLastInstanceLayer4initERK8LayerMapRK12ParameterMap">
4931
<span id="paddle::SequenceLastInstanceLayer::init__LayerMapCR.ParameterMapCR"></span><span class="target" id="paddleclasspaddle_1_1SequenceLastInstanceLayer_1a8c6c2262f2298fc6a455772a35ab6ad1"></span>bool <code class="descname">init</code><span class="sig-paren">(</span><em class="property">const</em> LayerMap &amp;<em>layerMap</em>, <em class="property">const</em> <a class="reference internal" href="../../parameter/parameter/parameter.html#_CPPv2N6paddle12ParameterMapE" title="paddle::ParameterMap">ParameterMap</a> &amp;<em>parameterMap</em><span class="sig-paren">)</span><a class="headerlink" href="#_CPPv2N6paddle25SequenceLastInstanceLayer4initERK8LayerMapRK12ParameterMap" title="Permalink to this definition">¶</a></dt>
Y
Yu Yang 已提交
4932 4933 4934 4935 4936
<dd><p>Intialization. For example, adding input layers from layerMap and parameterMap. </p>
</dd></dl>

<dl class="function">
<dt id="_CPPv2N6paddle25SequenceLastInstanceLayer7forwardE8PassType">
4937
<span id="paddle::SequenceLastInstanceLayer::forward__PassType"></span><span class="target" id="paddleclasspaddle_1_1SequenceLastInstanceLayer_1a4242113d3ca809953575c0ee8e76bee5"></span>void <code class="descname">forward</code><span class="sig-paren">(</span>PassType <em>passType</em><span class="sig-paren">)</span><a class="headerlink" href="#_CPPv2N6paddle25SequenceLastInstanceLayer7forwardE8PassType" title="Permalink to this definition">¶</a></dt>
Y
Yu Yang 已提交
4938 4939 4940 4941 4942
<dd><p>Forward propagation. All inherited implementation should call Layer::foward() function. </p>
</dd></dl>

<dl class="function">
<dt id="_CPPv2N6paddle25SequenceLastInstanceLayer8backwardERK14UpdateCallback">
4943
<span id="paddle::SequenceLastInstanceLayer::backward__UpdateCallbackCR"></span><span class="target" id="paddleclasspaddle_1_1SequenceLastInstanceLayer_1aecae5ab5d1e9c256ed1c41ca68037cce"></span>void <code class="descname">backward</code><span class="sig-paren">(</span><em class="property">const</em> <a class="reference internal" href="../../parameter/parameter/parameter.html#_CPPv2N6paddle14UpdateCallbackE" title="paddle::UpdateCallback">UpdateCallback</a> &amp;<em>callback</em> = nullptr<span class="sig-paren">)</span><a class="headerlink" href="#_CPPv2N6paddle25SequenceLastInstanceLayer8backwardERK14UpdateCallback" title="Permalink to this definition">¶</a></dt>
4944
<dd><p>Backward propagation. Should only be called after <a class="reference internal" href="#paddleclasspaddle_1_1Layer_1a12386b3f20dd731e7ceaa2c61667cbe1"><span class="std std-ref">Layer::forward()</span></a> function. </p>
Y
Yu Yang 已提交
4945 4946 4947
</dd></dl>

</div>
4948
<div class="breathe-sectiondef docutils container">
Y
Yu Yang 已提交
4949 4950 4951 4952 4953 4954 4955 4956 4957 4958 4959 4960 4961 4962 4963 4964 4965 4966 4967 4968 4969 4970 4971 4972
<p class="breathe-sectiondef-title rubric">Protected Attributes</p>
<dl class="member">
<dt id="_CPPv2N6paddle25SequenceLastInstanceLayer7tmpSrc_E">
<span id="paddle::SequenceLastInstanceLayer::tmpSrc___MatrixPtr"></span><span class="target" id="paddleclasspaddle_1_1SequenceLastInstanceLayer_1a9db7bc18cfdbf89f918775fb91a28997"></span><a class="reference internal" href="../../math/matrix/matrix.html#_CPPv2N6paddle9MatrixPtrE" title="paddle::MatrixPtr">MatrixPtr</a> <code class="descname">tmpSrc_</code><a class="headerlink" href="#_CPPv2N6paddle25SequenceLastInstanceLayer7tmpSrc_E" title="Permalink to this definition">¶</a></dt>
<dd></dd></dl>

<dl class="member">
<dt id="_CPPv2N6paddle25SequenceLastInstanceLayer8tmpDest_E">
<span id="paddle::SequenceLastInstanceLayer::tmpDest___MatrixPtr"></span><span class="target" id="paddleclasspaddle_1_1SequenceLastInstanceLayer_1acc2c7bd3935a38ee14c24b66d29fe716"></span><a class="reference internal" href="../../math/matrix/matrix.html#_CPPv2N6paddle9MatrixPtrE" title="paddle::MatrixPtr">MatrixPtr</a> <code class="descname">tmpDest_</code><a class="headerlink" href="#_CPPv2N6paddle25SequenceLastInstanceLayer8tmpDest_E" title="Permalink to this definition">¶</a></dt>
<dd></dd></dl>

</div>
</dd></dl>

</div>
</div>
<div class="section" id="concat">
<h2>Concat<a class="headerlink" href="#concat" title="Permalink to this headline">¶</a></h2>
<div class="section" id="concatenatelayer">
<h3>ConcatenateLayer<a class="headerlink" href="#concatenatelayer" title="Permalink to this headline">¶</a></h3>
<dl class="class">
<dt id="_CPPv2N6paddle16ConcatenateLayerE">
<span id="paddle::ConcatenateLayer"></span><span class="target" id="paddleclasspaddle_1_1ConcatenateLayer"></span><em class="property">class </em><code class="descclassname">paddle::</code><code class="descname">ConcatenateLayer</code><a class="headerlink" href="#_CPPv2N6paddle16ConcatenateLayerE" title="Permalink to this definition">¶</a></dt>
<dd><p>A concatenate layer has multiple input layers. It concatenates rows of each input as one row for the output of this layer and apply activation. </p>
4973
<p>Inherits from <a class="reference internal" href="#paddleclasspaddle_1_1Layer"><span class="std std-ref">paddle::Layer</span></a></p>
4974
<div class="breathe-sectiondef docutils container">
Y
Yu Yang 已提交
4975 4976 4977 4978 4979 4980 4981 4982 4983 4984 4985 4986 4987
<p class="breathe-sectiondef-title rubric">Public Functions</p>
<dl class="function">
<dt id="_CPPv2N6paddle16ConcatenateLayer16ConcatenateLayerERK11LayerConfig">
<span id="paddle::ConcatenateLayer::ConcatenateLayer__LayerConfigCR"></span><span class="target" id="paddleclasspaddle_1_1ConcatenateLayer_1a0d086075459c45b87ada2f65cbdb1787"></span><code class="descname">ConcatenateLayer</code><span class="sig-paren">(</span><em class="property">const</em> LayerConfig &amp;<em>config</em><span class="sig-paren">)</span><a class="headerlink" href="#_CPPv2N6paddle16ConcatenateLayer16ConcatenateLayerERK11LayerConfig" title="Permalink to this definition">¶</a></dt>
<dd></dd></dl>

<dl class="function">
<dt id="_CPPv2N6paddle16ConcatenateLayerD0Ev">
<span id="paddle::ConcatenateLayer::~ConcatenateLayer"></span><span class="target" id="paddleclasspaddle_1_1ConcatenateLayer_1a4569e025889ce59e8ff7a0f150d40f47"></span><code class="descname">~ConcatenateLayer</code><span class="sig-paren">(</span><span class="sig-paren">)</span><a class="headerlink" href="#_CPPv2N6paddle16ConcatenateLayerD0Ev" title="Permalink to this definition">¶</a></dt>
<dd></dd></dl>

<dl class="function">
<dt id="_CPPv2N6paddle16ConcatenateLayer4initERK8LayerMapRK12ParameterMap">
4988
<span id="paddle::ConcatenateLayer::init__LayerMapCR.ParameterMapCR"></span><span class="target" id="paddleclasspaddle_1_1ConcatenateLayer_1aa748fc2022cd507fc43f1d83642171e6"></span>bool <code class="descname">init</code><span class="sig-paren">(</span><em class="property">const</em> LayerMap &amp;<em>layerMap</em>, <em class="property">const</em> <a class="reference internal" href="../../parameter/parameter/parameter.html#_CPPv2N6paddle12ParameterMapE" title="paddle::ParameterMap">ParameterMap</a> &amp;<em>parameterMap</em><span class="sig-paren">)</span><a class="headerlink" href="#_CPPv2N6paddle16ConcatenateLayer4initERK8LayerMapRK12ParameterMap" title="Permalink to this definition">¶</a></dt>
Y
Yu Yang 已提交
4989 4990 4991 4992 4993
<dd><p>Intialization. For example, adding input layers from layerMap and parameterMap. </p>
</dd></dl>

<dl class="function">
<dt id="_CPPv2N6paddle16ConcatenateLayer7forwardE8PassType">
4994
<span id="paddle::ConcatenateLayer::forward__PassType"></span><span class="target" id="paddleclasspaddle_1_1ConcatenateLayer_1a37f9e624ee931dd2123bc8daec5add16"></span>void <code class="descname">forward</code><span class="sig-paren">(</span>PassType <em>passType</em><span class="sig-paren">)</span><a class="headerlink" href="#_CPPv2N6paddle16ConcatenateLayer7forwardE8PassType" title="Permalink to this definition">¶</a></dt>
Y
Yu Yang 已提交
4995 4996 4997 4998 4999
<dd><p>Forward propagation. All inherited implementation should call Layer::foward() function. </p>
</dd></dl>

<dl class="function">
<dt id="_CPPv2N6paddle16ConcatenateLayer8backwardERK14UpdateCallback">
5000
<span id="paddle::ConcatenateLayer::backward__UpdateCallbackCR"></span><span class="target" id="paddleclasspaddle_1_1ConcatenateLayer_1a1e611f62e0ebb86203a6ec4ca60ec98b"></span>void <code class="descname">backward</code><span class="sig-paren">(</span><em class="property">const</em> <a class="reference internal" href="../../parameter/parameter/parameter.html#_CPPv2N6paddle14UpdateCallbackE" title="paddle::UpdateCallback">UpdateCallback</a> &amp;<em>callback</em> = nullptr<span class="sig-paren">)</span><a class="headerlink" href="#_CPPv2N6paddle16ConcatenateLayer8backwardERK14UpdateCallback" title="Permalink to this definition">¶</a></dt>
5001
<dd><p>Backward propagation. Should only be called after <a class="reference internal" href="#paddleclasspaddle_1_1Layer_1a12386b3f20dd731e7ceaa2c61667cbe1"><span class="std std-ref">Layer::forward()</span></a> function. </p>
Y
Yu Yang 已提交
5002 5003 5004 5005 5006 5007 5008 5009 5010 5011 5012
</dd></dl>

</div>
</dd></dl>

</div>
<div class="section" id="concatenatelayer2">
<h3>ConcatenateLayer2<a class="headerlink" href="#concatenatelayer2" title="Permalink to this headline">¶</a></h3>
<dl class="class">
<dt id="_CPPv2N6paddle17ConcatenateLayer2E">
<span id="paddle::ConcatenateLayer2"></span><span class="target" id="paddleclasspaddle_1_1ConcatenateLayer2"></span><em class="property">class </em><code class="descclassname">paddle::</code><code class="descname">ConcatenateLayer2</code><a class="headerlink" href="#_CPPv2N6paddle17ConcatenateLayer2E" title="Permalink to this definition">¶</a></dt>
5013 5014
<dd><p>concat2 layer is like concat layer, but each input layer was processed by a <a class="reference internal" href="#paddleclasspaddle_1_1Projection"><span class="std std-ref">Projection</span></a>. </p>
<p>Inherits from <a class="reference internal" href="#paddleclasspaddle_1_1Layer"><span class="std std-ref">paddle::Layer</span></a></p>
5015
<div class="breathe-sectiondef docutils container">
Y
Yu Yang 已提交
5016 5017 5018 5019 5020 5021 5022 5023 5024 5025 5026 5027 5028
<p class="breathe-sectiondef-title rubric">Public Functions</p>
<dl class="function">
<dt id="_CPPv2N6paddle17ConcatenateLayer217ConcatenateLayer2ERK11LayerConfig">
<span id="paddle::ConcatenateLayer2::ConcatenateLayer2__LayerConfigCR"></span><span class="target" id="paddleclasspaddle_1_1ConcatenateLayer2_1aae26b5e72df30878fdc98fa49ff6afa4"></span><code class="descname">ConcatenateLayer2</code><span class="sig-paren">(</span><em class="property">const</em> LayerConfig &amp;<em>config</em><span class="sig-paren">)</span><a class="headerlink" href="#_CPPv2N6paddle17ConcatenateLayer217ConcatenateLayer2ERK11LayerConfig" title="Permalink to this definition">¶</a></dt>
<dd></dd></dl>

<dl class="function">
<dt id="_CPPv2N6paddle17ConcatenateLayer2D0Ev">
<span id="paddle::ConcatenateLayer2::~ConcatenateLayer2"></span><span class="target" id="paddleclasspaddle_1_1ConcatenateLayer2_1ae5ef164d09b9974e745a771cfab7b26d"></span><code class="descname">~ConcatenateLayer2</code><span class="sig-paren">(</span><span class="sig-paren">)</span><a class="headerlink" href="#_CPPv2N6paddle17ConcatenateLayer2D0Ev" title="Permalink to this definition">¶</a></dt>
<dd></dd></dl>

<dl class="function">
<dt id="_CPPv2N6paddle17ConcatenateLayer24initERK8LayerMapRK12ParameterMap">
5029
<span id="paddle::ConcatenateLayer2::init__LayerMapCR.ParameterMapCR"></span><span class="target" id="paddleclasspaddle_1_1ConcatenateLayer2_1a910aadecb680a75a4ebad1d4bff29f7b"></span>bool <code class="descname">init</code><span class="sig-paren">(</span><em class="property">const</em> LayerMap &amp;<em>layerMap</em>, <em class="property">const</em> <a class="reference internal" href="../../parameter/parameter/parameter.html#_CPPv2N6paddle12ParameterMapE" title="paddle::ParameterMap">ParameterMap</a> &amp;<em>parameterMap</em><span class="sig-paren">)</span><a class="headerlink" href="#_CPPv2N6paddle17ConcatenateLayer24initERK8LayerMapRK12ParameterMap" title="Permalink to this definition">¶</a></dt>
Y
Yu Yang 已提交
5030 5031 5032 5033 5034
<dd><p>Intialization. For example, adding input layers from layerMap and parameterMap. </p>
</dd></dl>

<dl class="function">
<dt id="_CPPv2N6paddle17ConcatenateLayer27forwardE8PassType">
5035
<span id="paddle::ConcatenateLayer2::forward__PassType"></span><span class="target" id="paddleclasspaddle_1_1ConcatenateLayer2_1a5397d43a9ae122884c305bb0b580a017"></span>void <code class="descname">forward</code><span class="sig-paren">(</span>PassType <em>passType</em><span class="sig-paren">)</span><a class="headerlink" href="#_CPPv2N6paddle17ConcatenateLayer27forwardE8PassType" title="Permalink to this definition">¶</a></dt>
Y
Yu Yang 已提交
5036 5037 5038 5039 5040
<dd><p>Forward propagation. All inherited implementation should call Layer::foward() function. </p>
</dd></dl>

<dl class="function">
<dt id="_CPPv2N6paddle17ConcatenateLayer28backwardERK14UpdateCallback">
5041
<span id="paddle::ConcatenateLayer2::backward__UpdateCallbackCR"></span><span class="target" id="paddleclasspaddle_1_1ConcatenateLayer2_1a9b0db3947661422bf19424a8f032f2ab"></span>void <code class="descname">backward</code><span class="sig-paren">(</span><em class="property">const</em> <a class="reference internal" href="../../parameter/parameter/parameter.html#_CPPv2N6paddle14UpdateCallbackE" title="paddle::UpdateCallback">UpdateCallback</a> &amp;<em>callback</em> = nullptr<span class="sig-paren">)</span><a class="headerlink" href="#_CPPv2N6paddle17ConcatenateLayer28backwardERK14UpdateCallback" title="Permalink to this definition">¶</a></dt>
5042
<dd><p>Backward propagation. Should only be called after <a class="reference internal" href="#paddleclasspaddle_1_1Layer_1a12386b3f20dd731e7ceaa2c61667cbe1"><span class="std std-ref">Layer::forward()</span></a> function. </p>
Y
Yu Yang 已提交
5043 5044 5045
</dd></dl>

</div>
5046
<div class="breathe-sectiondef docutils container">
Y
Yu Yang 已提交
5047 5048 5049 5050 5051 5052 5053 5054 5055 5056 5057 5058 5059 5060 5061 5062
<p class="breathe-sectiondef-title rubric">Protected Attributes</p>
<dl class="member">
<dt id="_CPPv2N6paddle17ConcatenateLayer212projections_E">
<span id="paddle::ConcatenateLayer2::projections___std::vector:std::unique_ptr:Projection::"></span><span class="target" id="paddleclasspaddle_1_1ConcatenateLayer2_1a7afabcdb8b553579f51c1c279f6f145d"></span>std::vector&lt;std::unique_ptr&lt;<a class="reference internal" href="#_CPPv2N6paddle10ProjectionE" title="paddle::Projection">Projection</a>&gt;&gt; <code class="descname">projections_</code><a class="headerlink" href="#_CPPv2N6paddle17ConcatenateLayer212projections_E" title="Permalink to this definition">¶</a></dt>
<dd></dd></dl>

<dl class="member">
<dt id="_CPPv2N6paddle17ConcatenateLayer211projOutput_E">
<span id="paddle::ConcatenateLayer2::projOutput___std::vector:Argument:"></span><span class="target" id="paddleclasspaddle_1_1ConcatenateLayer2_1a515ccfad2ca49049165b518fe97ce843"></span>std::vector&lt;<a class="reference internal" href="../../parameter/parameter/parameter.html#_CPPv2N6paddle8ArgumentE" title="paddle::Argument">Argument</a>&gt; <code class="descname">projOutput_</code><a class="headerlink" href="#_CPPv2N6paddle17ConcatenateLayer211projOutput_E" title="Permalink to this definition">¶</a></dt>
<dd></dd></dl>

<dl class="member">
<dt id="_CPPv2N6paddle17ConcatenateLayer28projCol_E">
<span id="paddle::ConcatenateLayer2::projCol___std::vector:std::pair:s.s::"></span><span class="target" id="paddleclasspaddle_1_1ConcatenateLayer2_1a23b4a561d25f5528a69f5b9a14b53106"></span>std::vector&lt;std::pair&lt;size_t, size_t&gt;&gt; <code class="descname">projCol_</code><a class="headerlink" href="#_CPPv2N6paddle17ConcatenateLayer28projCol_E" title="Permalink to this definition">¶</a></dt>
<dd></dd></dl>

5063 5064 5065 5066 5067 5068 5069 5070 5071 5072
<dl class="member">
<dt id="_CPPv2N6paddle17ConcatenateLayer211sharedBias_E">
<span id="paddle::ConcatenateLayer2::sharedBias___b"></span><span class="target" id="paddleclasspaddle_1_1ConcatenateLayer2_1a68a763a5ea650d74d5d17da794a86509"></span>bool <code class="descname">sharedBias_</code><a class="headerlink" href="#_CPPv2N6paddle17ConcatenateLayer211sharedBias_E" title="Permalink to this definition">¶</a></dt>
<dd></dd></dl>

<dl class="member">
<dt id="_CPPv2N6paddle17ConcatenateLayer27biases_E">
<span id="paddle::ConcatenateLayer2::biases___std::unique_ptr:Weight:"></span><span class="target" id="paddleclasspaddle_1_1ConcatenateLayer2_1aad51478bbc6b76440f9b9d1734c8a428"></span>std::unique_ptr&lt;<a class="reference internal" href="../../parameter/parameter/parameter.html#_CPPv2N6paddle6WeightE" title="paddle::Weight">Weight</a>&gt; <code class="descname">biases_</code><a class="headerlink" href="#_CPPv2N6paddle17ConcatenateLayer27biases_E" title="Permalink to this definition">¶</a></dt>
<dd></dd></dl>

Y
Yu Yang 已提交
5073 5074 5075 5076 5077 5078 5079 5080 5081 5082
</div>
</dd></dl>

</div>
<div class="section" id="sequenceconcatlayer">
<h3>SequenceConcatLayer<a class="headerlink" href="#sequenceconcatlayer" title="Permalink to this headline">¶</a></h3>
<dl class="class">
<dt id="_CPPv2N6paddle19SequenceConcatLayerE">
<span id="paddle::SequenceConcatLayer"></span><span class="target" id="paddleclasspaddle_1_1SequenceConcatLayer"></span><em class="property">class </em><code class="descclassname">paddle::</code><code class="descname">SequenceConcatLayer</code><a class="headerlink" href="#_CPPv2N6paddle19SequenceConcatLayerE" title="Permalink to this definition">¶</a></dt>
<dd><p>A layer for concatenating the first sequence with the second sequence following the first Input: two sequences each containing some instances Output: a concatenated sequence of the two input sequences </p>
5083
<p>Inherits from <a class="reference internal" href="#paddleclasspaddle_1_1Layer"><span class="std std-ref">paddle::Layer</span></a></p>
5084
<div class="breathe-sectiondef docutils container">
Y
Yu Yang 已提交
5085 5086 5087 5088 5089 5090 5091 5092 5093 5094 5095 5096 5097
<p class="breathe-sectiondef-title rubric">Public Functions</p>
<dl class="function">
<dt id="_CPPv2N6paddle19SequenceConcatLayer19SequenceConcatLayerERK11LayerConfig">
<span id="paddle::SequenceConcatLayer::SequenceConcatLayer__LayerConfigCR"></span><span class="target" id="paddleclasspaddle_1_1SequenceConcatLayer_1ab17df594951c1d3c304524550336b3f0"></span><code class="descname">SequenceConcatLayer</code><span class="sig-paren">(</span><em class="property">const</em> LayerConfig &amp;<em>config</em><span class="sig-paren">)</span><a class="headerlink" href="#_CPPv2N6paddle19SequenceConcatLayer19SequenceConcatLayerERK11LayerConfig" title="Permalink to this definition">¶</a></dt>
<dd></dd></dl>

<dl class="function">
<dt id="_CPPv2N6paddle19SequenceConcatLayerD0Ev">
<span id="paddle::SequenceConcatLayer::~SequenceConcatLayer"></span><span class="target" id="paddleclasspaddle_1_1SequenceConcatLayer_1a7d27c516f5c4f5bee7f7944155fe45d9"></span><code class="descname">~SequenceConcatLayer</code><span class="sig-paren">(</span><span class="sig-paren">)</span><a class="headerlink" href="#_CPPv2N6paddle19SequenceConcatLayerD0Ev" title="Permalink to this definition">¶</a></dt>
<dd></dd></dl>

<dl class="function">
<dt id="_CPPv2N6paddle19SequenceConcatLayer4initERK8LayerMapRK12ParameterMap">
5098
<span id="paddle::SequenceConcatLayer::init__LayerMapCR.ParameterMapCR"></span><span class="target" id="paddleclasspaddle_1_1SequenceConcatLayer_1af7737b5c7ed6929af27402173aab205b"></span>bool <code class="descname">init</code><span class="sig-paren">(</span><em class="property">const</em> LayerMap &amp;<em>layerMap</em>, <em class="property">const</em> <a class="reference internal" href="../../parameter/parameter/parameter.html#_CPPv2N6paddle12ParameterMapE" title="paddle::ParameterMap">ParameterMap</a> &amp;<em>parameterMap</em><span class="sig-paren">)</span><a class="headerlink" href="#_CPPv2N6paddle19SequenceConcatLayer4initERK8LayerMapRK12ParameterMap" title="Permalink to this definition">¶</a></dt>
Y
Yu Yang 已提交
5099 5100 5101 5102 5103
<dd><p>Intialization. For example, adding input layers from layerMap and parameterMap. </p>
</dd></dl>

<dl class="function">
<dt id="_CPPv2N6paddle19SequenceConcatLayer7forwardE8PassType">
5104
<span id="paddle::SequenceConcatLayer::forward__PassType"></span><span class="target" id="paddleclasspaddle_1_1SequenceConcatLayer_1ad35118e39e0fedd72ee69401c7b150f1"></span>void <code class="descname">forward</code><span class="sig-paren">(</span>PassType <em>passType</em><span class="sig-paren">)</span><a class="headerlink" href="#_CPPv2N6paddle19SequenceConcatLayer7forwardE8PassType" title="Permalink to this definition">¶</a></dt>
Y
Yu Yang 已提交
5105 5106 5107 5108 5109
<dd><p>Forward propagation. All inherited implementation should call Layer::foward() function. </p>
</dd></dl>

<dl class="function">
<dt id="_CPPv2N6paddle19SequenceConcatLayer8backwardERK14UpdateCallback">
5110
<span id="paddle::SequenceConcatLayer::backward__UpdateCallbackCR"></span><span class="target" id="paddleclasspaddle_1_1SequenceConcatLayer_1ac5bbeccc4e883958bb7647fce7414296"></span>void <code class="descname">backward</code><span class="sig-paren">(</span><em class="property">const</em> <a class="reference internal" href="../../parameter/parameter/parameter.html#_CPPv2N6paddle14UpdateCallbackE" title="paddle::UpdateCallback">UpdateCallback</a> &amp;<em>callback</em> = nullptr<span class="sig-paren">)</span><a class="headerlink" href="#_CPPv2N6paddle19SequenceConcatLayer8backwardERK14UpdateCallback" title="Permalink to this definition">¶</a></dt>
5111
<dd><p>Backward propagation. Should only be called after <a class="reference internal" href="#paddleclasspaddle_1_1Layer_1a12386b3f20dd731e7ceaa2c61667cbe1"><span class="std std-ref">Layer::forward()</span></a> function. </p>
Y
Yu Yang 已提交
5112 5113 5114
</dd></dl>

</div>
5115
<div class="breathe-sectiondef docutils container">
Y
Yu Yang 已提交
5116 5117 5118 5119 5120 5121 5122 5123 5124 5125 5126 5127 5128 5129 5130 5131 5132 5133 5134
<p class="breathe-sectiondef-title rubric">Protected Attributes</p>
<dl class="member">
<dt id="_CPPv2N6paddle19SequenceConcatLayer7biases_E">
<span id="paddle::SequenceConcatLayer::biases___std::unique_ptr:Weight:"></span><span class="target" id="paddleclasspaddle_1_1SequenceConcatLayer_1a079d90c07921cf41694ba5212bd41a79"></span>std::unique_ptr&lt;<a class="reference internal" href="../../parameter/parameter/parameter.html#_CPPv2N6paddle6WeightE" title="paddle::Weight">Weight</a>&gt; <code class="descname">biases_</code><a class="headerlink" href="#_CPPv2N6paddle19SequenceConcatLayer7biases_E" title="Permalink to this definition">¶</a></dt>
<dd></dd></dl>

</div>
</dd></dl>

</div>
</div>
<div class="section" id="subset">
<h2>Subset<a class="headerlink" href="#subset" title="Permalink to this headline">¶</a></h2>
<div class="section" id="subsequencelayer">
<h3>SubSequenceLayer<a class="headerlink" href="#subsequencelayer" title="Permalink to this headline">¶</a></h3>
<dl class="class">
<dt id="_CPPv2N6paddle16SubSequenceLayerE">
<span id="paddle::SubSequenceLayer"></span><span class="target" id="paddleclasspaddle_1_1SubSequenceLayer"></span><em class="property">class </em><code class="descclassname">paddle::</code><code class="descname">SubSequenceLayer</code><a class="headerlink" href="#_CPPv2N6paddle16SubSequenceLayerE" title="Permalink to this definition">¶</a></dt>
<dd><p>A layer for taking the subsequence according to given offset and size Input: original sequence, offset, size Output: subsequence </p>
5135
<p>Inherits from <a class="reference internal" href="#paddleclasspaddle_1_1Layer"><span class="std std-ref">paddle::Layer</span></a></p>
5136
<div class="breathe-sectiondef docutils container">
Y
Yu Yang 已提交
5137 5138 5139 5140 5141 5142 5143 5144 5145 5146 5147 5148 5149
<p class="breathe-sectiondef-title rubric">Public Functions</p>
<dl class="function">
<dt id="_CPPv2N6paddle16SubSequenceLayer16SubSequenceLayerERK11LayerConfig">
<span id="paddle::SubSequenceLayer::SubSequenceLayer__LayerConfigCR"></span><span class="target" id="paddleclasspaddle_1_1SubSequenceLayer_1a0915d625c29667101937e5a79c701e64"></span><code class="descname">SubSequenceLayer</code><span class="sig-paren">(</span><em class="property">const</em> LayerConfig &amp;<em>config</em><span class="sig-paren">)</span><a class="headerlink" href="#_CPPv2N6paddle16SubSequenceLayer16SubSequenceLayerERK11LayerConfig" title="Permalink to this definition">¶</a></dt>
<dd></dd></dl>

<dl class="function">
<dt id="_CPPv2N6paddle16SubSequenceLayerD0Ev">
<span id="paddle::SubSequenceLayer::~SubSequenceLayer"></span><span class="target" id="paddleclasspaddle_1_1SubSequenceLayer_1aec31928e23a4bea8534d8dd159f8c0fc"></span><code class="descname">~SubSequenceLayer</code><span class="sig-paren">(</span><span class="sig-paren">)</span><a class="headerlink" href="#_CPPv2N6paddle16SubSequenceLayerD0Ev" title="Permalink to this definition">¶</a></dt>
<dd></dd></dl>

<dl class="function">
<dt id="_CPPv2N6paddle16SubSequenceLayer4initERK8LayerMapRK12ParameterMap">
5150
<span id="paddle::SubSequenceLayer::init__LayerMapCR.ParameterMapCR"></span><span class="target" id="paddleclasspaddle_1_1SubSequenceLayer_1a8907b16f699c297e37ecb990fadb0e11"></span>bool <code class="descname">init</code><span class="sig-paren">(</span><em class="property">const</em> LayerMap &amp;<em>layerMap</em>, <em class="property">const</em> <a class="reference internal" href="../../parameter/parameter/parameter.html#_CPPv2N6paddle12ParameterMapE" title="paddle::ParameterMap">ParameterMap</a> &amp;<em>parameterMap</em><span class="sig-paren">)</span><a class="headerlink" href="#_CPPv2N6paddle16SubSequenceLayer4initERK8LayerMapRK12ParameterMap" title="Permalink to this definition">¶</a></dt>
Y
Yu Yang 已提交
5151 5152 5153 5154 5155
<dd><p>Intialization. For example, adding input layers from layerMap and parameterMap. </p>
</dd></dl>

<dl class="function">
<dt id="_CPPv2N6paddle16SubSequenceLayer7forwardE8PassType">
5156
<span id="paddle::SubSequenceLayer::forward__PassType"></span><span class="target" id="paddleclasspaddle_1_1SubSequenceLayer_1ab5a3e5d3d54fce397b6881d1a93148b4"></span>void <code class="descname">forward</code><span class="sig-paren">(</span>PassType <em>passType</em><span class="sig-paren">)</span><a class="headerlink" href="#_CPPv2N6paddle16SubSequenceLayer7forwardE8PassType" title="Permalink to this definition">¶</a></dt>
Y
Yu Yang 已提交
5157 5158 5159 5160 5161
<dd><p>Forward propagation. All inherited implementation should call Layer::foward() function. </p>
</dd></dl>

<dl class="function">
<dt id="_CPPv2N6paddle16SubSequenceLayer8backwardERK14UpdateCallback">
5162
<span id="paddle::SubSequenceLayer::backward__UpdateCallbackCR"></span><span class="target" id="paddleclasspaddle_1_1SubSequenceLayer_1ad4e5154b99fd40ea7777c31ece2eea30"></span>void <code class="descname">backward</code><span class="sig-paren">(</span><em class="property">const</em> <a class="reference internal" href="../../parameter/parameter/parameter.html#_CPPv2N6paddle14UpdateCallbackE" title="paddle::UpdateCallback">UpdateCallback</a> &amp;<em>callback</em> = nullptr<span class="sig-paren">)</span><a class="headerlink" href="#_CPPv2N6paddle16SubSequenceLayer8backwardERK14UpdateCallback" title="Permalink to this definition">¶</a></dt>
5163
<dd><p>Backward propagation. Should only be called after <a class="reference internal" href="#paddleclasspaddle_1_1Layer_1a12386b3f20dd731e7ceaa2c61667cbe1"><span class="std std-ref">Layer::forward()</span></a> function. </p>
Y
Yu Yang 已提交
5164 5165 5166
</dd></dl>

</div>
5167
<div class="breathe-sectiondef docutils container">
Y
Yu Yang 已提交
5168 5169 5170 5171 5172 5173 5174 5175 5176 5177 5178 5179 5180 5181 5182 5183 5184 5185 5186 5187 5188 5189 5190 5191 5192 5193 5194 5195 5196 5197
<p class="breathe-sectiondef-title rubric">Protected Attributes</p>
<dl class="member">
<dt id="_CPPv2N6paddle16SubSequenceLayer7biases_E">
<span id="paddle::SubSequenceLayer::biases___std::unique_ptr:Weight:"></span><span class="target" id="paddleclasspaddle_1_1SubSequenceLayer_1acc63b5b48736161b4e0f978f512bee62"></span>std::unique_ptr&lt;<a class="reference internal" href="../../parameter/parameter/parameter.html#_CPPv2N6paddle6WeightE" title="paddle::Weight">Weight</a>&gt; <code class="descname">biases_</code><a class="headerlink" href="#_CPPv2N6paddle16SubSequenceLayer7biases_E" title="Permalink to this definition">¶</a></dt>
<dd></dd></dl>

<dl class="member">
<dt id="_CPPv2N6paddle16SubSequenceLayer7tmpSrc_E">
<span id="paddle::SubSequenceLayer::tmpSrc___MatrixPtr"></span><span class="target" id="paddleclasspaddle_1_1SubSequenceLayer_1a97d1076f0fd637ad1da81c90ca3cf6c0"></span><a class="reference internal" href="../../math/matrix/matrix.html#_CPPv2N6paddle9MatrixPtrE" title="paddle::MatrixPtr">MatrixPtr</a> <code class="descname">tmpSrc_</code><a class="headerlink" href="#_CPPv2N6paddle16SubSequenceLayer7tmpSrc_E" title="Permalink to this definition">¶</a></dt>
<dd></dd></dl>

<dl class="member">
<dt id="_CPPv2N6paddle16SubSequenceLayer8tmpDest_E">
<span id="paddle::SubSequenceLayer::tmpDest___MatrixPtr"></span><span class="target" id="paddleclasspaddle_1_1SubSequenceLayer_1ad9134437e7e150c1ccaf1ceeabd5d8a7"></span><a class="reference internal" href="../../math/matrix/matrix.html#_CPPv2N6paddle9MatrixPtrE" title="paddle::MatrixPtr">MatrixPtr</a> <code class="descname">tmpDest_</code><a class="headerlink" href="#_CPPv2N6paddle16SubSequenceLayer8tmpDest_E" title="Permalink to this definition">¶</a></dt>
<dd></dd></dl>

</div>
</dd></dl>

</div>
</div>
</div>
<div class="section" id="reshaping-layers">
<h1>Reshaping Layers<a class="headerlink" href="#reshaping-layers" title="Permalink to this headline">¶</a></h1>
<div class="section" id="blockexpandlayer">
<h2>BlockExpandLayer<a class="headerlink" href="#blockexpandlayer" title="Permalink to this headline">¶</a></h2>
<dl class="class">
<dt id="_CPPv2N6paddle16BlockExpandLayerE">
<span id="paddle::BlockExpandLayer"></span><span class="target" id="paddleclasspaddle_1_1BlockExpandLayer"></span><em class="property">class </em><code class="descclassname">paddle::</code><code class="descname">BlockExpandLayer</code><a class="headerlink" href="#_CPPv2N6paddle16BlockExpandLayerE" title="Permalink to this definition">¶</a></dt>
<dd><p>Expand feature map to minibatch matrix. </p>
Y
Yu Yang 已提交
5198 5199 5200 5201 5202 5203 5204 5205
<p><ul>
<li><p class="first">matrix width is: blockH_ * blockW_ * channels_</p>
</li>
<li><p class="first">matirx height is: outputH_ * outputW_</p>
<p><div class="math">
\[\begin{split} outputH\_ = 1 + (2 * paddingH\_ + imgSizeH\_ - blockH\_ + strideH\_ - 1) / strideH\_ \\ outputW\_ = 1 + (2 * paddingW\_ + imgSizeW\_ - blockW\_ + strideW\_ - 1) / strideW\_ \end{split}\]</div>
</p>
</li>
Y
Yu Yang 已提交
5206 5207
</ul>
</p>
5208
<p>The expand method is the same with <a class="reference internal" href="#paddleclasspaddle_1_1ExpandConvLayer"><span class="std std-ref">ExpandConvLayer</span></a>, but saved the transposed value. After expanding, output_.sequenceStartPositions will store timeline. The number of time steps are outputH_ * outputW_ and the dimension of each time step is blockH_ * blockW_ * channels_. This layer can be used after convolution neural network, and before recurrent neural network.</p>
Y
Yu Yang 已提交
5209
<p>The config file api is block_expand_layer. </p>
5210
<p>Inherits from <a class="reference internal" href="#paddleclasspaddle_1_1Layer"><span class="std std-ref">paddle::Layer</span></a></p>
5211
<div class="breathe-sectiondef docutils container">
Y
Yu Yang 已提交
5212 5213 5214 5215 5216 5217 5218 5219 5220 5221 5222 5223 5224
<p class="breathe-sectiondef-title rubric">Public Functions</p>
<dl class="function">
<dt id="_CPPv2N6paddle16BlockExpandLayer16BlockExpandLayerERK11LayerConfig">
<span id="paddle::BlockExpandLayer::BlockExpandLayer__LayerConfigCR"></span><span class="target" id="paddleclasspaddle_1_1BlockExpandLayer_1a048cb2d356611dfad88ad9678925f0b1"></span><code class="descname">BlockExpandLayer</code><span class="sig-paren">(</span><em class="property">const</em> LayerConfig &amp;<em>config</em><span class="sig-paren">)</span><a class="headerlink" href="#_CPPv2N6paddle16BlockExpandLayer16BlockExpandLayerERK11LayerConfig" title="Permalink to this definition">¶</a></dt>
<dd></dd></dl>

<dl class="function">
<dt id="_CPPv2N6paddle16BlockExpandLayerD0Ev">
<span id="paddle::BlockExpandLayer::~BlockExpandLayer"></span><span class="target" id="paddleclasspaddle_1_1BlockExpandLayer_1a74e9dceb3dae2eafae4c870bf91c42e5"></span><code class="descname">~BlockExpandLayer</code><span class="sig-paren">(</span><span class="sig-paren">)</span><a class="headerlink" href="#_CPPv2N6paddle16BlockExpandLayerD0Ev" title="Permalink to this definition">¶</a></dt>
<dd></dd></dl>

<dl class="function">
<dt id="_CPPv2N6paddle16BlockExpandLayer4initERK8LayerMapRK12ParameterMap">
5225
<span id="paddle::BlockExpandLayer::init__LayerMapCR.ParameterMapCR"></span><span class="target" id="paddleclasspaddle_1_1BlockExpandLayer_1a5e5461739329ba2015329785c83c9f5e"></span>bool <code class="descname">init</code><span class="sig-paren">(</span><em class="property">const</em> LayerMap &amp;<em>layerMap</em>, <em class="property">const</em> <a class="reference internal" href="../../parameter/parameter/parameter.html#_CPPv2N6paddle12ParameterMapE" title="paddle::ParameterMap">ParameterMap</a> &amp;<em>parameterMap</em><span class="sig-paren">)</span><a class="headerlink" href="#_CPPv2N6paddle16BlockExpandLayer4initERK8LayerMapRK12ParameterMap" title="Permalink to this definition">¶</a></dt>
Y
Yu Yang 已提交
5226 5227 5228 5229 5230
<dd><p>Intialization. For example, adding input layers from layerMap and parameterMap. </p>
</dd></dl>

<dl class="function">
<dt id="_CPPv2N6paddle16BlockExpandLayer7forwardE8PassType">
5231
<span id="paddle::BlockExpandLayer::forward__PassType"></span><span class="target" id="paddleclasspaddle_1_1BlockExpandLayer_1a55f7b4a0017c505994763f0322c83c47"></span>void <code class="descname">forward</code><span class="sig-paren">(</span>PassType <em>passType</em><span class="sig-paren">)</span><a class="headerlink" href="#_CPPv2N6paddle16BlockExpandLayer7forwardE8PassType" title="Permalink to this definition">¶</a></dt>
Y
Yu Yang 已提交
5232 5233 5234 5235 5236
<dd><p>Forward propagation. All inherited implementation should call Layer::foward() function. </p>
</dd></dl>

<dl class="function">
<dt id="_CPPv2N6paddle16BlockExpandLayer8backwardERK14UpdateCallback">
5237
<span id="paddle::BlockExpandLayer::backward__UpdateCallbackCR"></span><span class="target" id="paddleclasspaddle_1_1BlockExpandLayer_1a76d8cc6b51029d4fdeab9bfd6e9694bd"></span>void <code class="descname">backward</code><span class="sig-paren">(</span><em class="property">const</em> <a class="reference internal" href="../../parameter/parameter/parameter.html#_CPPv2N6paddle14UpdateCallbackE" title="paddle::UpdateCallback">UpdateCallback</a> &amp;<em>callback</em> = nullptr<span class="sig-paren">)</span><a class="headerlink" href="#_CPPv2N6paddle16BlockExpandLayer8backwardERK14UpdateCallback" title="Permalink to this definition">¶</a></dt>
5238
<dd><p>Backward propagation. Should only be called after <a class="reference internal" href="#paddleclasspaddle_1_1Layer_1a12386b3f20dd731e7ceaa2c61667cbe1"><span class="std std-ref">Layer::forward()</span></a> function. </p>
Y
Yu Yang 已提交
5239 5240 5241
</dd></dl>

</div>
5242
<div class="breathe-sectiondef docutils container">
Y
Yu Yang 已提交
5243 5244 5245 5246 5247 5248 5249 5250 5251 5252 5253 5254 5255
<p class="breathe-sectiondef-title rubric">Protected Functions</p>
<dl class="function">
<dt id="_CPPv2N6paddle16BlockExpandLayer11getBlockNumEv">
<span id="paddle::BlockExpandLayer::getBlockNum"></span><span class="target" id="paddleclasspaddle_1_1BlockExpandLayer_1a5670a1774fca131c874e5d627e151e92"></span>size_t <code class="descname">getBlockNum</code><span class="sig-paren">(</span><span class="sig-paren">)</span><a class="headerlink" href="#_CPPv2N6paddle16BlockExpandLayer11getBlockNumEv" title="Permalink to this definition">¶</a></dt>
<dd><p>Calculate outputH_ and outputW_ and return block number which actually is time steps. </p>
<p><dl class="docutils">
<dt><strong>Return</strong></dt>
<dd>time steps, outoutH_ * outputW_. </dd>
</dl>
</p>
</dd></dl>

</div>
5256
<div class="breathe-sectiondef docutils container">
Y
Yu Yang 已提交
5257 5258 5259 5260 5261 5262 5263 5264 5265 5266 5267 5268 5269 5270 5271 5272 5273 5274 5275 5276 5277 5278 5279 5280 5281 5282 5283 5284 5285 5286 5287 5288 5289 5290 5291 5292 5293 5294 5295 5296 5297 5298 5299 5300 5301 5302 5303 5304 5305 5306 5307 5308 5309 5310 5311 5312 5313 5314 5315 5316 5317 5318 5319 5320 5321 5322 5323 5324 5325 5326 5327 5328 5329 5330 5331 5332 5333 5334 5335 5336 5337 5338 5339 5340 5341 5342 5343
<p class="breathe-sectiondef-title rubric">Protected Attributes</p>
<dl class="member">
<dt id="_CPPv2N6paddle16BlockExpandLayer7blockH_E">
<span id="paddle::BlockExpandLayer::blockH___s"></span><span class="target" id="paddleclasspaddle_1_1BlockExpandLayer_1ae5a13475ced901eff5ae4682b558061f"></span>size_t <code class="descname">blockH_</code><a class="headerlink" href="#_CPPv2N6paddle16BlockExpandLayer7blockH_E" title="Permalink to this definition">¶</a></dt>
<dd></dd></dl>

<dl class="member">
<dt id="_CPPv2N6paddle16BlockExpandLayer7blockW_E">
<span id="paddle::BlockExpandLayer::blockW___s"></span><span class="target" id="paddleclasspaddle_1_1BlockExpandLayer_1adadca46903e386cebd41b6bd4f80b07d"></span>size_t <code class="descname">blockW_</code><a class="headerlink" href="#_CPPv2N6paddle16BlockExpandLayer7blockW_E" title="Permalink to this definition">¶</a></dt>
<dd></dd></dl>

<dl class="member">
<dt id="_CPPv2N6paddle16BlockExpandLayer8strideH_E">
<span id="paddle::BlockExpandLayer::strideH___s"></span><span class="target" id="paddleclasspaddle_1_1BlockExpandLayer_1af80bbd89bf1867a630d3da894625f370"></span>size_t <code class="descname">strideH_</code><a class="headerlink" href="#_CPPv2N6paddle16BlockExpandLayer8strideH_E" title="Permalink to this definition">¶</a></dt>
<dd></dd></dl>

<dl class="member">
<dt id="_CPPv2N6paddle16BlockExpandLayer8strideW_E">
<span id="paddle::BlockExpandLayer::strideW___s"></span><span class="target" id="paddleclasspaddle_1_1BlockExpandLayer_1adf6784af28a85e13f53a196ac5ebecee"></span>size_t <code class="descname">strideW_</code><a class="headerlink" href="#_CPPv2N6paddle16BlockExpandLayer8strideW_E" title="Permalink to this definition">¶</a></dt>
<dd></dd></dl>

<dl class="member">
<dt id="_CPPv2N6paddle16BlockExpandLayer9paddingH_E">
<span id="paddle::BlockExpandLayer::paddingH___s"></span><span class="target" id="paddleclasspaddle_1_1BlockExpandLayer_1a955e71e552b7f1e7c176c05ac40eb100"></span>size_t <code class="descname">paddingH_</code><a class="headerlink" href="#_CPPv2N6paddle16BlockExpandLayer9paddingH_E" title="Permalink to this definition">¶</a></dt>
<dd></dd></dl>

<dl class="member">
<dt id="_CPPv2N6paddle16BlockExpandLayer9paddingW_E">
<span id="paddle::BlockExpandLayer::paddingW___s"></span><span class="target" id="paddleclasspaddle_1_1BlockExpandLayer_1a428a23a737d916b3901589960be9d21f"></span>size_t <code class="descname">paddingW_</code><a class="headerlink" href="#_CPPv2N6paddle16BlockExpandLayer9paddingW_E" title="Permalink to this definition">¶</a></dt>
<dd></dd></dl>

<dl class="member">
<dt id="_CPPv2N6paddle16BlockExpandLayer9imgSizeH_E">
<span id="paddle::BlockExpandLayer::imgSizeH___s"></span><span class="target" id="paddleclasspaddle_1_1BlockExpandLayer_1a5cee06894cb06b14c72cf833364357ae"></span>size_t <code class="descname">imgSizeH_</code><a class="headerlink" href="#_CPPv2N6paddle16BlockExpandLayer9imgSizeH_E" title="Permalink to this definition">¶</a></dt>
<dd></dd></dl>

<dl class="member">
<dt id="_CPPv2N6paddle16BlockExpandLayer9imgSizeW_E">
<span id="paddle::BlockExpandLayer::imgSizeW___s"></span><span class="target" id="paddleclasspaddle_1_1BlockExpandLayer_1a8b8b1fd86729689ebef6ae3b7a6c93e9"></span>size_t <code class="descname">imgSizeW_</code><a class="headerlink" href="#_CPPv2N6paddle16BlockExpandLayer9imgSizeW_E" title="Permalink to this definition">¶</a></dt>
<dd></dd></dl>

<dl class="member">
<dt id="_CPPv2N6paddle16BlockExpandLayer8outputH_E">
<span id="paddle::BlockExpandLayer::outputH___s"></span><span class="target" id="paddleclasspaddle_1_1BlockExpandLayer_1a3279a92dc1756c125213c70711dd7f6f"></span>size_t <code class="descname">outputH_</code><a class="headerlink" href="#_CPPv2N6paddle16BlockExpandLayer8outputH_E" title="Permalink to this definition">¶</a></dt>
<dd></dd></dl>

<dl class="member">
<dt id="_CPPv2N6paddle16BlockExpandLayer8outputW_E">
<span id="paddle::BlockExpandLayer::outputW___s"></span><span class="target" id="paddleclasspaddle_1_1BlockExpandLayer_1a5a6d47d3f491ed5fa25aed434a9790f8"></span>size_t <code class="descname">outputW_</code><a class="headerlink" href="#_CPPv2N6paddle16BlockExpandLayer8outputW_E" title="Permalink to this definition">¶</a></dt>
<dd></dd></dl>

<dl class="member">
<dt id="_CPPv2N6paddle16BlockExpandLayer9channels_E">
<span id="paddle::BlockExpandLayer::channels___s"></span><span class="target" id="paddleclasspaddle_1_1BlockExpandLayer_1a7b71ea330e8b9f5794a1e60c0659664d"></span>size_t <code class="descname">channels_</code><a class="headerlink" href="#_CPPv2N6paddle16BlockExpandLayer9channels_E" title="Permalink to this definition">¶</a></dt>
<dd></dd></dl>

<dl class="member">
<dt id="_CPPv2N6paddle16BlockExpandLayer10outVTrans_E">
<span id="paddle::BlockExpandLayer::outVTrans___MatrixPtr"></span><span class="target" id="paddleclasspaddle_1_1BlockExpandLayer_1a8057c00b222a79b6649bad6442249371"></span><a class="reference internal" href="../../math/matrix/matrix.html#_CPPv2N6paddle9MatrixPtrE" title="paddle::MatrixPtr">MatrixPtr</a> <code class="descname">outVTrans_</code><a class="headerlink" href="#_CPPv2N6paddle16BlockExpandLayer10outVTrans_E" title="Permalink to this definition">¶</a></dt>
<dd><p>auxiliary variable, which saves the transposed output value. </p>
</dd></dl>

</div>
</dd></dl>

</div>
<div class="section" id="expandlayer">
<h2>ExpandLayer<a class="headerlink" href="#expandlayer" title="Permalink to this headline">¶</a></h2>
<dl class="class">
<dt id="_CPPv2N6paddle11ExpandLayerE">
<span id="paddle::ExpandLayer"></span><span class="target" id="paddleclasspaddle_1_1ExpandLayer"></span><em class="property">class </em><code class="descclassname">paddle::</code><code class="descname">ExpandLayer</code><a class="headerlink" href="#_CPPv2N6paddle11ExpandLayerE" title="Permalink to this definition">¶</a></dt>
<dd><p>A layer for &#8220;Expand Dense data or (sequence data where the length of each
sequence is one) to sequence data.&#8221;</p>
<p>It should have exactly 2 input, one for data, one for size:<ul class="simple">
<li>first one for data<ul>
<li>If ExpandLevel = kNonSeq: dense data</li>
<li>If ExpandLevel = kSeq: sequence data where the length of each sequence is one</li>
</ul>
</li>
<li>second one only for sequence info<ul>
<li>should be sequence data with or without sub-sequence.</li>
</ul>
</li>
</ul>
</p>
<p>And the output size is the batch size(not instances) of second input.</p>
<p>The config file api is expand_layer. </p>
5344
<p>Inherits from <a class="reference internal" href="#paddleclasspaddle_1_1Layer"><span class="std std-ref">paddle::Layer</span></a></p>
5345
<div class="breathe-sectiondef docutils container">
Y
Yu Yang 已提交
5346 5347 5348 5349 5350 5351 5352 5353 5354 5355 5356 5357 5358
<p class="breathe-sectiondef-title rubric">Public Functions</p>
<dl class="function">
<dt id="_CPPv2N6paddle11ExpandLayer11ExpandLayerERK11LayerConfig">
<span id="paddle::ExpandLayer::ExpandLayer__LayerConfigCR"></span><span class="target" id="paddleclasspaddle_1_1ExpandLayer_1a9261d15b0a345292d7bbbb5fd46925d3"></span><code class="descname">ExpandLayer</code><span class="sig-paren">(</span><em class="property">const</em> LayerConfig &amp;<em>config</em><span class="sig-paren">)</span><a class="headerlink" href="#_CPPv2N6paddle11ExpandLayer11ExpandLayerERK11LayerConfig" title="Permalink to this definition">¶</a></dt>
<dd></dd></dl>

<dl class="function">
<dt id="_CPPv2N6paddle11ExpandLayerD0Ev">
<span id="paddle::ExpandLayer::~ExpandLayer"></span><span class="target" id="paddleclasspaddle_1_1ExpandLayer_1a47f7522624e50fd88a06e03f7f47aa9e"></span><code class="descname">~ExpandLayer</code><span class="sig-paren">(</span><span class="sig-paren">)</span><a class="headerlink" href="#_CPPv2N6paddle11ExpandLayerD0Ev" title="Permalink to this definition">¶</a></dt>
<dd></dd></dl>

<dl class="function">
<dt id="_CPPv2N6paddle11ExpandLayer4initERK8LayerMapRK12ParameterMap">
5359
<span id="paddle::ExpandLayer::init__LayerMapCR.ParameterMapCR"></span><span class="target" id="paddleclasspaddle_1_1ExpandLayer_1a3a876f26d8285039717a84400216f18e"></span>bool <code class="descname">init</code><span class="sig-paren">(</span><em class="property">const</em> LayerMap &amp;<em>layerMap</em>, <em class="property">const</em> <a class="reference internal" href="../../parameter/parameter/parameter.html#_CPPv2N6paddle12ParameterMapE" title="paddle::ParameterMap">ParameterMap</a> &amp;<em>parameterMap</em><span class="sig-paren">)</span><a class="headerlink" href="#_CPPv2N6paddle11ExpandLayer4initERK8LayerMapRK12ParameterMap" title="Permalink to this definition">¶</a></dt>
Y
Yu Yang 已提交
5360 5361 5362 5363 5364
<dd><p>Intialization. For example, adding input layers from layerMap and parameterMap. </p>
</dd></dl>

<dl class="function">
<dt id="_CPPv2N6paddle11ExpandLayer7forwardE8PassType">
5365
<span id="paddle::ExpandLayer::forward__PassType"></span><span class="target" id="paddleclasspaddle_1_1ExpandLayer_1acbc71a3ef24a6f3234c616684dc0fbbe"></span>void <code class="descname">forward</code><span class="sig-paren">(</span>PassType <em>passType</em><span class="sig-paren">)</span><a class="headerlink" href="#_CPPv2N6paddle11ExpandLayer7forwardE8PassType" title="Permalink to this definition">¶</a></dt>
Y
Yu Yang 已提交
5366 5367 5368 5369 5370
<dd><p>Forward propagation. All inherited implementation should call Layer::foward() function. </p>
</dd></dl>

<dl class="function">
<dt id="_CPPv2N6paddle11ExpandLayer8backwardERK14UpdateCallback">
5371
<span id="paddle::ExpandLayer::backward__UpdateCallbackCR"></span><span class="target" id="paddleclasspaddle_1_1ExpandLayer_1ae8bb32b7c4a9cba0a6bf2bc4ccf7a7f2"></span>void <code class="descname">backward</code><span class="sig-paren">(</span><em class="property">const</em> <a class="reference internal" href="../../parameter/parameter/parameter.html#_CPPv2N6paddle14UpdateCallbackE" title="paddle::UpdateCallback">UpdateCallback</a> &amp;<em>callback</em> = nullptr<span class="sig-paren">)</span><a class="headerlink" href="#_CPPv2N6paddle11ExpandLayer8backwardERK14UpdateCallback" title="Permalink to this definition">¶</a></dt>
5372
<dd><p>Backward propagation. Should only be called after <a class="reference internal" href="#paddleclasspaddle_1_1Layer_1a12386b3f20dd731e7ceaa2c61667cbe1"><span class="std std-ref">Layer::forward()</span></a> function. </p>
Y
Yu Yang 已提交
5373 5374 5375
</dd></dl>

</div>
5376
<div class="breathe-sectiondef docutils container">
Y
Yu Yang 已提交
5377 5378 5379 5380 5381 5382 5383 5384 5385 5386 5387 5388 5389 5390 5391 5392 5393 5394 5395
<p class="breathe-sectiondef-title rubric">Protected Types</p>
<dl class="type">
<dt id="_CPPv2N6paddle11ExpandLayer11ExpandLevelE">
<span id="paddle::ExpandLayer::ExpandLevel"></span><span class="target" id="paddleclasspaddle_1_1ExpandLayer_1a4eaa3d5b6a810d3e5d815da260adc68e"></span><em class="property">enum </em><code class="descname">ExpandLevel</code><a class="headerlink" href="#_CPPv2N6paddle11ExpandLayer11ExpandLevelE" title="Permalink to this definition">¶</a></dt>
<dd><p>if input[0] is dense data, ExpandLevel=kNonSeq; if input[0] is sequence data, ExpandLevel=kSeq </p>
<p><em>Values:</em></p>
<dl class="member">
<dt id="_CPPv2N6paddle11ExpandLayer7kNonSeqE">
<span id="paddle::ExpandLayer::kNonSeq"></span><span class="target" id="paddleclasspaddle_1_1ExpandLayer_1a4eaa3d5b6a810d3e5d815da260adc68ea2628cd9625a805b9586db2b6d7098a75"></span><code class="descname">kNonSeq</code> = 0<a class="headerlink" href="#_CPPv2N6paddle11ExpandLayer7kNonSeqE" title="Permalink to this definition">¶</a></dt>
<dd></dd></dl>

<dl class="member">
<dt id="_CPPv2N6paddle11ExpandLayer4kSeqE">
<span id="paddle::ExpandLayer::kSeq"></span><span class="target" id="paddleclasspaddle_1_1ExpandLayer_1a4eaa3d5b6a810d3e5d815da260adc68eab96faec9300a49c4049a186aa3aa0163"></span><code class="descname">kSeq</code> = 1<a class="headerlink" href="#_CPPv2N6paddle11ExpandLayer4kSeqE" title="Permalink to this definition">¶</a></dt>
<dd></dd></dl>

</dd></dl>

</div>
5396
<div class="breathe-sectiondef docutils container">
Y
Yu Yang 已提交
5397 5398 5399 5400 5401 5402 5403 5404 5405 5406 5407 5408
<p class="breathe-sectiondef-title rubric">Protected Attributes</p>
<dl class="member">
<dt id="_CPPv2N6paddle11ExpandLayer7biases_E">
<span id="paddle::ExpandLayer::biases___std::unique_ptr:Weight:"></span><span class="target" id="paddleclasspaddle_1_1ExpandLayer_1adc8a18258be2a6926d67b79e8960a5a0"></span>std::unique_ptr&lt;<a class="reference internal" href="../../parameter/parameter/parameter.html#_CPPv2N6paddle6WeightE" title="paddle::Weight">Weight</a>&gt; <code class="descname">biases_</code><a class="headerlink" href="#_CPPv2N6paddle11ExpandLayer7biases_E" title="Permalink to this definition">¶</a></dt>
<dd></dd></dl>

<dl class="member">
<dt id="_CPPv2N6paddle11ExpandLayer5type_E">
<span id="paddle::ExpandLayer::type___i"></span><span class="target" id="paddleclasspaddle_1_1ExpandLayer_1a936cb98b0488cede1d8aca8e48364aec"></span>int <code class="descname">type_</code><a class="headerlink" href="#_CPPv2N6paddle11ExpandLayer5type_E" title="Permalink to this definition">¶</a></dt>
<dd><p>store the ExpandLevel </p>
</dd></dl>

5409 5410
<dl class="member">
<dt id="_CPPv2N6paddle11ExpandLayer16expandStartsPos_E">
5411 5412
<span id="paddle::ExpandLayer::expandStartsPos___ICpuGpuVectorPtr"></span><span class="target" id="paddleclasspaddle_1_1ExpandLayer_1a4243425f33452a5d1ac468d257ce111a"></span><a class="reference internal" href="../../math/matrix/matrix.html#_CPPv2N6paddle16ICpuGpuVectorPtrE" title="paddle::ICpuGpuVectorPtr">ICpuGpuVectorPtr</a> <code class="descname">expandStartsPos_</code><a class="headerlink" href="#_CPPv2N6paddle11ExpandLayer16expandStartsPos_E" title="Permalink to this definition">¶</a></dt>
<dd><p>expanded sequenceStartPositions or subSequenceStartPositions of input[1] </p>
5413 5414
</dd></dl>

Y
Yu Yang 已提交
5415 5416 5417 5418 5419 5420 5421 5422 5423 5424 5425 5426 5427 5428
</div>
</dd></dl>

</div>
<div class="section" id="featuremapexpandlayer">
<h2>FeatureMapExpandLayer<a class="headerlink" href="#featuremapexpandlayer" title="Permalink to this headline">¶</a></h2>
<dl class="class">
<dt id="_CPPv2N6paddle21FeatureMapExpandLayerE">
<span id="paddle::FeatureMapExpandLayer"></span><span class="target" id="paddleclasspaddle_1_1FeatureMapExpandLayer"></span><em class="property">class </em><code class="descclassname">paddle::</code><code class="descname">FeatureMapExpandLayer</code><a class="headerlink" href="#_CPPv2N6paddle21FeatureMapExpandLayerE" title="Permalink to this definition">¶</a></dt>
<dd><p>A layer for expanding a batch of images to feature maps. Each data of the input is a 2 dimensional matrix. Each element of the matrix is replicated num_filters times to create a feature map with num_filters channels. </p>
<p><ul class="simple">
<li>Input: Input one should be dense image data.</li>
<li>Output: expanded fature maps. <div class="math">
\[ y.row[i] = x.row[i \mod x.width], i = 0,1,..., (x.width * num\_filters - 1) \]</div>
5429
 For example, num_filters = 4: <div class="highlight-default"><div class="highlight"><pre><span></span><span class="n">x</span> <span class="o">=</span> <span class="p">[</span><span class="n">a1</span><span class="p">,</span><span class="n">a2</span><span class="p">;</span>
5430 5431 5432
     <span class="n">b1</span><span class="p">,</span><span class="n">b2</span><span class="p">]</span>
<span class="n">y</span> <span class="o">=</span> <span class="p">[</span><span class="n">a1</span><span class="p">,</span> <span class="n">a2</span><span class="p">,</span> <span class="n">a1</span><span class="p">,</span> <span class="n">a2</span><span class="p">,</span> <span class="n">a1</span><span class="p">,</span> <span class="n">a2</span><span class="p">,</span> <span class="n">a1</span><span class="p">,</span> <span class="n">a2</span><span class="p">;</span>
     <span class="n">b1</span><span class="p">,</span> <span class="n">b2</span><span class="p">,</span> <span class="n">b1</span><span class="p">,</span> <span class="n">b2</span><span class="p">,</span> <span class="n">b1</span><span class="p">,</span> <span class="n">b2</span><span class="p">,</span> <span class="n">b1</span><span class="p">,</span> <span class="n">b2</span><span class="p">;]</span>
Y
Yu Yang 已提交
5433 5434
</pre></div>
</div>
5435
 </li>
Y
Yu Yang 已提交
5436 5437
</ul>
</p>
5438
<p>Inherits from <a class="reference internal" href="#paddleclasspaddle_1_1Layer"><span class="std std-ref">paddle::Layer</span></a></p>
5439
<div class="breathe-sectiondef docutils container">
Y
Yu Yang 已提交
5440 5441 5442 5443 5444 5445 5446 5447 5448 5449 5450 5451 5452
<p class="breathe-sectiondef-title rubric">Public Functions</p>
<dl class="function">
<dt id="_CPPv2N6paddle21FeatureMapExpandLayer21FeatureMapExpandLayerERK11LayerConfig">
<span id="paddle::FeatureMapExpandLayer::FeatureMapExpandLayer__LayerConfigCR"></span><span class="target" id="paddleclasspaddle_1_1FeatureMapExpandLayer_1ae59c0980e16e5a2b2708612560223a9c"></span><code class="descname">FeatureMapExpandLayer</code><span class="sig-paren">(</span><em class="property">const</em> LayerConfig &amp;<em>config</em><span class="sig-paren">)</span><a class="headerlink" href="#_CPPv2N6paddle21FeatureMapExpandLayer21FeatureMapExpandLayerERK11LayerConfig" title="Permalink to this definition">¶</a></dt>
<dd></dd></dl>

<dl class="function">
<dt id="_CPPv2N6paddle21FeatureMapExpandLayerD0Ev">
<span id="paddle::FeatureMapExpandLayer::~FeatureMapExpandLayer"></span><span class="target" id="paddleclasspaddle_1_1FeatureMapExpandLayer_1a117e37d0e9a4ef4e08d355f050d8c21d"></span><code class="descname">~FeatureMapExpandLayer</code><span class="sig-paren">(</span><span class="sig-paren">)</span><a class="headerlink" href="#_CPPv2N6paddle21FeatureMapExpandLayerD0Ev" title="Permalink to this definition">¶</a></dt>
<dd></dd></dl>

<dl class="function">
<dt id="_CPPv2N6paddle21FeatureMapExpandLayer4initERK8LayerMapRK12ParameterMap">
5453
<span id="paddle::FeatureMapExpandLayer::init__LayerMapCR.ParameterMapCR"></span><span class="target" id="paddleclasspaddle_1_1FeatureMapExpandLayer_1a93e0f4f95d00854f63d6c5d6ab29357c"></span>bool <code class="descname">init</code><span class="sig-paren">(</span><em class="property">const</em> LayerMap &amp;<em>layerMap</em>, <em class="property">const</em> <a class="reference internal" href="../../parameter/parameter/parameter.html#_CPPv2N6paddle12ParameterMapE" title="paddle::ParameterMap">ParameterMap</a> &amp;<em>parameterMap</em><span class="sig-paren">)</span><a class="headerlink" href="#_CPPv2N6paddle21FeatureMapExpandLayer4initERK8LayerMapRK12ParameterMap" title="Permalink to this definition">¶</a></dt>
Y
Yu Yang 已提交
5454 5455 5456 5457 5458
<dd><p>Intialization. For example, adding input layers from layerMap and parameterMap. </p>
</dd></dl>

<dl class="function">
<dt id="_CPPv2N6paddle21FeatureMapExpandLayer7forwardE8PassType">
5459
<span id="paddle::FeatureMapExpandLayer::forward__PassType"></span><span class="target" id="paddleclasspaddle_1_1FeatureMapExpandLayer_1ad8e419d32ca52ea3ab57e02b3415b3fc"></span>void <code class="descname">forward</code><span class="sig-paren">(</span>PassType <em>passType</em><span class="sig-paren">)</span><a class="headerlink" href="#_CPPv2N6paddle21FeatureMapExpandLayer7forwardE8PassType" title="Permalink to this definition">¶</a></dt>
Y
Yu Yang 已提交
5460 5461 5462 5463 5464
<dd><p>Forward propagation. All inherited implementation should call Layer::foward() function. </p>
</dd></dl>

<dl class="function">
<dt id="_CPPv2N6paddle21FeatureMapExpandLayer8backwardERK14UpdateCallback">
5465
<span id="paddle::FeatureMapExpandLayer::backward__UpdateCallbackCR"></span><span class="target" id="paddleclasspaddle_1_1FeatureMapExpandLayer_1a985eefbe25aa97470660d068be94c920"></span>void <code class="descname">backward</code><span class="sig-paren">(</span><em class="property">const</em> <a class="reference internal" href="../../parameter/parameter/parameter.html#_CPPv2N6paddle14UpdateCallbackE" title="paddle::UpdateCallback">UpdateCallback</a> &amp;<em>callback</em> = nullptr<span class="sig-paren">)</span><a class="headerlink" href="#_CPPv2N6paddle21FeatureMapExpandLayer8backwardERK14UpdateCallback" title="Permalink to this definition">¶</a></dt>
5466
<dd><p>Backward propagation. Should only be called after <a class="reference internal" href="#paddleclasspaddle_1_1Layer_1a12386b3f20dd731e7ceaa2c61667cbe1"><span class="std std-ref">Layer::forward()</span></a> function. </p>
Y
Yu Yang 已提交
5467 5468 5469 5470 5471 5472 5473 5474 5475 5476 5477
</dd></dl>

</div>
</dd></dl>

</div>
<div class="section" id="resizelayer">
<h2>ResizeLayer<a class="headerlink" href="#resizelayer" title="Permalink to this headline">¶</a></h2>
<dl class="class">
<dt id="_CPPv2N6paddle11ResizeLayerE">
<span id="paddle::ResizeLayer"></span><span class="target" id="paddleclasspaddle_1_1ResizeLayer"></span><em class="property">class </em><code class="descclassname">paddle::</code><code class="descname">ResizeLayer</code><a class="headerlink" href="#_CPPv2N6paddle11ResizeLayerE" title="Permalink to this definition">¶</a></dt>
Y
Yu Yang 已提交
5478 5479 5480 5481 5482 5483
<dd><p>A layer for resizing a minibatch matrix h*w to h&#8217;*w&#8217;. </p>
<p><dl class="docutils">
<dt><strong>Note</strong></dt>
<dd>origin matrix height * witdth) resize matrix: (height * width / size) * size </dd>
</dl>
</p>
5484
<p>Inherits from <a class="reference internal" href="#paddleclasspaddle_1_1Layer"><span class="std std-ref">paddle::Layer</span></a></p>
5485
<div class="breathe-sectiondef docutils container">
Y
Yu Yang 已提交
5486 5487 5488 5489 5490 5491 5492 5493
<p class="breathe-sectiondef-title rubric">Public Functions</p>
<dl class="function">
<dt id="_CPPv2N6paddle11ResizeLayer11ResizeLayerERK11LayerConfig">
<span id="paddle::ResizeLayer::ResizeLayer__LayerConfigCR"></span><span class="target" id="paddleclasspaddle_1_1ResizeLayer_1ab76d58f1929f0ca8d25614d28ab48607"></span><code class="descname">ResizeLayer</code><span class="sig-paren">(</span><em class="property">const</em> LayerConfig &amp;<em>config</em><span class="sig-paren">)</span><a class="headerlink" href="#_CPPv2N6paddle11ResizeLayer11ResizeLayerERK11LayerConfig" title="Permalink to this definition">¶</a></dt>
<dd></dd></dl>

<dl class="function">
<dt id="_CPPv2N6paddle11ResizeLayer4initERK8LayerMapRK12ParameterMap">
5494
<span id="paddle::ResizeLayer::init__LayerMapCR.ParameterMapCR"></span><span class="target" id="paddleclasspaddle_1_1ResizeLayer_1a30d2249089640d51ed4f79ab28f74bc8"></span>bool <code class="descname">init</code><span class="sig-paren">(</span><em class="property">const</em> LayerMap &amp;<em>layerMap</em>, <em class="property">const</em> <a class="reference internal" href="../../parameter/parameter/parameter.html#_CPPv2N6paddle12ParameterMapE" title="paddle::ParameterMap">ParameterMap</a> &amp;<em>parameterMap</em><span class="sig-paren">)</span><a class="headerlink" href="#_CPPv2N6paddle11ResizeLayer4initERK8LayerMapRK12ParameterMap" title="Permalink to this definition">¶</a></dt>
Y
Yu Yang 已提交
5495 5496 5497 5498 5499
<dd><p>Intialization. For example, adding input layers from layerMap and parameterMap. </p>
</dd></dl>

<dl class="function">
<dt id="_CPPv2N6paddle11ResizeLayer7forwardE8PassType">
5500
<span id="paddle::ResizeLayer::forward__PassType"></span><span class="target" id="paddleclasspaddle_1_1ResizeLayer_1a74b123c4bb24a0c86b055a8fd2a6014d"></span>void <code class="descname">forward</code><span class="sig-paren">(</span>PassType <em>passType</em><span class="sig-paren">)</span><a class="headerlink" href="#_CPPv2N6paddle11ResizeLayer7forwardE8PassType" title="Permalink to this definition">¶</a></dt>
Y
Yu Yang 已提交
5501 5502 5503 5504 5505
<dd><p>Forward propagation. All inherited implementation should call Layer::foward() function. </p>
</dd></dl>

<dl class="function">
<dt id="_CPPv2N6paddle11ResizeLayer8backwardERK14UpdateCallback">
5506
<span id="paddle::ResizeLayer::backward__UpdateCallbackCR"></span><span class="target" id="paddleclasspaddle_1_1ResizeLayer_1aa077c0814161c92fe8faf8601f11c5c6"></span>void <code class="descname">backward</code><span class="sig-paren">(</span><em class="property">const</em> <a class="reference internal" href="../../parameter/parameter/parameter.html#_CPPv2N6paddle14UpdateCallbackE" title="paddle::UpdateCallback">UpdateCallback</a> &amp;<em>callback</em><span class="sig-paren">)</span><a class="headerlink" href="#_CPPv2N6paddle11ResizeLayer8backwardERK14UpdateCallback" title="Permalink to this definition">¶</a></dt>
5507
<dd><p>Backward propagation. Should only be called after <a class="reference internal" href="#paddleclasspaddle_1_1Layer_1a12386b3f20dd731e7ceaa2c61667cbe1"><span class="std std-ref">Layer::forward()</span></a> function. </p>
Y
Yu Yang 已提交
5508 5509 5510 5511 5512 5513 5514 5515 5516 5517 5518 5519
</dd></dl>

</div>
</dd></dl>

</div>
<div class="section" id="sequencereshapelayer">
<h2>SequenceReshapeLayer<a class="headerlink" href="#sequencereshapelayer" title="Permalink to this headline">¶</a></h2>
<dl class="class">
<dt id="_CPPv2N6paddle20SequenceReshapeLayerE">
<span id="paddle::SequenceReshapeLayer"></span><span class="target" id="paddleclasspaddle_1_1SequenceReshapeLayer"></span><em class="property">class </em><code class="descclassname">paddle::</code><code class="descname">SequenceReshapeLayer</code><a class="headerlink" href="#_CPPv2N6paddle20SequenceReshapeLayerE" title="Permalink to this definition">¶</a></dt>
<dd><p>A layer for reshaping the sequence Input: a sequence Output: a sequence </p>
5520
<p>Inherits from <a class="reference internal" href="#paddleclasspaddle_1_1Layer"><span class="std std-ref">paddle::Layer</span></a></p>
5521
<div class="breathe-sectiondef docutils container">
Y
Yu Yang 已提交
5522 5523 5524 5525 5526 5527 5528 5529 5530 5531 5532 5533 5534
<p class="breathe-sectiondef-title rubric">Public Functions</p>
<dl class="function">
<dt id="_CPPv2N6paddle20SequenceReshapeLayer20SequenceReshapeLayerERK11LayerConfig">
<span id="paddle::SequenceReshapeLayer::SequenceReshapeLayer__LayerConfigCR"></span><span class="target" id="paddleclasspaddle_1_1SequenceReshapeLayer_1a7042a5cdc9f17ac37fb46913e2a1bb21"></span><code class="descname">SequenceReshapeLayer</code><span class="sig-paren">(</span><em class="property">const</em> LayerConfig &amp;<em>config</em><span class="sig-paren">)</span><a class="headerlink" href="#_CPPv2N6paddle20SequenceReshapeLayer20SequenceReshapeLayerERK11LayerConfig" title="Permalink to this definition">¶</a></dt>
<dd></dd></dl>

<dl class="function">
<dt id="_CPPv2N6paddle20SequenceReshapeLayerD0Ev">
<span id="paddle::SequenceReshapeLayer::~SequenceReshapeLayer"></span><span class="target" id="paddleclasspaddle_1_1SequenceReshapeLayer_1a2e022d9173bdf56db651a71d8629e909"></span><code class="descname">~SequenceReshapeLayer</code><span class="sig-paren">(</span><span class="sig-paren">)</span><a class="headerlink" href="#_CPPv2N6paddle20SequenceReshapeLayerD0Ev" title="Permalink to this definition">¶</a></dt>
<dd></dd></dl>

<dl class="function">
<dt id="_CPPv2N6paddle20SequenceReshapeLayer4initERK8LayerMapRK12ParameterMap">
5535
<span id="paddle::SequenceReshapeLayer::init__LayerMapCR.ParameterMapCR"></span><span class="target" id="paddleclasspaddle_1_1SequenceReshapeLayer_1a1eed5a9d07caba32aa38d7a07dcb44a4"></span>bool <code class="descname">init</code><span class="sig-paren">(</span><em class="property">const</em> LayerMap &amp;<em>layerMap</em>, <em class="property">const</em> <a class="reference internal" href="../../parameter/parameter/parameter.html#_CPPv2N6paddle12ParameterMapE" title="paddle::ParameterMap">ParameterMap</a> &amp;<em>parameterMap</em><span class="sig-paren">)</span><a class="headerlink" href="#_CPPv2N6paddle20SequenceReshapeLayer4initERK8LayerMapRK12ParameterMap" title="Permalink to this definition">¶</a></dt>
Y
Yu Yang 已提交
5536 5537 5538 5539 5540
<dd><p>Intialization. For example, adding input layers from layerMap and parameterMap. </p>
</dd></dl>

<dl class="function">
<dt id="_CPPv2N6paddle20SequenceReshapeLayer7forwardE8PassType">
5541
<span id="paddle::SequenceReshapeLayer::forward__PassType"></span><span class="target" id="paddleclasspaddle_1_1SequenceReshapeLayer_1a6410cdf80e69567479cff69ee05d7c13"></span>void <code class="descname">forward</code><span class="sig-paren">(</span>PassType <em>passType</em><span class="sig-paren">)</span><a class="headerlink" href="#_CPPv2N6paddle20SequenceReshapeLayer7forwardE8PassType" title="Permalink to this definition">¶</a></dt>
Y
Yu Yang 已提交
5542 5543 5544 5545 5546
<dd><p>Forward propagation. All inherited implementation should call Layer::foward() function. </p>
</dd></dl>

<dl class="function">
<dt id="_CPPv2N6paddle20SequenceReshapeLayer8backwardERK14UpdateCallback">
5547
<span id="paddle::SequenceReshapeLayer::backward__UpdateCallbackCR"></span><span class="target" id="paddleclasspaddle_1_1SequenceReshapeLayer_1aac3b09eb80fd9e97baafc2dccf51d77b"></span>void <code class="descname">backward</code><span class="sig-paren">(</span><em class="property">const</em> <a class="reference internal" href="../../parameter/parameter/parameter.html#_CPPv2N6paddle14UpdateCallbackE" title="paddle::UpdateCallback">UpdateCallback</a> &amp;<em>callback</em> = nullptr<span class="sig-paren">)</span><a class="headerlink" href="#_CPPv2N6paddle20SequenceReshapeLayer8backwardERK14UpdateCallback" title="Permalink to this definition">¶</a></dt>
5548
<dd><p>Backward propagation. Should only be called after <a class="reference internal" href="#paddleclasspaddle_1_1Layer_1a12386b3f20dd731e7ceaa2c61667cbe1"><span class="std std-ref">Layer::forward()</span></a> function. </p>
Y
Yu Yang 已提交
5549 5550 5551
</dd></dl>

</div>
5552
<div class="breathe-sectiondef docutils container">
Y
Yu Yang 已提交
5553 5554 5555 5556 5557 5558 5559 5560 5561 5562 5563 5564 5565 5566 5567 5568 5569 5570 5571 5572 5573 5574 5575 5576 5577 5578 5579
<p class="breathe-sectiondef-title rubric">Protected Attributes</p>
<dl class="member">
<dt id="_CPPv2N6paddle20SequenceReshapeLayer7biases_E">
<span id="paddle::SequenceReshapeLayer::biases___std::unique_ptr:Weight:"></span><span class="target" id="paddleclasspaddle_1_1SequenceReshapeLayer_1ad8e06f5ef59b054f87a1309a33ba4fb8"></span>std::unique_ptr&lt;<a class="reference internal" href="../../parameter/parameter/parameter.html#_CPPv2N6paddle6WeightE" title="paddle::Weight">Weight</a>&gt; <code class="descname">biases_</code><a class="headerlink" href="#_CPPv2N6paddle20SequenceReshapeLayer7biases_E" title="Permalink to this definition">¶</a></dt>
<dd></dd></dl>

<dl class="member">
<dt id="_CPPv2N6paddle20SequenceReshapeLayer18reshapedOutputGradE">
<span id="paddle::SequenceReshapeLayer::reshapedOutputGrad__MatrixPtr"></span><span class="target" id="paddleclasspaddle_1_1SequenceReshapeLayer_1a0ccc526efd66fd559b8fd2aefa68510f"></span><a class="reference internal" href="../../math/matrix/matrix.html#_CPPv2N6paddle9MatrixPtrE" title="paddle::MatrixPtr">MatrixPtr</a> <code class="descname">reshapedOutputGrad</code><a class="headerlink" href="#_CPPv2N6paddle20SequenceReshapeLayer18reshapedOutputGradE" title="Permalink to this definition">¶</a></dt>
<dd></dd></dl>

</div>
</dd></dl>

</div>
</div>
<div class="section" id="math-layers">
<h1>Math Layers<a class="headerlink" href="#math-layers" title="Permalink to this headline">¶</a></h1>
<div class="section" id="addtolayer">
<h2>AddtoLayer<a class="headerlink" href="#addtolayer" title="Permalink to this headline">¶</a></h2>
<dl class="class">
<dt id="_CPPv2N6paddle10AddtoLayerE">
<span id="paddle::AddtoLayer"></span><span class="target" id="paddleclasspaddle_1_1AddtoLayer"></span><em class="property">class </em><code class="descclassname">paddle::</code><code class="descname">AddtoLayer</code><a class="headerlink" href="#_CPPv2N6paddle10AddtoLayerE" title="Permalink to this definition">¶</a></dt>
<dd><p>This layer just simply add all input layers together, then activate the sum inputs. Each input of this layer should be the same size, which is also the output size of this layer. <div class="math">
\[ y=f(\sum_{i}x_i + b) \]</div>
 where <span class="math">\(y\)</span> is output, <span class="math">\(x\)</span> is input, <span class="math">\(b\)</span> is bias, and <span class="math">\(f\)</span> is activation function.</p>
<p>The config file api is addto_layer. </p>
5580
<p>Inherits from <a class="reference internal" href="#paddleclasspaddle_1_1Layer"><span class="std std-ref">paddle::Layer</span></a></p>
5581
<div class="breathe-sectiondef docutils container">
Y
Yu Yang 已提交
5582 5583 5584 5585 5586 5587 5588 5589 5590 5591 5592 5593 5594
<p class="breathe-sectiondef-title rubric">Public Functions</p>
<dl class="function">
<dt id="_CPPv2N6paddle10AddtoLayer10AddtoLayerERK11LayerConfig">
<span id="paddle::AddtoLayer::AddtoLayer__LayerConfigCR"></span><span class="target" id="paddleclasspaddle_1_1AddtoLayer_1acd565fad01b72f2300aafa7334b0d9a3"></span><code class="descname">AddtoLayer</code><span class="sig-paren">(</span><em class="property">const</em> LayerConfig &amp;<em>config</em><span class="sig-paren">)</span><a class="headerlink" href="#_CPPv2N6paddle10AddtoLayer10AddtoLayerERK11LayerConfig" title="Permalink to this definition">¶</a></dt>
<dd></dd></dl>

<dl class="function">
<dt id="_CPPv2N6paddle10AddtoLayerD0Ev">
<span id="paddle::AddtoLayer::~AddtoLayer"></span><span class="target" id="paddleclasspaddle_1_1AddtoLayer_1a265a8137ec19ead5ced650ef54186275"></span><code class="descname">~AddtoLayer</code><span class="sig-paren">(</span><span class="sig-paren">)</span><a class="headerlink" href="#_CPPv2N6paddle10AddtoLayerD0Ev" title="Permalink to this definition">¶</a></dt>
<dd></dd></dl>

<dl class="function">
<dt id="_CPPv2N6paddle10AddtoLayer4initERK8LayerMapRK12ParameterMap">
5595
<span id="paddle::AddtoLayer::init__LayerMapCR.ParameterMapCR"></span><span class="target" id="paddleclasspaddle_1_1AddtoLayer_1a5a16c4dc160d02807e33bf46eee0facf"></span>bool <code class="descname">init</code><span class="sig-paren">(</span><em class="property">const</em> LayerMap &amp;<em>layerMap</em>, <em class="property">const</em> <a class="reference internal" href="../../parameter/parameter/parameter.html#_CPPv2N6paddle12ParameterMapE" title="paddle::ParameterMap">ParameterMap</a> &amp;<em>parameterMap</em><span class="sig-paren">)</span><a class="headerlink" href="#_CPPv2N6paddle10AddtoLayer4initERK8LayerMapRK12ParameterMap" title="Permalink to this definition">¶</a></dt>
5596
<dd><p>Intialization of <a class="reference internal" href="#paddleclasspaddle_1_1AddtoLayer"><span class="std std-ref">AddtoLayer</span></a>. </p>
Y
Yu Yang 已提交
5597 5598 5599 5600
</dd></dl>

<dl class="function">
<dt id="_CPPv2N6paddle10AddtoLayer7forwardE8PassType">
5601
<span id="paddle::AddtoLayer::forward__PassType"></span><span class="target" id="paddleclasspaddle_1_1AddtoLayer_1adf8be07621caf1026ab42937f66c91ba"></span>void <code class="descname">forward</code><span class="sig-paren">(</span>PassType <em>passType</em><span class="sig-paren">)</span><a class="headerlink" href="#_CPPv2N6paddle10AddtoLayer7forwardE8PassType" title="Permalink to this definition">¶</a></dt>
Y
Yu Yang 已提交
5602 5603 5604 5605 5606 5607 5608 5609 5610
<dd><p>Forward propagation. <dl class="docutils">
<dt><strong>Note</strong></dt>
<dd>There is no weight matrix for each input, because it just a simple add operation. </dd>
</dl>
</p>
</dd></dl>

<dl class="function">
<dt id="_CPPv2N6paddle10AddtoLayer8backwardERK14UpdateCallback">
5611
<span id="paddle::AddtoLayer::backward__UpdateCallbackCR"></span><span class="target" id="paddleclasspaddle_1_1AddtoLayer_1aa68d6152d0bc4b8aec7a6e7a8683a38a"></span>void <code class="descname">backward</code><span class="sig-paren">(</span><em class="property">const</em> <a class="reference internal" href="../../parameter/parameter/parameter.html#_CPPv2N6paddle14UpdateCallbackE" title="paddle::UpdateCallback">UpdateCallback</a> &amp;<em>callback</em> = nullptr<span class="sig-paren">)</span><a class="headerlink" href="#_CPPv2N6paddle10AddtoLayer8backwardERK14UpdateCallback" title="Permalink to this definition">¶</a></dt>
Y
Yu Yang 已提交
5612 5613 5614 5615
<dd><p>Backward propagation. </p>
</dd></dl>

</div>
5616
<div class="breathe-sectiondef docutils container">
Y
Yu Yang 已提交
5617 5618 5619 5620 5621 5622 5623 5624 5625 5626 5627 5628 5629 5630 5631
<p class="breathe-sectiondef-title rubric">Protected Attributes</p>
<dl class="member">
<dt id="_CPPv2N6paddle10AddtoLayer7biases_E">
<span id="paddle::AddtoLayer::biases___std::unique_ptr:Weight:"></span><span class="target" id="paddleclasspaddle_1_1AddtoLayer_1a721777e0ae048877047b6becba08da74"></span>std::unique_ptr&lt;<a class="reference internal" href="../../parameter/parameter/parameter.html#_CPPv2N6paddle6WeightE" title="paddle::Weight">Weight</a>&gt; <code class="descname">biases_</code><a class="headerlink" href="#_CPPv2N6paddle10AddtoLayer7biases_E" title="Permalink to this definition">¶</a></dt>
<dd></dd></dl>

</div>
</dd></dl>

</div>
<div class="section" id="convexcombinationlayer">
<h2>ConvexCombinationLayer<a class="headerlink" href="#convexcombinationlayer" title="Permalink to this headline">¶</a></h2>
<dl class="class">
<dt id="_CPPv2N6paddle22ConvexCombinationLayerE">
<span id="paddle::ConvexCombinationLayer"></span><span class="target" id="paddleclasspaddle_1_1ConvexCombinationLayer"></span><em class="property">class </em><code class="descclassname">paddle::</code><code class="descname">ConvexCombinationLayer</code><a class="headerlink" href="#_CPPv2N6paddle22ConvexCombinationLayerE" title="Permalink to this definition">¶</a></dt>
5632
<dd><p>A layer for weighted sum of vectors, which is used in NEURAL MACHINE TRANSLATION BY JOINTLY LEARNING TO ALIGN AND TRANSLATE. </p>
Y
Yu Yang 已提交
5633
<p><ul class="simple">
5634 5635 5636 5637
<li>Input: the the size of the first input is weightDim, and the size of the second input is weightdim * dataDim.</li>
<li>Output: the sizeof the output is dataDim <div class="math">
\[ out(j) = \sum_{i}(in0(i) * in1(i,j + i * dataDim)), i = 0,1,...,(weightDim-1); j = 0, 1,...,(dataDim-1) \]</div>
 Note that the above computation is for one sample. Multiple samples are processed in one batch.</li>
Y
Yu Yang 已提交
5638 5639
</ul>
</p>
5640 5641
<p>The config file api is linear_comb_layer. </p>
<p>Inherits from <a class="reference internal" href="#paddleclasspaddle_1_1Layer"><span class="std std-ref">paddle::Layer</span></a></p>
5642
<div class="breathe-sectiondef docutils container">
Y
Yu Yang 已提交
5643 5644 5645 5646 5647 5648 5649 5650 5651 5652 5653 5654 5655
<p class="breathe-sectiondef-title rubric">Public Functions</p>
<dl class="function">
<dt id="_CPPv2N6paddle22ConvexCombinationLayer22ConvexCombinationLayerERK11LayerConfig">
<span id="paddle::ConvexCombinationLayer::ConvexCombinationLayer__LayerConfigCR"></span><span class="target" id="paddleclasspaddle_1_1ConvexCombinationLayer_1a5d272b77d1ac3b23745ad4ff1bb62c71"></span><code class="descname">ConvexCombinationLayer</code><span class="sig-paren">(</span><em class="property">const</em> LayerConfig &amp;<em>config</em><span class="sig-paren">)</span><a class="headerlink" href="#_CPPv2N6paddle22ConvexCombinationLayer22ConvexCombinationLayerERK11LayerConfig" title="Permalink to this definition">¶</a></dt>
<dd></dd></dl>

<dl class="function">
<dt id="_CPPv2N6paddle22ConvexCombinationLayerD0Ev">
<span id="paddle::ConvexCombinationLayer::~ConvexCombinationLayer"></span><span class="target" id="paddleclasspaddle_1_1ConvexCombinationLayer_1a3ec56c647eb147457bbf2cf6ee0a7cef"></span><code class="descname">~ConvexCombinationLayer</code><span class="sig-paren">(</span><span class="sig-paren">)</span><a class="headerlink" href="#_CPPv2N6paddle22ConvexCombinationLayerD0Ev" title="Permalink to this definition">¶</a></dt>
<dd></dd></dl>

<dl class="function">
<dt id="_CPPv2N6paddle22ConvexCombinationLayer4initERK8LayerMapRK12ParameterMap">
5656
<span id="paddle::ConvexCombinationLayer::init__LayerMapCR.ParameterMapCR"></span><span class="target" id="paddleclasspaddle_1_1ConvexCombinationLayer_1a97027535635d3aaed1006a5f6bc5897f"></span>bool <code class="descname">init</code><span class="sig-paren">(</span><em class="property">const</em> LayerMap &amp;<em>layerMap</em>, <em class="property">const</em> <a class="reference internal" href="../../parameter/parameter/parameter.html#_CPPv2N6paddle12ParameterMapE" title="paddle::ParameterMap">ParameterMap</a> &amp;<em>parameterMap</em><span class="sig-paren">)</span><a class="headerlink" href="#_CPPv2N6paddle22ConvexCombinationLayer4initERK8LayerMapRK12ParameterMap" title="Permalink to this definition">¶</a></dt>
Y
Yu Yang 已提交
5657 5658 5659 5660 5661
<dd><p>Intialization. For example, adding input layers from layerMap and parameterMap. </p>
</dd></dl>

<dl class="function">
<dt id="_CPPv2N6paddle22ConvexCombinationLayer7forwardE8PassType">
5662
<span id="paddle::ConvexCombinationLayer::forward__PassType"></span><span class="target" id="paddleclasspaddle_1_1ConvexCombinationLayer_1a7563cbb89aa038191ede92bccdd41ef0"></span>void <code class="descname">forward</code><span class="sig-paren">(</span>PassType <em>passType</em><span class="sig-paren">)</span><a class="headerlink" href="#_CPPv2N6paddle22ConvexCombinationLayer7forwardE8PassType" title="Permalink to this definition">¶</a></dt>
Y
Yu Yang 已提交
5663 5664 5665 5666 5667
<dd><p>Forward propagation. All inherited implementation should call Layer::foward() function. </p>
</dd></dl>

<dl class="function">
<dt id="_CPPv2N6paddle22ConvexCombinationLayer8backwardERK14UpdateCallback">
5668
<span id="paddle::ConvexCombinationLayer::backward__UpdateCallbackCR"></span><span class="target" id="paddleclasspaddle_1_1ConvexCombinationLayer_1a7a2b5fa5afc1f6f434b68a64890a6714"></span>void <code class="descname">backward</code><span class="sig-paren">(</span><em class="property">const</em> <a class="reference internal" href="../../parameter/parameter/parameter.html#_CPPv2N6paddle14UpdateCallbackE" title="paddle::UpdateCallback">UpdateCallback</a> &amp;<em>callback</em> = nullptr<span class="sig-paren">)</span><a class="headerlink" href="#_CPPv2N6paddle22ConvexCombinationLayer8backwardERK14UpdateCallback" title="Permalink to this definition">¶</a></dt>
5669
<dd><p>Backward propagation. Should only be called after <a class="reference internal" href="#paddleclasspaddle_1_1Layer_1a12386b3f20dd731e7ceaa2c61667cbe1"><span class="std std-ref">Layer::forward()</span></a> function. </p>
Y
Yu Yang 已提交
5670 5671 5672
</dd></dl>

</div>
5673
<div class="breathe-sectiondef docutils container">
Y
Yu Yang 已提交
5674 5675 5676 5677 5678 5679 5680 5681 5682 5683 5684 5685 5686 5687 5688 5689 5690 5691 5692 5693 5694 5695 5696 5697 5698 5699 5700 5701 5702 5703 5704 5705
<p class="breathe-sectiondef-title rubric">Protected Attributes</p>
<dl class="member">
<dt id="_CPPv2N6paddle22ConvexCombinationLayer7tmpMtx0E">
<span id="paddle::ConvexCombinationLayer::tmpMtx0__MatrixPtr"></span><span class="target" id="paddleclasspaddle_1_1ConvexCombinationLayer_1a2fe15dbcc814c3edf95d8fd124b083f2"></span><a class="reference internal" href="../../math/matrix/matrix.html#_CPPv2N6paddle9MatrixPtrE" title="paddle::MatrixPtr">MatrixPtr</a> <code class="descname">tmpMtx0</code><a class="headerlink" href="#_CPPv2N6paddle22ConvexCombinationLayer7tmpMtx0E" title="Permalink to this definition">¶</a></dt>
<dd><p>A matrix pointer pointing to second input. </p>
</dd></dl>

<dl class="member">
<dt id="_CPPv2N6paddle22ConvexCombinationLayer7tmpRow0E">
<span id="paddle::ConvexCombinationLayer::tmpRow0__MatrixPtr"></span><span class="target" id="paddleclasspaddle_1_1ConvexCombinationLayer_1a4e21a23bfe3f2de2cc7a455901bb8f9e"></span><a class="reference internal" href="../../math/matrix/matrix.html#_CPPv2N6paddle9MatrixPtrE" title="paddle::MatrixPtr">MatrixPtr</a> <code class="descname">tmpRow0</code><a class="headerlink" href="#_CPPv2N6paddle22ConvexCombinationLayer7tmpRow0E" title="Permalink to this definition">¶</a></dt>
<dd><p>A matrix pointer pointing to first input. </p>
</dd></dl>

<dl class="member">
<dt id="_CPPv2N6paddle22ConvexCombinationLayer7tmpRow1E">
<span id="paddle::ConvexCombinationLayer::tmpRow1__MatrixPtr"></span><span class="target" id="paddleclasspaddle_1_1ConvexCombinationLayer_1af73d09c5a1054161cd21e347b1e8aec0"></span><a class="reference internal" href="../../math/matrix/matrix.html#_CPPv2N6paddle9MatrixPtrE" title="paddle::MatrixPtr">MatrixPtr</a> <code class="descname">tmpRow1</code><a class="headerlink" href="#_CPPv2N6paddle22ConvexCombinationLayer7tmpRow1E" title="Permalink to this definition">¶</a></dt>
<dd><p>A matrix pointer pointing to output. </p>
</dd></dl>

</div>
</dd></dl>

</div>
<div class="section" id="interpolationlayer">
<h2>InterpolationLayer<a class="headerlink" href="#interpolationlayer" title="Permalink to this headline">¶</a></h2>
<dl class="class">
<dt id="_CPPv2N6paddle18InterpolationLayerE">
<span id="paddle::InterpolationLayer"></span><span class="target" id="paddleclasspaddle_1_1InterpolationLayer"></span><em class="property">class </em><code class="descclassname">paddle::</code><code class="descname">InterpolationLayer</code><a class="headerlink" href="#_CPPv2N6paddle18InterpolationLayerE" title="Permalink to this definition">¶</a></dt>
<dd><p>A layer for linear interpolation with two inputs, which is used in NEURAL TURING MACHINE. <div class="math">
\[ y.row[i] = w[i] * x_1.row[i] + (1 - w[i]) * x_2.row[i] \]</div>
 where <span class="math">\(x_1\)</span> and <span class="math">\(x_2\)</span> are two (batchSize x dataDim) inputs, <span class="math">\(w\)</span> is (batchSize x 1) weight vector, and <span class="math">\(y\)</span> is (batchSize x dataDim) output.</p>
<p>The config file api is interpolation_layer. </p>
5706
<p>Inherits from <a class="reference internal" href="#paddleclasspaddle_1_1Layer"><span class="std std-ref">paddle::Layer</span></a></p>
5707
<div class="breathe-sectiondef docutils container">
Y
Yu Yang 已提交
5708 5709 5710 5711 5712 5713 5714 5715 5716 5717 5718 5719 5720
<p class="breathe-sectiondef-title rubric">Public Functions</p>
<dl class="function">
<dt id="_CPPv2N6paddle18InterpolationLayer18InterpolationLayerERK11LayerConfig">
<span id="paddle::InterpolationLayer::InterpolationLayer__LayerConfigCR"></span><span class="target" id="paddleclasspaddle_1_1InterpolationLayer_1a97a9c4a46cf695bca75b456f852b4cea"></span><code class="descname">InterpolationLayer</code><span class="sig-paren">(</span><em class="property">const</em> LayerConfig &amp;<em>config</em><span class="sig-paren">)</span><a class="headerlink" href="#_CPPv2N6paddle18InterpolationLayer18InterpolationLayerERK11LayerConfig" title="Permalink to this definition">¶</a></dt>
<dd></dd></dl>

<dl class="function">
<dt id="_CPPv2N6paddle18InterpolationLayerD0Ev">
<span id="paddle::InterpolationLayer::~InterpolationLayer"></span><span class="target" id="paddleclasspaddle_1_1InterpolationLayer_1acd740f2136ebfa280ca82e637c76a56b"></span><code class="descname">~InterpolationLayer</code><span class="sig-paren">(</span><span class="sig-paren">)</span><a class="headerlink" href="#_CPPv2N6paddle18InterpolationLayerD0Ev" title="Permalink to this definition">¶</a></dt>
<dd></dd></dl>

<dl class="function">
<dt id="_CPPv2N6paddle18InterpolationLayer4initERK8LayerMapRK12ParameterMap">
5721
<span id="paddle::InterpolationLayer::init__LayerMapCR.ParameterMapCR"></span><span class="target" id="paddleclasspaddle_1_1InterpolationLayer_1a68a058f25bf9dfc0c355bf77a4292390"></span>bool <code class="descname">init</code><span class="sig-paren">(</span><em class="property">const</em> LayerMap &amp;<em>layerMap</em>, <em class="property">const</em> <a class="reference internal" href="../../parameter/parameter/parameter.html#_CPPv2N6paddle12ParameterMapE" title="paddle::ParameterMap">ParameterMap</a> &amp;<em>parameterMap</em><span class="sig-paren">)</span><a class="headerlink" href="#_CPPv2N6paddle18InterpolationLayer4initERK8LayerMapRK12ParameterMap" title="Permalink to this definition">¶</a></dt>
Y
Yu Yang 已提交
5722 5723 5724 5725 5726
<dd><p>Intialization. For example, adding input layers from layerMap and parameterMap. </p>
</dd></dl>

<dl class="function">
<dt id="_CPPv2N6paddle18InterpolationLayer7forwardE8PassType">
5727
<span id="paddle::InterpolationLayer::forward__PassType"></span><span class="target" id="paddleclasspaddle_1_1InterpolationLayer_1aa4f31b725399d3f0b8b2ae0d05220f5a"></span>void <code class="descname">forward</code><span class="sig-paren">(</span>PassType <em>passType</em><span class="sig-paren">)</span><a class="headerlink" href="#_CPPv2N6paddle18InterpolationLayer7forwardE8PassType" title="Permalink to this definition">¶</a></dt>
Y
Yu Yang 已提交
5728 5729 5730 5731 5732
<dd><p>Forward propagation. All inherited implementation should call Layer::foward() function. </p>
</dd></dl>

<dl class="function">
<dt id="_CPPv2N6paddle18InterpolationLayer8backwardERK14UpdateCallback">
5733
<span id="paddle::InterpolationLayer::backward__UpdateCallbackCR"></span><span class="target" id="paddleclasspaddle_1_1InterpolationLayer_1a5500c899aafa73066201b6d9a2fd91d4"></span>void <code class="descname">backward</code><span class="sig-paren">(</span><em class="property">const</em> <a class="reference internal" href="../../parameter/parameter/parameter.html#_CPPv2N6paddle14UpdateCallbackE" title="paddle::UpdateCallback">UpdateCallback</a> &amp;<em>callback</em> = nullptr<span class="sig-paren">)</span><a class="headerlink" href="#_CPPv2N6paddle18InterpolationLayer8backwardERK14UpdateCallback" title="Permalink to this definition">¶</a></dt>
5734
<dd><p>Backward propagation. Should only be called after <a class="reference internal" href="#paddleclasspaddle_1_1Layer_1a12386b3f20dd731e7ceaa2c61667cbe1"><span class="std std-ref">Layer::forward()</span></a> function. </p>
Y
Yu Yang 已提交
5735 5736 5737
</dd></dl>

</div>
5738
<div class="breathe-sectiondef docutils container">
Y
Yu Yang 已提交
5739 5740 5741 5742 5743 5744 5745 5746 5747 5748 5749 5750 5751 5752 5753 5754 5755 5756 5757 5758 5759 5760 5761 5762 5763 5764 5765 5766 5767 5768 5769
<p class="breathe-sectiondef-title rubric">Protected Attributes</p>
<dl class="member">
<dt id="_CPPv2N6paddle18InterpolationLayer11weightLast_E">
<span id="paddle::InterpolationLayer::weightLast___MatrixPtr"></span><span class="target" id="paddleclasspaddle_1_1InterpolationLayer_1ab2ecce8a18e8cea2830f7f4be547d0cf"></span><a class="reference internal" href="../../math/matrix/matrix.html#_CPPv2N6paddle9MatrixPtrE" title="paddle::MatrixPtr">MatrixPtr</a> <code class="descname">weightLast_</code><a class="headerlink" href="#_CPPv2N6paddle18InterpolationLayer11weightLast_E" title="Permalink to this definition">¶</a></dt>
<dd><p>weightLast = 1 - weight </p>
</dd></dl>

<dl class="member">
<dt id="_CPPv2N6paddle18InterpolationLayer9tmpMatrixE">
<span id="paddle::InterpolationLayer::tmpMatrix__MatrixPtr"></span><span class="target" id="paddleclasspaddle_1_1InterpolationLayer_1a42ab7d2f40122d3610b3a1da479bccdc"></span><a class="reference internal" href="../../math/matrix/matrix.html#_CPPv2N6paddle9MatrixPtrE" title="paddle::MatrixPtr">MatrixPtr</a> <code class="descname">tmpMatrix</code><a class="headerlink" href="#_CPPv2N6paddle18InterpolationLayer9tmpMatrixE" title="Permalink to this definition">¶</a></dt>
<dd></dd></dl>

</div>
</dd></dl>

</div>
<div class="section" id="multiplexlayer">
<h2>MultiplexLayer<a class="headerlink" href="#multiplexlayer" title="Permalink to this headline">¶</a></h2>
<dl class="class">
<dt id="_CPPv2N6paddle14MultiplexLayerE">
<span id="paddle::MultiplexLayer"></span><span class="target" id="paddleclasspaddle_1_1MultiplexLayer"></span><em class="property">class </em><code class="descclassname">paddle::</code><code class="descname">MultiplexLayer</code><a class="headerlink" href="#_CPPv2N6paddle14MultiplexLayerE" title="Permalink to this definition">¶</a></dt>
<dd><p>This layer multiplex multiple layers according to the index, which is provided by the first input layer. </p>
<p><ul class="simple">
<li>Input[0]: the index of the layer to output of size batchSize.</li>
<li>Input[1:N]; the candidate output data. For each index i from 0 to batchSize -1, the output is the i-th row of the (index[i] + 1)-th layer.</li>
</ul>
</p>
<p>For each i-th row of output:</p>
<p><div class="math">
\[ y[i][j] = x_{x_{0}[i] + 1}[i][j], j = 0,1, ... , (x_{1}.width - 1) \]</div>
 where, y is output. <span class="math">\(x_{k}\)</span> is the k-th input layer and <span class="math">\(k = x_{0}[i] + 1\)</span>. </p>
5770
<p>Inherits from <a class="reference internal" href="#paddleclasspaddle_1_1Layer"><span class="std std-ref">paddle::Layer</span></a></p>
5771
<div class="breathe-sectiondef docutils container">
Y
Yu Yang 已提交
5772 5773 5774 5775 5776 5777 5778 5779 5780 5781 5782 5783 5784
<p class="breathe-sectiondef-title rubric">Public Functions</p>
<dl class="function">
<dt id="_CPPv2N6paddle14MultiplexLayer14MultiplexLayerERK11LayerConfig">
<span id="paddle::MultiplexLayer::MultiplexLayer__LayerConfigCR"></span><span class="target" id="paddleclasspaddle_1_1MultiplexLayer_1a48862a84c1a3b2c38749482cf89ff821"></span><code class="descname">MultiplexLayer</code><span class="sig-paren">(</span><em class="property">const</em> LayerConfig &amp;<em>config</em><span class="sig-paren">)</span><a class="headerlink" href="#_CPPv2N6paddle14MultiplexLayer14MultiplexLayerERK11LayerConfig" title="Permalink to this definition">¶</a></dt>
<dd></dd></dl>

<dl class="function">
<dt id="_CPPv2N6paddle14MultiplexLayerD0Ev">
<span id="paddle::MultiplexLayer::~MultiplexLayer"></span><span class="target" id="paddleclasspaddle_1_1MultiplexLayer_1adab9fd195e872c89fe501760015fb3a3"></span><code class="descname">~MultiplexLayer</code><span class="sig-paren">(</span><span class="sig-paren">)</span><a class="headerlink" href="#_CPPv2N6paddle14MultiplexLayerD0Ev" title="Permalink to this definition">¶</a></dt>
<dd></dd></dl>

<dl class="function">
<dt id="_CPPv2N6paddle14MultiplexLayer4initERK8LayerMapRK12ParameterMap">
5785
<span id="paddle::MultiplexLayer::init__LayerMapCR.ParameterMapCR"></span><span class="target" id="paddleclasspaddle_1_1MultiplexLayer_1a43b451c6ad0e5274fbdf88f31128f53d"></span>bool <code class="descname">init</code><span class="sig-paren">(</span><em class="property">const</em> LayerMap &amp;<em>layerMap</em>, <em class="property">const</em> <a class="reference internal" href="../../parameter/parameter/parameter.html#_CPPv2N6paddle12ParameterMapE" title="paddle::ParameterMap">ParameterMap</a> &amp;<em>parameterMap</em><span class="sig-paren">)</span><a class="headerlink" href="#_CPPv2N6paddle14MultiplexLayer4initERK8LayerMapRK12ParameterMap" title="Permalink to this definition">¶</a></dt>
Y
Yu Yang 已提交
5786 5787 5788 5789 5790
<dd><p>Intialization. For example, adding input layers from layerMap and parameterMap. </p>
</dd></dl>

<dl class="function">
<dt id="_CPPv2N6paddle14MultiplexLayer7forwardE8PassType">
5791
<span id="paddle::MultiplexLayer::forward__PassType"></span><span class="target" id="paddleclasspaddle_1_1MultiplexLayer_1af6e0f9ca3f04adcb49132950e77686fd"></span>void <code class="descname">forward</code><span class="sig-paren">(</span>PassType <em>passType</em><span class="sig-paren">)</span><a class="headerlink" href="#_CPPv2N6paddle14MultiplexLayer7forwardE8PassType" title="Permalink to this definition">¶</a></dt>
Y
Yu Yang 已提交
5792 5793 5794 5795 5796
<dd><p>Forward propagation. All inherited implementation should call Layer::foward() function. </p>
</dd></dl>

<dl class="function">
<dt id="_CPPv2N6paddle14MultiplexLayer8backwardERK14UpdateCallback">
5797
<span id="paddle::MultiplexLayer::backward__UpdateCallbackCR"></span><span class="target" id="paddleclasspaddle_1_1MultiplexLayer_1af2f5758bd1874285d6db082b86595978"></span>void <code class="descname">backward</code><span class="sig-paren">(</span><em class="property">const</em> <a class="reference internal" href="../../parameter/parameter/parameter.html#_CPPv2N6paddle14UpdateCallbackE" title="paddle::UpdateCallback">UpdateCallback</a> &amp;<em>callback</em> = nullptr<span class="sig-paren">)</span><a class="headerlink" href="#_CPPv2N6paddle14MultiplexLayer8backwardERK14UpdateCallback" title="Permalink to this definition">¶</a></dt>
5798
<dd><p>Backward propagation. Should only be called after <a class="reference internal" href="#paddleclasspaddle_1_1Layer_1a12386b3f20dd731e7ceaa2c61667cbe1"><span class="std std-ref">Layer::forward()</span></a> function. </p>
Y
Yu Yang 已提交
5799 5800 5801
</dd></dl>

</div>
5802
<div class="breathe-sectiondef docutils container">
Y
Yu Yang 已提交
5803 5804 5805 5806
<p class="breathe-sectiondef-title rubric">Protected Attributes</p>
<dl class="member">
<dt id="_CPPv2N6paddle14MultiplexLayer13copySchedule_E">
<span id="paddle::MultiplexLayer::copySchedule___std::vector:CopyInfo:"></span><span class="target" id="paddleclasspaddle_1_1MultiplexLayer_1aaf1bcdd83f5803065748c42fd54f59be"></span>std::vector&lt;<a class="reference internal" href="#_CPPv2N6paddle14MultiplexLayer8CopyInfoE" title="paddle::MultiplexLayer::CopyInfo">CopyInfo</a>&gt; <code class="descname">copySchedule_</code><a class="headerlink" href="#_CPPv2N6paddle14MultiplexLayer13copySchedule_E" title="Permalink to this definition">¶</a></dt>
5807
<dd><p>A list of <a class="reference internal" href="#paddlestructpaddle_1_1MultiplexLayer_1_1CopyInfo"><span class="std std-ref">CopyInfo</span></a> used to save copy information. </p>
Y
Yu Yang 已提交
5808 5809 5810 5811 5812 5813 5814 5815 5816 5817 5818 5819 5820 5821 5822 5823 5824 5825 5826
</dd></dl>

<dl class="member">
<dt id="_CPPv2N6paddle14MultiplexLayer7tmpSrc_E">
<span id="paddle::MultiplexLayer::tmpSrc___MatrixPtr"></span><span class="target" id="paddleclasspaddle_1_1MultiplexLayer_1af0a02a0282eea35ce5ab3c1f6a478edd"></span><a class="reference internal" href="../../math/matrix/matrix.html#_CPPv2N6paddle9MatrixPtrE" title="paddle::MatrixPtr">MatrixPtr</a> <code class="descname">tmpSrc_</code><a class="headerlink" href="#_CPPv2N6paddle14MultiplexLayer7tmpSrc_E" title="Permalink to this definition">¶</a></dt>
<dd><p>Temporary matrix pointer to point to input data. </p>
</dd></dl>

<dl class="member">
<dt id="_CPPv2N6paddle14MultiplexLayer8tmpDest_E">
<span id="paddle::MultiplexLayer::tmpDest___MatrixPtr"></span><span class="target" id="paddleclasspaddle_1_1MultiplexLayer_1a8cc702de8c7e6291f1299a6bebd270cc"></span><a class="reference internal" href="../../math/matrix/matrix.html#_CPPv2N6paddle9MatrixPtrE" title="paddle::MatrixPtr">MatrixPtr</a> <code class="descname">tmpDest_</code><a class="headerlink" href="#_CPPv2N6paddle14MultiplexLayer8tmpDest_E" title="Permalink to this definition">¶</a></dt>
<dd><p>Temporary matrix pointer to point to output data. </p>
</dd></dl>

</div>
<dl class="class">
<dt id="_CPPv2N6paddle14MultiplexLayer8CopyInfoE">
<span id="paddle::MultiplexLayer::CopyInfo"></span><span class="target" id="paddlestructpaddle_1_1MultiplexLayer_1_1CopyInfo"></span><em class="property">struct </em><code class="descname">CopyInfo</code><a class="headerlink" href="#_CPPv2N6paddle14MultiplexLayer8CopyInfoE" title="Permalink to this definition">¶</a></dt>
<dd><p>A struct is used to save the copy information, includes input layer index and copy size. </p>
5827
<div class="breathe-sectiondef docutils container">
Y
Yu Yang 已提交
5828 5829 5830 5831 5832 5833 5834
<p class="breathe-sectiondef-title rubric">Public Functions</p>
<dl class="function">
<dt id="_CPPv2N6paddle14MultiplexLayer8CopyInfo8CopyInfoEiii">
<span id="paddle::MultiplexLayer::CopyInfo::CopyInfo__i.i.i"></span><span class="target" id="paddlestructpaddle_1_1MultiplexLayer_1_1CopyInfo_1a42965c05afef2ad646833e297385fafb"></span><code class="descname">CopyInfo</code><span class="sig-paren">(</span>int <em>inStartIdx</em>, int <em>inLength</em>, int <em>inCopyIdx</em><span class="sig-paren">)</span><a class="headerlink" href="#_CPPv2N6paddle14MultiplexLayer8CopyInfo8CopyInfoEiii" title="Permalink to this definition">¶</a></dt>
<dd></dd></dl>

</div>
5835
<div class="breathe-sectiondef docutils container">
Y
Yu Yang 已提交
5836 5837 5838 5839 5840 5841 5842 5843 5844 5845 5846 5847 5848 5849 5850 5851 5852 5853 5854 5855 5856 5857 5858 5859 5860 5861 5862 5863 5864 5865
<p class="breathe-sectiondef-title rubric">Public Members</p>
<dl class="member">
<dt id="_CPPv2N6paddle14MultiplexLayer8CopyInfo8startIdxE">
<span id="paddle::MultiplexLayer::CopyInfo::startIdx__i"></span><span class="target" id="paddlestructpaddle_1_1MultiplexLayer_1_1CopyInfo_1a2f723bad98553f0eca64f3afc5df230d"></span>int <code class="descname">startIdx</code><a class="headerlink" href="#_CPPv2N6paddle14MultiplexLayer8CopyInfo8startIdxE" title="Permalink to this definition">¶</a></dt>
<dd><p>The start row of input. </p>
</dd></dl>

<dl class="member">
<dt id="_CPPv2N6paddle14MultiplexLayer8CopyInfo6lengthE">
<span id="paddle::MultiplexLayer::CopyInfo::length__i"></span><span class="target" id="paddlestructpaddle_1_1MultiplexLayer_1_1CopyInfo_1a9b0ce33c4285003a8b09ac26a62b6115"></span>int <code class="descname">length</code><a class="headerlink" href="#_CPPv2N6paddle14MultiplexLayer8CopyInfo6lengthE" title="Permalink to this definition">¶</a></dt>
<dd><p>Number of rows. If the layer index in Input[0] is not consecutive, the length is one. Otherwise, the length is &gt; 1 and copy multi rows once. </p>
</dd></dl>

<dl class="member">
<dt id="_CPPv2N6paddle14MultiplexLayer8CopyInfo7copyIdxE">
<span id="paddle::MultiplexLayer::CopyInfo::copyIdx__i"></span><span class="target" id="paddlestructpaddle_1_1MultiplexLayer_1_1CopyInfo_1a88b04b8a5824a28dd9e919c759b7c69e"></span>int <code class="descname">copyIdx</code><a class="headerlink" href="#_CPPv2N6paddle14MultiplexLayer8CopyInfo7copyIdxE" title="Permalink to this definition">¶</a></dt>
<dd><p>The copied layer index, which needs to add 1. </p>
</dd></dl>

</div>
</dd></dl>

</dd></dl>

</div>
<div class="section" id="outerprodlayer">
<h2>OuterProdLayer<a class="headerlink" href="#outerprodlayer" title="Permalink to this headline">¶</a></h2>
<dl class="class">
<dt id="_CPPv2N6paddle14OuterProdLayerE">
<span id="paddle::OuterProdLayer"></span><span class="target" id="paddleclasspaddle_1_1OuterProdLayer"></span><em class="property">class </em><code class="descclassname">paddle::</code><code class="descname">OuterProdLayer</code><a class="headerlink" href="#_CPPv2N6paddle14OuterProdLayerE" title="Permalink to this definition">¶</a></dt>
Y
Yu Yang 已提交
5866 5867 5868 5869 5870 5871
<dd><p>A layer for computing the outer product of two vectors. </p>
<p><dl class="docutils">
<dt><strong>Note</strong></dt>
<dd>used in NEURAL TURING MACHINE Input1: vector (batchSize * dim1) Input2: vector (batchSize * dim2) Output: a matrix: (batchSize * (dim1*dim2)) </dd>
</dl>
</p>
5872
<p>Inherits from <a class="reference internal" href="#paddleclasspaddle_1_1Layer"><span class="std std-ref">paddle::Layer</span></a></p>
5873
<div class="breathe-sectiondef docutils container">
Y
Yu Yang 已提交
5874 5875 5876 5877 5878 5879 5880 5881 5882 5883 5884 5885 5886
<p class="breathe-sectiondef-title rubric">Public Functions</p>
<dl class="function">
<dt id="_CPPv2N6paddle14OuterProdLayer14OuterProdLayerERK11LayerConfig">
<span id="paddle::OuterProdLayer::OuterProdLayer__LayerConfigCR"></span><span class="target" id="paddleclasspaddle_1_1OuterProdLayer_1af1df85cd5d336b5c54004526604ada01"></span><code class="descname">OuterProdLayer</code><span class="sig-paren">(</span><em class="property">const</em> LayerConfig &amp;<em>config</em><span class="sig-paren">)</span><a class="headerlink" href="#_CPPv2N6paddle14OuterProdLayer14OuterProdLayerERK11LayerConfig" title="Permalink to this definition">¶</a></dt>
<dd></dd></dl>

<dl class="function">
<dt id="_CPPv2N6paddle14OuterProdLayerD0Ev">
<span id="paddle::OuterProdLayer::~OuterProdLayer"></span><span class="target" id="paddleclasspaddle_1_1OuterProdLayer_1a32a52a7ba9231a9d87348f5e0b9c3a7c"></span><code class="descname">~OuterProdLayer</code><span class="sig-paren">(</span><span class="sig-paren">)</span><a class="headerlink" href="#_CPPv2N6paddle14OuterProdLayerD0Ev" title="Permalink to this definition">¶</a></dt>
<dd></dd></dl>

<dl class="function">
<dt id="_CPPv2N6paddle14OuterProdLayer4initERK8LayerMapRK12ParameterMap">
5887
<span id="paddle::OuterProdLayer::init__LayerMapCR.ParameterMapCR"></span><span class="target" id="paddleclasspaddle_1_1OuterProdLayer_1a3d52545b40e74b700457d9494684a136"></span>bool <code class="descname">init</code><span class="sig-paren">(</span><em class="property">const</em> LayerMap &amp;<em>layerMap</em>, <em class="property">const</em> <a class="reference internal" href="../../parameter/parameter/parameter.html#_CPPv2N6paddle12ParameterMapE" title="paddle::ParameterMap">ParameterMap</a> &amp;<em>parameterMap</em><span class="sig-paren">)</span><a class="headerlink" href="#_CPPv2N6paddle14OuterProdLayer4initERK8LayerMapRK12ParameterMap" title="Permalink to this definition">¶</a></dt>
Y
Yu Yang 已提交
5888 5889 5890 5891 5892
<dd><p>Intialization. For example, adding input layers from layerMap and parameterMap. </p>
</dd></dl>

<dl class="function">
<dt id="_CPPv2N6paddle14OuterProdLayer7forwardE8PassType">
5893
<span id="paddle::OuterProdLayer::forward__PassType"></span><span class="target" id="paddleclasspaddle_1_1OuterProdLayer_1a90c5ed28f0a7cd1aa5d65f7d883b3bed"></span>void <code class="descname">forward</code><span class="sig-paren">(</span>PassType <em>passType</em><span class="sig-paren">)</span><a class="headerlink" href="#_CPPv2N6paddle14OuterProdLayer7forwardE8PassType" title="Permalink to this definition">¶</a></dt>
Y
Yu Yang 已提交
5894 5895 5896 5897 5898
<dd><p>Forward propagation. All inherited implementation should call Layer::foward() function. </p>
</dd></dl>

<dl class="function">
<dt id="_CPPv2N6paddle14OuterProdLayer8backwardERK14UpdateCallback">
5899
<span id="paddle::OuterProdLayer::backward__UpdateCallbackCR"></span><span class="target" id="paddleclasspaddle_1_1OuterProdLayer_1a68c7efc8d776055b9ced973f742c4ce5"></span>void <code class="descname">backward</code><span class="sig-paren">(</span><em class="property">const</em> <a class="reference internal" href="../../parameter/parameter/parameter.html#_CPPv2N6paddle14UpdateCallbackE" title="paddle::UpdateCallback">UpdateCallback</a> &amp;<em>callback</em> = nullptr<span class="sig-paren">)</span><a class="headerlink" href="#_CPPv2N6paddle14OuterProdLayer8backwardERK14UpdateCallback" title="Permalink to this definition">¶</a></dt>
5900
<dd><p>Backward propagation. Should only be called after <a class="reference internal" href="#paddleclasspaddle_1_1Layer_1a12386b3f20dd731e7ceaa2c61667cbe1"><span class="std std-ref">Layer::forward()</span></a> function. </p>
Y
Yu Yang 已提交
5901 5902 5903
</dd></dl>

</div>
5904
<div class="breathe-sectiondef docutils container">
Y
Yu Yang 已提交
5905 5906 5907 5908 5909 5910 5911 5912 5913 5914 5915 5916 5917 5918 5919 5920 5921 5922 5923 5924 5925 5926 5927 5928 5929 5930 5931 5932 5933
<p class="breathe-sectiondef-title rubric">Protected Attributes</p>
<dl class="member">
<dt id="_CPPv2N6paddle14OuterProdLayer7tmpMtx0E">
<span id="paddle::OuterProdLayer::tmpMtx0__MatrixPtr"></span><span class="target" id="paddleclasspaddle_1_1OuterProdLayer_1ad7639193b9f3a24bccd023a0e71aca3e"></span><a class="reference internal" href="../../math/matrix/matrix.html#_CPPv2N6paddle9MatrixPtrE" title="paddle::MatrixPtr">MatrixPtr</a> <code class="descname">tmpMtx0</code><a class="headerlink" href="#_CPPv2N6paddle14OuterProdLayer7tmpMtx0E" title="Permalink to this definition">¶</a></dt>
<dd></dd></dl>

<dl class="member">
<dt id="_CPPv2N6paddle14OuterProdLayer7tmpRow0E">
<span id="paddle::OuterProdLayer::tmpRow0__MatrixPtr"></span><span class="target" id="paddleclasspaddle_1_1OuterProdLayer_1ae9d7a6dd4be89a0e50b2bf58314cc735"></span><a class="reference internal" href="../../math/matrix/matrix.html#_CPPv2N6paddle9MatrixPtrE" title="paddle::MatrixPtr">MatrixPtr</a> <code class="descname">tmpRow0</code><a class="headerlink" href="#_CPPv2N6paddle14OuterProdLayer7tmpRow0E" title="Permalink to this definition">¶</a></dt>
<dd></dd></dl>

<dl class="member">
<dt id="_CPPv2N6paddle14OuterProdLayer7tmpRow1E">
<span id="paddle::OuterProdLayer::tmpRow1__MatrixPtr"></span><span class="target" id="paddleclasspaddle_1_1OuterProdLayer_1abe2ffc4ddbdc66df6a2b58ab4bc59d27"></span><a class="reference internal" href="../../math/matrix/matrix.html#_CPPv2N6paddle9MatrixPtrE" title="paddle::MatrixPtr">MatrixPtr</a> <code class="descname">tmpRow1</code><a class="headerlink" href="#_CPPv2N6paddle14OuterProdLayer7tmpRow1E" title="Permalink to this definition">¶</a></dt>
<dd></dd></dl>

</div>
</dd></dl>

</div>
<div class="section" id="powerlayer">
<h2>PowerLayer<a class="headerlink" href="#powerlayer" title="Permalink to this headline">¶</a></h2>
<dl class="class">
<dt id="_CPPv2N6paddle10PowerLayerE">
<span id="paddle::PowerLayer"></span><span class="target" id="paddleclasspaddle_1_1PowerLayer"></span><em class="property">class </em><code class="descclassname">paddle::</code><code class="descname">PowerLayer</code><a class="headerlink" href="#_CPPv2N6paddle10PowerLayerE" title="Permalink to this definition">¶</a></dt>
<dd><p>This layer applys a power function to a vector element-wise, which is used in NEURAL TURING MACHINE. <div class="math">
\[ y = x^w \]</div>
 where <span class="math">\(x\)</span> is a input vector, <span class="math">\(w\)</span> is scalar weight, and output <span class="math">\(y\)</span> is a vector.</p>
<p>The config file api is power_layer. </p>
5934
<p>Inherits from <a class="reference internal" href="#paddleclasspaddle_1_1Layer"><span class="std std-ref">paddle::Layer</span></a></p>
5935
<div class="breathe-sectiondef docutils container">
Y
Yu Yang 已提交
5936 5937 5938 5939 5940 5941 5942 5943 5944 5945 5946 5947 5948
<p class="breathe-sectiondef-title rubric">Public Functions</p>
<dl class="function">
<dt id="_CPPv2N6paddle10PowerLayer10PowerLayerERK11LayerConfig">
<span id="paddle::PowerLayer::PowerLayer__LayerConfigCR"></span><span class="target" id="paddleclasspaddle_1_1PowerLayer_1a6823ff023cf973fb53f40511b83e4257"></span><code class="descname">PowerLayer</code><span class="sig-paren">(</span><em class="property">const</em> LayerConfig &amp;<em>config</em><span class="sig-paren">)</span><a class="headerlink" href="#_CPPv2N6paddle10PowerLayer10PowerLayerERK11LayerConfig" title="Permalink to this definition">¶</a></dt>
<dd></dd></dl>

<dl class="function">
<dt id="_CPPv2N6paddle10PowerLayerD0Ev">
<span id="paddle::PowerLayer::~PowerLayer"></span><span class="target" id="paddleclasspaddle_1_1PowerLayer_1aa5f48682342b5133978176f7636e1256"></span><code class="descname">~PowerLayer</code><span class="sig-paren">(</span><span class="sig-paren">)</span><a class="headerlink" href="#_CPPv2N6paddle10PowerLayerD0Ev" title="Permalink to this definition">¶</a></dt>
<dd></dd></dl>

<dl class="function">
<dt id="_CPPv2N6paddle10PowerLayer4initERK8LayerMapRK12ParameterMap">
5949
<span id="paddle::PowerLayer::init__LayerMapCR.ParameterMapCR"></span><span class="target" id="paddleclasspaddle_1_1PowerLayer_1adb1efe66fe668b17bb55b9b5b2f32d9c"></span>bool <code class="descname">init</code><span class="sig-paren">(</span><em class="property">const</em> LayerMap &amp;<em>layerMap</em>, <em class="property">const</em> <a class="reference internal" href="../../parameter/parameter/parameter.html#_CPPv2N6paddle12ParameterMapE" title="paddle::ParameterMap">ParameterMap</a> &amp;<em>parameterMap</em><span class="sig-paren">)</span><a class="headerlink" href="#_CPPv2N6paddle10PowerLayer4initERK8LayerMapRK12ParameterMap" title="Permalink to this definition">¶</a></dt>
Y
Yu Yang 已提交
5950 5951 5952 5953 5954
<dd><p>Intialization. For example, adding input layers from layerMap and parameterMap. </p>
</dd></dl>

<dl class="function">
<dt id="_CPPv2N6paddle10PowerLayer7forwardE8PassType">
5955
<span id="paddle::PowerLayer::forward__PassType"></span><span class="target" id="paddleclasspaddle_1_1PowerLayer_1a57443ec5786b701036890c2b0b79adae"></span>void <code class="descname">forward</code><span class="sig-paren">(</span>PassType <em>passType</em><span class="sig-paren">)</span><a class="headerlink" href="#_CPPv2N6paddle10PowerLayer7forwardE8PassType" title="Permalink to this definition">¶</a></dt>
Y
Yu Yang 已提交
5956 5957 5958 5959 5960
<dd><p>Forward propagation. All inherited implementation should call Layer::foward() function. </p>
</dd></dl>

<dl class="function">
<dt id="_CPPv2N6paddle10PowerLayer8backwardERK14UpdateCallback">
5961
<span id="paddle::PowerLayer::backward__UpdateCallbackCR"></span><span class="target" id="paddleclasspaddle_1_1PowerLayer_1a6107f616bce15fc13f1bae7557b54b62"></span>void <code class="descname">backward</code><span class="sig-paren">(</span><em class="property">const</em> <a class="reference internal" href="../../parameter/parameter/parameter.html#_CPPv2N6paddle14UpdateCallbackE" title="paddle::UpdateCallback">UpdateCallback</a> &amp;<em>callback</em> = nullptr<span class="sig-paren">)</span><a class="headerlink" href="#_CPPv2N6paddle10PowerLayer8backwardERK14UpdateCallback" title="Permalink to this definition">¶</a></dt>
5962
<dd><p>Backward propagation. Should only be called after <a class="reference internal" href="#paddleclasspaddle_1_1Layer_1a12386b3f20dd731e7ceaa2c61667cbe1"><span class="std std-ref">Layer::forward()</span></a> function. </p>
Y
Yu Yang 已提交
5963 5964 5965
</dd></dl>

</div>
5966
<div class="breathe-sectiondef docutils container">
Y
Yu Yang 已提交
5967 5968 5969 5970 5971 5972 5973 5974 5975 5976 5977 5978 5979 5980 5981 5982 5983 5984 5985
<p class="breathe-sectiondef-title rubric">Protected Attributes</p>
<dl class="member">
<dt id="_CPPv2N6paddle10PowerLayer6tmpMtxE">
<span id="paddle::PowerLayer::tmpMtx__MatrixPtr"></span><span class="target" id="paddleclasspaddle_1_1PowerLayer_1a6fcb794dacb7f1e96fe38426b2e8b067"></span><a class="reference internal" href="../../math/matrix/matrix.html#_CPPv2N6paddle9MatrixPtrE" title="paddle::MatrixPtr">MatrixPtr</a> <code class="descname">tmpMtx</code><a class="headerlink" href="#_CPPv2N6paddle10PowerLayer6tmpMtxE" title="Permalink to this definition">¶</a></dt>
<dd></dd></dl>

</div>
</dd></dl>

</div>
<div class="section" id="scalinglayer">
<h2>ScalingLayer<a class="headerlink" href="#scalinglayer" title="Permalink to this headline">¶</a></h2>
<dl class="class">
<dt id="_CPPv2N6paddle12ScalingLayerE">
<span id="paddle::ScalingLayer"></span><span class="target" id="paddleclasspaddle_1_1ScalingLayer"></span><em class="property">class </em><code class="descclassname">paddle::</code><code class="descname">ScalingLayer</code><a class="headerlink" href="#_CPPv2N6paddle12ScalingLayerE" title="Permalink to this definition">¶</a></dt>
<dd><p>A layer for each row of a matrix, multiplying with a element of a vector, which is used in NEURAL TURING MACHINE. <div class="math">
\[ y.row[i] = w[i] * x.row[i] \]</div>
 where <span class="math">\(x\)</span> is (batchSize x dataDim) input, <span class="math">\(w\)</span> is (batchSize x 1) weight vector, and <span class="math">\(y\)</span> is (batchSize x dataDim) output.</p>
<p>The config file api is scaling_layer. </p>
5986
<p>Inherits from <a class="reference internal" href="#paddleclasspaddle_1_1Layer"><span class="std std-ref">paddle::Layer</span></a></p>
5987
<div class="breathe-sectiondef docutils container">
Y
Yu Yang 已提交
5988 5989 5990 5991 5992 5993 5994 5995 5996 5997 5998 5999 6000
<p class="breathe-sectiondef-title rubric">Public Functions</p>
<dl class="function">
<dt id="_CPPv2N6paddle12ScalingLayer12ScalingLayerERK11LayerConfig">
<span id="paddle::ScalingLayer::ScalingLayer__LayerConfigCR"></span><span class="target" id="paddleclasspaddle_1_1ScalingLayer_1a12d4af7fb2e69f70e7d009f4e620b620"></span><code class="descname">ScalingLayer</code><span class="sig-paren">(</span><em class="property">const</em> LayerConfig &amp;<em>config</em><span class="sig-paren">)</span><a class="headerlink" href="#_CPPv2N6paddle12ScalingLayer12ScalingLayerERK11LayerConfig" title="Permalink to this definition">¶</a></dt>
<dd></dd></dl>

<dl class="function">
<dt id="_CPPv2N6paddle12ScalingLayerD0Ev">
<span id="paddle::ScalingLayer::~ScalingLayer"></span><span class="target" id="paddleclasspaddle_1_1ScalingLayer_1ab550feba3880a580f4a29e46fb9dd023"></span><code class="descname">~ScalingLayer</code><span class="sig-paren">(</span><span class="sig-paren">)</span><a class="headerlink" href="#_CPPv2N6paddle12ScalingLayerD0Ev" title="Permalink to this definition">¶</a></dt>
<dd></dd></dl>

<dl class="function">
<dt id="_CPPv2N6paddle12ScalingLayer4initERK8LayerMapRK12ParameterMap">
6001
<span id="paddle::ScalingLayer::init__LayerMapCR.ParameterMapCR"></span><span class="target" id="paddleclasspaddle_1_1ScalingLayer_1aee1413e885cf16d43d503670c7fd1ba4"></span>bool <code class="descname">init</code><span class="sig-paren">(</span><em class="property">const</em> LayerMap &amp;<em>layerMap</em>, <em class="property">const</em> <a class="reference internal" href="../../parameter/parameter/parameter.html#_CPPv2N6paddle12ParameterMapE" title="paddle::ParameterMap">ParameterMap</a> &amp;<em>parameterMap</em><span class="sig-paren">)</span><a class="headerlink" href="#_CPPv2N6paddle12ScalingLayer4initERK8LayerMapRK12ParameterMap" title="Permalink to this definition">¶</a></dt>
Y
Yu Yang 已提交
6002 6003 6004 6005 6006
<dd><p>Intialization. For example, adding input layers from layerMap and parameterMap. </p>
</dd></dl>

<dl class="function">
<dt id="_CPPv2N6paddle12ScalingLayer7forwardE8PassType">
6007
<span id="paddle::ScalingLayer::forward__PassType"></span><span class="target" id="paddleclasspaddle_1_1ScalingLayer_1af2aac14c733bde36af5eddc4143779ed"></span>void <code class="descname">forward</code><span class="sig-paren">(</span>PassType <em>passType</em><span class="sig-paren">)</span><a class="headerlink" href="#_CPPv2N6paddle12ScalingLayer7forwardE8PassType" title="Permalink to this definition">¶</a></dt>
Y
Yu Yang 已提交
6008 6009 6010 6011 6012
<dd><p>Forward propagation. All inherited implementation should call Layer::foward() function. </p>
</dd></dl>

<dl class="function">
<dt id="_CPPv2N6paddle12ScalingLayer8backwardERK14UpdateCallback">
6013
<span id="paddle::ScalingLayer::backward__UpdateCallbackCR"></span><span class="target" id="paddleclasspaddle_1_1ScalingLayer_1a7c6e7ffb64a5cbd3c5fa3ae9bb6645f7"></span>void <code class="descname">backward</code><span class="sig-paren">(</span><em class="property">const</em> <a class="reference internal" href="../../parameter/parameter/parameter.html#_CPPv2N6paddle14UpdateCallbackE" title="paddle::UpdateCallback">UpdateCallback</a> &amp;<em>callback</em> = nullptr<span class="sig-paren">)</span><a class="headerlink" href="#_CPPv2N6paddle12ScalingLayer8backwardERK14UpdateCallback" title="Permalink to this definition">¶</a></dt>
6014
<dd><p>Backward propagation. Should only be called after <a class="reference internal" href="#paddleclasspaddle_1_1Layer_1a12386b3f20dd731e7ceaa2c61667cbe1"><span class="std std-ref">Layer::forward()</span></a> function. </p>
Y
Yu Yang 已提交
6015 6016 6017 6018 6019 6020 6021 6022 6023 6024 6025 6026 6027 6028 6029 6030 6031 6032 6033 6034 6035
</dd></dl>

</div>
</dd></dl>

</div>
<div class="section" id="slopeinterceptlayer">
<h2>SlopeInterceptLayer<a class="headerlink" href="#slopeinterceptlayer" title="Permalink to this headline">¶</a></h2>
<dl class="class">
<dt id="_CPPv2N6paddle19SlopeInterceptLayerE">
<span id="paddle::SlopeInterceptLayer"></span><span class="target" id="paddleclasspaddle_1_1SlopeInterceptLayer"></span><em class="property">class </em><code class="descclassname">paddle::</code><code class="descname">SlopeInterceptLayer</code><a class="headerlink" href="#_CPPv2N6paddle19SlopeInterceptLayerE" title="Permalink to this definition">¶</a></dt>
<dd><p>A layer for applying a slope and an intercept to the input element-wise. This layer is used in NEURAL TURING MACHINE. </p>
<p><div class="math">
\[ y = ax + b \]</div>
<dl class="docutils">
<dt><strong>Note</strong></dt>
<dd>There is no activation and weight in this layer.</dd>
</dl>
</p>
<p>Here, a is scale and b is offset, which are provided as attributes of the layer.</p>
<p>The config file api is slope_intercept_layer. </p>
6036
<p>Inherits from <a class="reference internal" href="#paddleclasspaddle_1_1Layer"><span class="std std-ref">paddle::Layer</span></a></p>
6037
<div class="breathe-sectiondef docutils container">
Y
Yu Yang 已提交
6038 6039 6040 6041 6042 6043 6044 6045 6046 6047 6048 6049 6050
<p class="breathe-sectiondef-title rubric">Public Functions</p>
<dl class="function">
<dt id="_CPPv2N6paddle19SlopeInterceptLayer19SlopeInterceptLayerERK11LayerConfig">
<span id="paddle::SlopeInterceptLayer::SlopeInterceptLayer__LayerConfigCR"></span><span class="target" id="paddleclasspaddle_1_1SlopeInterceptLayer_1a45c68e132517d11d72fda5dd5ced973e"></span><code class="descname">SlopeInterceptLayer</code><span class="sig-paren">(</span><em class="property">const</em> LayerConfig &amp;<em>config</em><span class="sig-paren">)</span><a class="headerlink" href="#_CPPv2N6paddle19SlopeInterceptLayer19SlopeInterceptLayerERK11LayerConfig" title="Permalink to this definition">¶</a></dt>
<dd></dd></dl>

<dl class="function">
<dt id="_CPPv2N6paddle19SlopeInterceptLayerD0Ev">
<span id="paddle::SlopeInterceptLayer::~SlopeInterceptLayer"></span><span class="target" id="paddleclasspaddle_1_1SlopeInterceptLayer_1af52fb3eb6bd263b80764097479a22e70"></span><code class="descname">~SlopeInterceptLayer</code><span class="sig-paren">(</span><span class="sig-paren">)</span><a class="headerlink" href="#_CPPv2N6paddle19SlopeInterceptLayerD0Ev" title="Permalink to this definition">¶</a></dt>
<dd></dd></dl>

<dl class="function">
<dt id="_CPPv2N6paddle19SlopeInterceptLayer4initERK8LayerMapRK12ParameterMap">
6051
<span id="paddle::SlopeInterceptLayer::init__LayerMapCR.ParameterMapCR"></span><span class="target" id="paddleclasspaddle_1_1SlopeInterceptLayer_1a537b29cdbc58f564b7b5941179e21523"></span>bool <code class="descname">init</code><span class="sig-paren">(</span><em class="property">const</em> LayerMap &amp;<em>layerMap</em>, <em class="property">const</em> <a class="reference internal" href="../../parameter/parameter/parameter.html#_CPPv2N6paddle12ParameterMapE" title="paddle::ParameterMap">ParameterMap</a> &amp;<em>parameterMap</em><span class="sig-paren">)</span><a class="headerlink" href="#_CPPv2N6paddle19SlopeInterceptLayer4initERK8LayerMapRK12ParameterMap" title="Permalink to this definition">¶</a></dt>
Y
Yu Yang 已提交
6052 6053 6054 6055 6056
<dd><p>Intialization. For example, adding input layers from layerMap and parameterMap. </p>
</dd></dl>

<dl class="function">
<dt id="_CPPv2N6paddle19SlopeInterceptLayer7forwardE8PassType">
6057
<span id="paddle::SlopeInterceptLayer::forward__PassType"></span><span class="target" id="paddleclasspaddle_1_1SlopeInterceptLayer_1a04bb776059020f4fb28746ccfc8ec291"></span>void <code class="descname">forward</code><span class="sig-paren">(</span>PassType <em>passType</em><span class="sig-paren">)</span><a class="headerlink" href="#_CPPv2N6paddle19SlopeInterceptLayer7forwardE8PassType" title="Permalink to this definition">¶</a></dt>
Y
Yu Yang 已提交
6058 6059 6060 6061 6062
<dd><p>Forward propagation. All inherited implementation should call Layer::foward() function. </p>
</dd></dl>

<dl class="function">
<dt id="_CPPv2N6paddle19SlopeInterceptLayer8backwardERK14UpdateCallback">
6063
<span id="paddle::SlopeInterceptLayer::backward__UpdateCallbackCR"></span><span class="target" id="paddleclasspaddle_1_1SlopeInterceptLayer_1a21c644e2e7d8e030402fdd27d3d858cb"></span>void <code class="descname">backward</code><span class="sig-paren">(</span><em class="property">const</em> <a class="reference internal" href="../../parameter/parameter/parameter.html#_CPPv2N6paddle14UpdateCallbackE" title="paddle::UpdateCallback">UpdateCallback</a> &amp;<em>callback</em> = nullptr<span class="sig-paren">)</span><a class="headerlink" href="#_CPPv2N6paddle19SlopeInterceptLayer8backwardERK14UpdateCallback" title="Permalink to this definition">¶</a></dt>
6064
<dd><p>Backward propagation. Should only be called after <a class="reference internal" href="#paddleclasspaddle_1_1Layer_1a12386b3f20dd731e7ceaa2c61667cbe1"><span class="std std-ref">Layer::forward()</span></a> function. </p>
Y
Yu Yang 已提交
6065 6066 6067 6068 6069 6070 6071 6072 6073 6074 6075
</dd></dl>

</div>
</dd></dl>

</div>
<div class="section" id="tensorlayer">
<h2>TensorLayer<a class="headerlink" href="#tensorlayer" title="Permalink to this headline">¶</a></h2>
<dl class="class">
<dt id="_CPPv2N6paddle11TensorLayerE">
<span id="paddle::TensorLayer"></span><span class="target" id="paddleclasspaddle_1_1TensorLayer"></span><em class="property">class </em><code class="descclassname">paddle::</code><code class="descname">TensorLayer</code><a class="headerlink" href="#_CPPv2N6paddle11TensorLayerE" title="Permalink to this definition">¶</a></dt>
6076
<dd><p><a class="reference internal" href="#paddleclasspaddle_1_1TensorLayer"><span class="std std-ref">TensorLayer</span></a> takes two input vectors. <div class="math">
Y
Yu Yang 已提交
6077 6078 6079 6080 6081 6082 6083 6084 6085 6086 6087 6088
\[ y_{i} = x_{1} * W_{i} * x_{2}^{\rm T}, i=0, 1, ...,K-1 \]</div>
. </p>
<p><ul class="simple">
<li><span class="math">\(x_{1}\)</span>: the first input, size is M.</li>
<li><span class="math">\(x_{2}\)</span>: the second input, size is N.</li>
<li>y: output, size is K.</li>
<li><span class="math">\(y_{i}\)</span>: i-th element of y.</li>
<li><span class="math">\(W_{i}\)</span>: the i-th learned weight, dimensions: [M, N].</li>
<li><span class="math">\(x_{2}^{\rm T}\)</span>: the transpose of <span class="math">\(x_{2}\)</span>.</li>
</ul>
</p>
<p>The config file api is tensor_layer. </p>
6089
<p>Inherits from <a class="reference internal" href="#paddleclasspaddle_1_1Layer"><span class="std std-ref">paddle::Layer</span></a></p>
6090
<div class="breathe-sectiondef docutils container">
Y
Yu Yang 已提交
6091 6092 6093 6094 6095 6096 6097 6098 6099 6100 6101 6102 6103
<p class="breathe-sectiondef-title rubric">Public Functions</p>
<dl class="function">
<dt id="_CPPv2N6paddle11TensorLayer11TensorLayerERK11LayerConfig">
<span id="paddle::TensorLayer::TensorLayer__LayerConfigCR"></span><span class="target" id="paddleclasspaddle_1_1TensorLayer_1a948561a77a5cf8757166e4dab7ad227f"></span><code class="descname">TensorLayer</code><span class="sig-paren">(</span><em class="property">const</em> LayerConfig &amp;<em>config</em><span class="sig-paren">)</span><a class="headerlink" href="#_CPPv2N6paddle11TensorLayer11TensorLayerERK11LayerConfig" title="Permalink to this definition">¶</a></dt>
<dd></dd></dl>

<dl class="function">
<dt id="_CPPv2N6paddle11TensorLayerD0Ev">
<span id="paddle::TensorLayer::~TensorLayer"></span><span class="target" id="paddleclasspaddle_1_1TensorLayer_1af8d010846003261eec735c6647eff815"></span><code class="descname">~TensorLayer</code><span class="sig-paren">(</span><span class="sig-paren">)</span><a class="headerlink" href="#_CPPv2N6paddle11TensorLayerD0Ev" title="Permalink to this definition">¶</a></dt>
<dd></dd></dl>

<dl class="function">
<dt id="_CPPv2N6paddle11TensorLayer4initERK8LayerMapRK12ParameterMap">
6104
<span id="paddle::TensorLayer::init__LayerMapCR.ParameterMapCR"></span><span class="target" id="paddleclasspaddle_1_1TensorLayer_1a9396ba98cf48558d69bb5dc6621f0603"></span>bool <code class="descname">init</code><span class="sig-paren">(</span><em class="property">const</em> LayerMap &amp;<em>layerMap</em>, <em class="property">const</em> <a class="reference internal" href="../../parameter/parameter/parameter.html#_CPPv2N6paddle12ParameterMapE" title="paddle::ParameterMap">ParameterMap</a> &amp;<em>parameterMap</em><span class="sig-paren">)</span><a class="headerlink" href="#_CPPv2N6paddle11TensorLayer4initERK8LayerMapRK12ParameterMap" title="Permalink to this definition">¶</a></dt>
Y
Yu Yang 已提交
6105 6106 6107 6108 6109 6110 6111 6112 6113 6114
<dd><p>Intialization. For example, adding input layers from layerMap and parameterMap. </p>
</dd></dl>

<dl class="function">
<dt id="_CPPv2N6paddle11TensorLayer9getWeightEi">
<span id="paddle::TensorLayer::getWeight__i"></span><span class="target" id="paddleclasspaddle_1_1TensorLayer_1a1d229726a0d811b9b0600008ae1882d6"></span><a class="reference internal" href="../../parameter/parameter/parameter.html#_CPPv2N6paddle6WeightE" title="paddle::Weight">Weight</a> &amp;<code class="descname">getWeight</code><span class="sig-paren">(</span>int <em>idx</em><span class="sig-paren">)</span><a class="headerlink" href="#_CPPv2N6paddle11TensorLayer9getWeightEi" title="Permalink to this definition">¶</a></dt>
<dd></dd></dl>

<dl class="function">
<dt id="_CPPv2N6paddle11TensorLayer7forwardE8PassType">
6115
<span id="paddle::TensorLayer::forward__PassType"></span><span class="target" id="paddleclasspaddle_1_1TensorLayer_1aaf9540a6fa7e31cadc5274157f293f64"></span>void <code class="descname">forward</code><span class="sig-paren">(</span>PassType <em>passType</em><span class="sig-paren">)</span><a class="headerlink" href="#_CPPv2N6paddle11TensorLayer7forwardE8PassType" title="Permalink to this definition">¶</a></dt>
Y
Yu Yang 已提交
6116 6117 6118 6119 6120
<dd><p>Forward propagation. All inherited implementation should call Layer::foward() function. </p>
</dd></dl>

<dl class="function">
<dt id="_CPPv2N6paddle11TensorLayer8backwardERK14UpdateCallback">
6121
<span id="paddle::TensorLayer::backward__UpdateCallbackCR"></span><span class="target" id="paddleclasspaddle_1_1TensorLayer_1a9e7415385b7e5930e5d0ef1087e3b76f"></span>void <code class="descname">backward</code><span class="sig-paren">(</span><em class="property">const</em> <a class="reference internal" href="../../parameter/parameter/parameter.html#_CPPv2N6paddle14UpdateCallbackE" title="paddle::UpdateCallback">UpdateCallback</a> &amp;<em>callback</em> = nullptr<span class="sig-paren">)</span><a class="headerlink" href="#_CPPv2N6paddle11TensorLayer8backwardERK14UpdateCallback" title="Permalink to this definition">¶</a></dt>
6122
<dd><p>Backward propagation. Should only be called after <a class="reference internal" href="#paddleclasspaddle_1_1Layer_1a12386b3f20dd731e7ceaa2c61667cbe1"><span class="std std-ref">Layer::forward()</span></a> function. </p>
Y
Yu Yang 已提交
6123 6124 6125
</dd></dl>

</div>
6126
<div class="breathe-sectiondef docutils container">
Y
Yu Yang 已提交
6127 6128 6129 6130 6131 6132 6133 6134 6135 6136 6137 6138 6139 6140 6141 6142 6143 6144 6145 6146 6147 6148 6149 6150
<p class="breathe-sectiondef-title rubric">Protected Attributes</p>
<dl class="member">
<dt id="_CPPv2N6paddle11TensorLayer8weights_E">
<span id="paddle::TensorLayer::weights___WeightList"></span><span class="target" id="paddleclasspaddle_1_1TensorLayer_1ab2e3e6498fadc37ad3983cbd69833655"></span><a class="reference internal" href="../../parameter/parameter/parameter.html#_CPPv2N6paddle10WeightListE" title="paddle::WeightList">WeightList</a> <code class="descname">weights_</code><a class="headerlink" href="#_CPPv2N6paddle11TensorLayer8weights_E" title="Permalink to this definition">¶</a></dt>
<dd></dd></dl>

<dl class="member">
<dt id="_CPPv2N6paddle11TensorLayer7biases_E">
<span id="paddle::TensorLayer::biases___std::unique_ptr:Weight:"></span><span class="target" id="paddleclasspaddle_1_1TensorLayer_1a346514a9c37ef3ea185157b2b2877d35"></span>std::unique_ptr&lt;<a class="reference internal" href="../../parameter/parameter/parameter.html#_CPPv2N6paddle6WeightE" title="paddle::Weight">Weight</a>&gt; <code class="descname">biases_</code><a class="headerlink" href="#_CPPv2N6paddle11TensorLayer7biases_E" title="Permalink to this definition">¶</a></dt>
<dd></dd></dl>

</div>
</dd></dl>

</div>
<div class="section" id="translayer">
<h2>TransLayer<a class="headerlink" href="#translayer" title="Permalink to this headline">¶</a></h2>
<dl class="class">
<dt id="_CPPv2N6paddle10TransLayerE">
<span id="paddle::TransLayer"></span><span class="target" id="paddleclasspaddle_1_1TransLayer"></span><em class="property">class </em><code class="descclassname">paddle::</code><code class="descname">TransLayer</code><a class="headerlink" href="#_CPPv2N6paddle10TransLayerE" title="Permalink to this definition">¶</a></dt>
<dd><p>A layer for transposition. <div class="math">
\[ y = x^\mathrm{T} \]</div>
 where <span class="math">\(x\)</span> is (M x N) input, and <span class="math">\(y\)</span> is (N x M) output.</p>
<p>The config file api is trans_layer. </p>
6151
<p>Inherits from <a class="reference internal" href="#paddleclasspaddle_1_1Layer"><span class="std std-ref">paddle::Layer</span></a></p>
6152
<div class="breathe-sectiondef docutils container">
Y
Yu Yang 已提交
6153 6154 6155 6156 6157 6158 6159 6160
<p class="breathe-sectiondef-title rubric">Public Functions</p>
<dl class="function">
<dt id="_CPPv2N6paddle10TransLayer10TransLayerERK11LayerConfig">
<span id="paddle::TransLayer::TransLayer__LayerConfigCR"></span><span class="target" id="paddleclasspaddle_1_1TransLayer_1abf5335f246b7c4b53b62ff0b0f329d07"></span><code class="descname">TransLayer</code><span class="sig-paren">(</span><em class="property">const</em> LayerConfig &amp;<em>config</em><span class="sig-paren">)</span><a class="headerlink" href="#_CPPv2N6paddle10TransLayer10TransLayerERK11LayerConfig" title="Permalink to this definition">¶</a></dt>
<dd></dd></dl>

<dl class="function">
<dt id="_CPPv2N6paddle10TransLayer4initERK8LayerMapRK12ParameterMap">
6161
<span id="paddle::TransLayer::init__LayerMapCR.ParameterMapCR"></span><span class="target" id="paddleclasspaddle_1_1TransLayer_1a15028b4c861d7f100d6d020346731712"></span>bool <code class="descname">init</code><span class="sig-paren">(</span><em class="property">const</em> LayerMap &amp;<em>layerMap</em>, <em class="property">const</em> <a class="reference internal" href="../../parameter/parameter/parameter.html#_CPPv2N6paddle12ParameterMapE" title="paddle::ParameterMap">ParameterMap</a> &amp;<em>parameterMap</em><span class="sig-paren">)</span><a class="headerlink" href="#_CPPv2N6paddle10TransLayer4initERK8LayerMapRK12ParameterMap" title="Permalink to this definition">¶</a></dt>
Y
Yu Yang 已提交
6162 6163 6164 6165 6166
<dd><p>Intialization. For example, adding input layers from layerMap and parameterMap. </p>
</dd></dl>

<dl class="function">
<dt id="_CPPv2N6paddle10TransLayer7forwardE8PassType">
6167
<span id="paddle::TransLayer::forward__PassType"></span><span class="target" id="paddleclasspaddle_1_1TransLayer_1ad853f72f7f1fd81be8ba163276eeab1a"></span>void <code class="descname">forward</code><span class="sig-paren">(</span>PassType <em>passType</em><span class="sig-paren">)</span><a class="headerlink" href="#_CPPv2N6paddle10TransLayer7forwardE8PassType" title="Permalink to this definition">¶</a></dt>
Y
Yu Yang 已提交
6168 6169 6170 6171 6172
<dd><p>Forward propagation. All inherited implementation should call Layer::foward() function. </p>
</dd></dl>

<dl class="function">
<dt id="_CPPv2N6paddle10TransLayer8backwardERK14UpdateCallback">
6173
<span id="paddle::TransLayer::backward__UpdateCallbackCR"></span><span class="target" id="paddleclasspaddle_1_1TransLayer_1aea505e74c05adacca8244e274d31bed5"></span>void <code class="descname">backward</code><span class="sig-paren">(</span><em class="property">const</em> <a class="reference internal" href="../../parameter/parameter/parameter.html#_CPPv2N6paddle14UpdateCallbackE" title="paddle::UpdateCallback">UpdateCallback</a> &amp;<em>callback</em> = nullptr<span class="sig-paren">)</span><a class="headerlink" href="#_CPPv2N6paddle10TransLayer8backwardERK14UpdateCallback" title="Permalink to this definition">¶</a></dt>
6174
<dd><p>Backward propagation. Should only be called after <a class="reference internal" href="#paddleclasspaddle_1_1Layer_1a12386b3f20dd731e7ceaa2c61667cbe1"><span class="std std-ref">Layer::forward()</span></a> function. </p>
Y
Yu Yang 已提交
6175 6176 6177 6178 6179 6180 6181 6182 6183 6184 6185 6186 6187 6188 6189 6190 6191 6192 6193 6194 6195
</dd></dl>

</div>
</dd></dl>

</div>
</div>
<div class="section" id="sampling-layers">
<h1>Sampling Layers<a class="headerlink" href="#sampling-layers" title="Permalink to this headline">¶</a></h1>
<div class="section" id="multinomialsampler">
<h2>MultinomialSampler<a class="headerlink" href="#multinomialsampler" title="Permalink to this headline">¶</a></h2>
<dl class="class">
<dt id="_CPPv2N6paddle18MultinomialSamplerE">
<span id="paddle::MultinomialSampler"></span><span class="target" id="paddleclasspaddle_1_1MultinomialSampler"></span><em class="property">class </em><code class="descclassname">paddle::</code><code class="descname">MultinomialSampler</code><a class="headerlink" href="#_CPPv2N6paddle18MultinomialSamplerE" title="Permalink to this definition">¶</a></dt>
<dd><p>Given the probability of N objects, the sampler random select one of the object. </p>
<p>
The space requirement is O(N)=O(N * sizeof(Interval)). The computational complexity of generate one sample is O(1). <dl class="docutils">
<dt><strong>Note</strong></dt>
<dd>: prob does not have to be unnormalized.</dd>
</dl>
</p>
6196
<div class="breathe-sectiondef docutils container">
Y
Yu Yang 已提交
6197 6198 6199 6200 6201 6202 6203 6204 6205 6206 6207 6208 6209 6210 6211 6212
<p class="breathe-sectiondef-title rubric">Public Functions</p>
<dl class="function">
<dt id="_CPPv2N6paddle18MultinomialSampler18MultinomialSamplerEPK4reali">
<span id="paddle::MultinomialSampler::MultinomialSampler__realCP.i"></span><span class="target" id="paddleclasspaddle_1_1MultinomialSampler_1abdec5c025615002a89222c72115715e6"></span><code class="descname">MultinomialSampler</code><span class="sig-paren">(</span><em class="property">const</em> real *<em>prob</em>, int <em>size</em><span class="sig-paren">)</span><a class="headerlink" href="#_CPPv2N6paddle18MultinomialSampler18MultinomialSamplerEPK4reali" title="Permalink to this definition">¶</a></dt>
<dd></dd></dl>

<dl class="function">
<dt>
<em class="property">template </em>&lt;<em class="property">typename</em> URNG&gt;</dt>
<dt id="_CPPv2N6paddle18MultinomialSampler3genER4URNG">
<span id="paddle::MultinomialSampler::gen__URNGR"></span><span class="target" id="paddleclasspaddle_1_1MultinomialSampler_1ad77b6724f10945930f2b72a4d0f7d5a2"></span>int <code class="descname">gen</code><span class="sig-paren">(</span>URNG &amp;<em>g</em><span class="sig-paren">)</span><a class="headerlink" href="#_CPPv2N6paddle18MultinomialSampler3genER4URNG" title="Permalink to this definition">¶</a></dt>
<dd><p>Generate a random sample. </p>
<p><dl class="docutils">
<dt><strong>Return</strong></dt>
<dd>Random integer. </dd>
<dt><strong>Parameters</strong></dt>
6213 6214
<dd><ul class="breatheparameterlist first last simple">
<li><code class="docutils literal"><span class="pre">g</span></code>: is a random number engine. See &lt;random&gt;. </li>
Y
Yu Yang 已提交
6215 6216 6217 6218 6219 6220 6221
</ul>
</dd>
</dl>
</p>
</dd></dl>

</div>
6222
<div class="breathe-sectiondef docutils container">
Y
Yu Yang 已提交
6223 6224 6225 6226 6227 6228 6229 6230 6231 6232 6233
<p class="breathe-sectiondef-title rubric">Protected Functions</p>
<dl class="function">
<dt>
<em class="property">template </em>&lt;<em class="property">typename</em> Rand&gt;</dt>
<dt id="_CPPv2N6paddle18MultinomialSampler4gen1E4Rand">
<span id="paddle::MultinomialSampler::gen1__Rand"></span><span class="target" id="paddleclasspaddle_1_1MultinomialSampler_1abc18ecafa9cb57ca739dfc6c3df03081"></span>int <code class="descname">gen1</code><span class="sig-paren">(</span>Rand <em>rand</em><span class="sig-paren">)</span><a class="headerlink" href="#_CPPv2N6paddle18MultinomialSampler4gen1E4Rand" title="Permalink to this definition">¶</a></dt>
<dd><p>Generation. </p>
<p><dl class="docutils">
<dt><strong>Return</strong></dt>
<dd>random int number or intervals_[random_int_number].otherId. </dd>
<dt><strong>Parameters</strong></dt>
6234 6235
<dd><ul class="breatheparameterlist first last simple">
<li><code class="docutils literal"><span class="pre">rand</span></code>: rand is a real random number distribution for the range [0, size). </li>
Y
Yu Yang 已提交
6236 6237 6238 6239 6240 6241 6242
</ul>
</dd>
</dl>
</p>
</dd></dl>

</div>
6243
<div class="breathe-sectiondef docutils container">
Y
Yu Yang 已提交
6244 6245 6246 6247 6248 6249 6250 6251 6252 6253 6254 6255 6256 6257 6258 6259
<p class="breathe-sectiondef-title rubric">Protected Attributes</p>
<dl class="member">
<dt id="_CPPv2N6paddle18MultinomialSampler10intervals_E">
<span id="paddle::MultinomialSampler::intervals___std::vector:Interval:"></span><span class="target" id="paddleclasspaddle_1_1MultinomialSampler_1a79d0b2062d6a159b63e104ddabf09ff1"></span>std::vector&lt;<a class="reference internal" href="#_CPPv2N6paddle18MultinomialSampler8IntervalE" title="paddle::MultinomialSampler::Interval">Interval</a>&gt; <code class="descname">intervals_</code><a class="headerlink" href="#_CPPv2N6paddle18MultinomialSampler10intervals_E" title="Permalink to this definition">¶</a></dt>
<dd><p>The probability of each interval will be 1./size. </p>
</dd></dl>

<dl class="member">
<dt id="_CPPv2N6paddle18MultinomialSampler5rand_E">
<span id="paddle::MultinomialSampler::rand___std::uniform_real_distribution:double:"></span><span class="target" id="paddleclasspaddle_1_1MultinomialSampler_1a17f7879b3623a007b9bbd8fe6a1e0bd8"></span>std::uniform_real_distribution&lt;double&gt; <code class="descname">rand_</code><a class="headerlink" href="#_CPPv2N6paddle18MultinomialSampler5rand_E" title="Permalink to this definition">¶</a></dt>
<dd></dd></dl>

</div>
<dl class="class">
<dt id="_CPPv2N6paddle18MultinomialSampler8IntervalE">
<span id="paddle::MultinomialSampler::Interval"></span><span class="target" id="paddlestructpaddle_1_1MultinomialSampler_1_1Interval"></span><em class="property">struct </em><code class="descname">Interval</code><a class="headerlink" href="#_CPPv2N6paddle18MultinomialSampler8IntervalE" title="Permalink to this definition">¶</a></dt>
6260
<dd><div class="breathe-sectiondef docutils container">
Y
Yu Yang 已提交
6261 6262 6263 6264 6265 6266 6267 6268 6269 6270 6271 6272 6273 6274 6275 6276 6277 6278 6279 6280 6281 6282 6283 6284
<p class="breathe-sectiondef-title rubric">Public Members</p>
<dl class="member">
<dt id="_CPPv2N6paddle18MultinomialSampler8Interval7otherIdE">
<span id="paddle::MultinomialSampler::Interval::otherId__i"></span><span class="target" id="paddlestructpaddle_1_1MultinomialSampler_1_1Interval_1a92112f797119ce1f63fc6a63601b4c8b"></span>int <code class="descname">otherId</code><a class="headerlink" href="#_CPPv2N6paddle18MultinomialSampler8Interval7otherIdE" title="Permalink to this definition">¶</a></dt>
<dd></dd></dl>

<dl class="member">
<dt id="_CPPv2N6paddle18MultinomialSampler8Interval6threshE">
<span id="paddle::MultinomialSampler::Interval::thresh__real"></span><span class="target" id="paddlestructpaddle_1_1MultinomialSampler_1_1Interval_1a73a57b9d3fde132ea8306f325b694be0"></span>real <code class="descname">thresh</code><a class="headerlink" href="#_CPPv2N6paddle18MultinomialSampler8Interval6threshE" title="Permalink to this definition">¶</a></dt>
<dd></dd></dl>

</div>
</dd></dl>

</dd></dl>

</div>
<div class="section" id="maxidlayer">
<h2>MaxIdLayer<a class="headerlink" href="#maxidlayer" title="Permalink to this headline">¶</a></h2>
<dl class="class">
<dt id="_CPPv2N6paddle10MaxIdLayerE">
<span id="paddle::MaxIdLayer"></span><span class="target" id="paddleclasspaddle_1_1MaxIdLayer"></span><em class="property">class </em><code class="descclassname">paddle::</code><code class="descname">MaxIdLayer</code><a class="headerlink" href="#_CPPv2N6paddle10MaxIdLayerE" title="Permalink to this definition">¶</a></dt>
<dd><p>A layer for finding the id which has the maximal value for each sample. The result is stored in output_.ids.</p>
<p>The config file api is maxid_layer. </p>
6285
<p>Inherits from <a class="reference internal" href="#paddleclasspaddle_1_1Layer"><span class="std std-ref">paddle::Layer</span></a></p>
6286
<div class="breathe-sectiondef docutils container">
Y
Yu Yang 已提交
6287 6288 6289 6290 6291 6292 6293 6294
<p class="breathe-sectiondef-title rubric">Public Functions</p>
<dl class="function">
<dt id="_CPPv2N6paddle10MaxIdLayer10MaxIdLayerERK11LayerConfig">
<span id="paddle::MaxIdLayer::MaxIdLayer__LayerConfigCR"></span><span class="target" id="paddleclasspaddle_1_1MaxIdLayer_1ab37f1c000aeb0a01990f43fdfde9503b"></span><code class="descname">MaxIdLayer</code><span class="sig-paren">(</span><em class="property">const</em> LayerConfig &amp;<em>config</em><span class="sig-paren">)</span><a class="headerlink" href="#_CPPv2N6paddle10MaxIdLayer10MaxIdLayerERK11LayerConfig" title="Permalink to this definition">¶</a></dt>
<dd></dd></dl>

<dl class="function">
<dt id="_CPPv2N6paddle10MaxIdLayer4initERK8LayerMapRK12ParameterMap">
6295
<span id="paddle::MaxIdLayer::init__LayerMapCR.ParameterMapCR"></span><span class="target" id="paddleclasspaddle_1_1MaxIdLayer_1a32bc6c36eb04fd65fb895f8868a558db"></span><em class="property">virtual</em> bool <code class="descname">init</code><span class="sig-paren">(</span><em class="property">const</em> LayerMap &amp;<em>layerMap</em>, <em class="property">const</em> <a class="reference internal" href="../../parameter/parameter/parameter.html#_CPPv2N6paddle12ParameterMapE" title="paddle::ParameterMap">ParameterMap</a> &amp;<em>parameterMap</em><span class="sig-paren">)</span><a class="headerlink" href="#_CPPv2N6paddle10MaxIdLayer4initERK8LayerMapRK12ParameterMap" title="Permalink to this definition">¶</a></dt>
Y
Yu Yang 已提交
6296 6297 6298 6299 6300
<dd><p>Intialization. For example, adding input layers from layerMap and parameterMap. </p>
</dd></dl>

<dl class="function">
<dt id="_CPPv2N6paddle10MaxIdLayer7forwardE8PassType">
6301
<span id="paddle::MaxIdLayer::forward__PassType"></span><span class="target" id="paddleclasspaddle_1_1MaxIdLayer_1ad7fde1ecd25d0f28881429c748c15fd4"></span><em class="property">virtual</em> void <code class="descname">forward</code><span class="sig-paren">(</span>PassType <em>passType</em><span class="sig-paren">)</span><a class="headerlink" href="#_CPPv2N6paddle10MaxIdLayer7forwardE8PassType" title="Permalink to this definition">¶</a></dt>
Y
Yu Yang 已提交
6302 6303 6304 6305 6306
<dd><p>Forward propagation. All inherited implementation should call Layer::foward() function. </p>
</dd></dl>

<dl class="function">
<dt id="_CPPv2N6paddle10MaxIdLayer8backwardERK14UpdateCallback">
6307
<span id="paddle::MaxIdLayer::backward__UpdateCallbackCR"></span><span class="target" id="paddleclasspaddle_1_1MaxIdLayer_1a29524c685111e990598eb2787ce74ef3"></span><em class="property">virtual</em> void <code class="descname">backward</code><span class="sig-paren">(</span><em class="property">const</em> <a class="reference internal" href="../../parameter/parameter/parameter.html#_CPPv2N6paddle14UpdateCallbackE" title="paddle::UpdateCallback">UpdateCallback</a> &amp;<em>callback</em><span class="sig-paren">)</span><a class="headerlink" href="#_CPPv2N6paddle10MaxIdLayer8backwardERK14UpdateCallback" title="Permalink to this definition">¶</a></dt>
6308
<dd><p>Backward propagation. Should only be called after <a class="reference internal" href="#paddleclasspaddle_1_1Layer_1a12386b3f20dd731e7ceaa2c61667cbe1"><span class="std std-ref">Layer::forward()</span></a> function. </p>
Y
Yu Yang 已提交
6309 6310 6311 6312 6313 6314 6315 6316 6317 6318 6319 6320 6321
</dd></dl>

</div>
</dd></dl>

</div>
<div class="section" id="samplingidlayer">
<h2>SamplingIdLayer<a class="headerlink" href="#samplingidlayer" title="Permalink to this headline">¶</a></h2>
<dl class="class">
<dt id="_CPPv2N6paddle15SamplingIdLayerE">
<span id="paddle::SamplingIdLayer"></span><span class="target" id="paddleclasspaddle_1_1SamplingIdLayer"></span><em class="property">class </em><code class="descclassname">paddle::</code><code class="descname">SamplingIdLayer</code><a class="headerlink" href="#_CPPv2N6paddle15SamplingIdLayerE" title="Permalink to this definition">¶</a></dt>
<dd><p>A layer for sampling id from multinomial distribution from the input layer. Sampling one id for one sample. The result is stored in output_.ids. </p>
<p>The config file api is sampling_id_layer. </p>
6322
<p>Inherits from <a class="reference internal" href="#paddleclasspaddle_1_1Layer"><span class="std std-ref">paddle::Layer</span></a></p>
6323
<div class="breathe-sectiondef docutils container">
Y
Yu Yang 已提交
6324 6325 6326 6327 6328 6329 6330 6331
<p class="breathe-sectiondef-title rubric">Public Functions</p>
<dl class="function">
<dt id="_CPPv2N6paddle15SamplingIdLayer15SamplingIdLayerERK11LayerConfig">
<span id="paddle::SamplingIdLayer::SamplingIdLayer__LayerConfigCR"></span><span class="target" id="paddleclasspaddle_1_1SamplingIdLayer_1ac856de1d1261fe3974370b7256397146"></span><code class="descname">SamplingIdLayer</code><span class="sig-paren">(</span><em class="property">const</em> LayerConfig &amp;<em>config</em><span class="sig-paren">)</span><a class="headerlink" href="#_CPPv2N6paddle15SamplingIdLayer15SamplingIdLayerERK11LayerConfig" title="Permalink to this definition">¶</a></dt>
<dd></dd></dl>

<dl class="function">
<dt id="_CPPv2N6paddle15SamplingIdLayer4initERK8LayerMapRK12ParameterMap">
6332
<span id="paddle::SamplingIdLayer::init__LayerMapCR.ParameterMapCR"></span><span class="target" id="paddleclasspaddle_1_1SamplingIdLayer_1ab326ef42097d3bb2764e71944b198c9a"></span><em class="property">virtual</em> bool <code class="descname">init</code><span class="sig-paren">(</span><em class="property">const</em> LayerMap &amp;<em>layerMap</em>, <em class="property">const</em> <a class="reference internal" href="../../parameter/parameter/parameter.html#_CPPv2N6paddle12ParameterMapE" title="paddle::ParameterMap">ParameterMap</a> &amp;<em>parameterMap</em><span class="sig-paren">)</span><a class="headerlink" href="#_CPPv2N6paddle15SamplingIdLayer4initERK8LayerMapRK12ParameterMap" title="Permalink to this definition">¶</a></dt>
Y
Yu Yang 已提交
6333 6334 6335 6336 6337
<dd><p>Intialization. For example, adding input layers from layerMap and parameterMap. </p>
</dd></dl>

<dl class="function">
<dt id="_CPPv2N6paddle15SamplingIdLayer7forwardE8PassType">
6338
<span id="paddle::SamplingIdLayer::forward__PassType"></span><span class="target" id="paddleclasspaddle_1_1SamplingIdLayer_1a24fa50c609e771c61154519751266838"></span>void <code class="descname">forward</code><span class="sig-paren">(</span>PassType <em>passType</em><span class="sig-paren">)</span><a class="headerlink" href="#_CPPv2N6paddle15SamplingIdLayer7forwardE8PassType" title="Permalink to this definition">¶</a></dt>
Y
Yu Yang 已提交
6339 6340 6341 6342 6343 6344 6345 6346 6347 6348
<dd><p>Forward propagation. All inherited implementation should call Layer::foward() function. </p>
</dd></dl>

<dl class="function">
<dt id="_CPPv2N6paddle15SamplingIdLayer10forwardImpERK8Argument">
<span id="paddle::SamplingIdLayer::forwardImp__ArgumentCR"></span><span class="target" id="paddleclasspaddle_1_1SamplingIdLayer_1a3db971bb58438a166fd4bab3cf69835a"></span>void <code class="descname">forwardImp</code><span class="sig-paren">(</span><em class="property">const</em> <a class="reference internal" href="../../parameter/parameter/parameter.html#_CPPv2N6paddle8ArgumentE" title="paddle::Argument">Argument</a> &amp;<em>input</em><span class="sig-paren">)</span><a class="headerlink" href="#_CPPv2N6paddle15SamplingIdLayer10forwardImpERK8Argument" title="Permalink to this definition">¶</a></dt>
<dd></dd></dl>

<dl class="function">
<dt id="_CPPv2N6paddle15SamplingIdLayer8backwardERK14UpdateCallback">
6349
<span id="paddle::SamplingIdLayer::backward__UpdateCallbackCR"></span><span class="target" id="paddleclasspaddle_1_1SamplingIdLayer_1a6a635c2baa4243f739f9af2f6485da4d"></span><em class="property">virtual</em> void <code class="descname">backward</code><span class="sig-paren">(</span><em class="property">const</em> <a class="reference internal" href="../../parameter/parameter/parameter.html#_CPPv2N6paddle14UpdateCallbackE" title="paddle::UpdateCallback">UpdateCallback</a> &amp;<em>callback</em><span class="sig-paren">)</span><a class="headerlink" href="#_CPPv2N6paddle15SamplingIdLayer8backwardERK14UpdateCallback" title="Permalink to this definition">¶</a></dt>
6350
<dd><p>Backward propagation. Should only be called after <a class="reference internal" href="#paddleclasspaddle_1_1Layer_1a12386b3f20dd731e7ceaa2c61667cbe1"><span class="std std-ref">Layer::forward()</span></a> function. </p>
Y
Yu Yang 已提交
6351 6352 6353 6354 6355 6356 6357 6358 6359 6360 6361 6362 6363 6364 6365
</dd></dl>

</div>
</dd></dl>

</div>
</div>
<div class="section" id="cost-layers">
<h1>Cost Layers<a class="headerlink" href="#cost-layers" title="Permalink to this headline">¶</a></h1>
<div class="section" id="costlayer">
<h2>CostLayer<a class="headerlink" href="#costlayer" title="Permalink to this headline">¶</a></h2>
<dl class="class">
<dt id="_CPPv2N6paddle9CostLayerE">
<span id="paddle::CostLayer"></span><span class="target" id="paddleclasspaddle_1_1CostLayer"></span><em class="property">class </em><code class="descclassname">paddle::</code><code class="descname">CostLayer</code><a class="headerlink" href="#_CPPv2N6paddle9CostLayerE" title="Permalink to this definition">¶</a></dt>
<dd><p>Base class for a particular type of cost layer. This type of cost should have one data layer, one label layer and an optional weight layer as input. The derived class should implemnt forwardImp() and backwardImp() which calculate the cost for data and label. The weight is automatically handled by the base class. </p>
6366 6367
<p>Inherits from <a class="reference internal" href="#paddleclasspaddle_1_1Layer"><span class="std std-ref">paddle::Layer</span></a></p>
<p>Subclassed by <a class="reference internal" href="#paddleclasspaddle_1_1HuberTwoClass"><span class="std std-ref">paddle::HuberTwoClass</span></a>, <a class="reference internal" href="#paddleclasspaddle_1_1MultiBinaryLabelCrossEntropy"><span class="std std-ref">paddle::MultiBinaryLabelCrossEntropy</span></a>, <a class="reference internal" href="#paddleclasspaddle_1_1MultiClassCrossEntropy"><span class="std std-ref">paddle::MultiClassCrossEntropy</span></a>, <a class="reference internal" href="#paddleclasspaddle_1_1MultiClassCrossEntropyWithSelfNorm"><span class="std std-ref">paddle::MultiClassCrossEntropyWithSelfNorm</span></a>, <a class="reference internal" href="#paddleclasspaddle_1_1SoftBinaryClassCrossEntropy"><span class="std std-ref">paddle::SoftBinaryClassCrossEntropy</span></a>, <a class="reference internal" href="#paddleclasspaddle_1_1SumOfSquaresCostLayer"><span class="std std-ref">paddle::SumOfSquaresCostLayer</span></a></p>
6368
<div class="breathe-sectiondef docutils container">
Y
Yu Yang 已提交
6369 6370 6371 6372 6373 6374 6375 6376
<p class="breathe-sectiondef-title rubric">Public Functions</p>
<dl class="function">
<dt id="_CPPv2N6paddle9CostLayer9CostLayerERK11LayerConfig">
<span id="paddle::CostLayer::CostLayer__LayerConfigCR"></span><span class="target" id="paddleclasspaddle_1_1CostLayer_1a091a6893b7b4149a2152cc1f910b2442"></span><code class="descname">CostLayer</code><span class="sig-paren">(</span><em class="property">const</em> LayerConfig &amp;<em>config</em><span class="sig-paren">)</span><a class="headerlink" href="#_CPPv2N6paddle9CostLayer9CostLayerERK11LayerConfig" title="Permalink to this definition">¶</a></dt>
<dd></dd></dl>

<dl class="function">
<dt id="_CPPv2N6paddle9CostLayer4initERK8LayerMapRK12ParameterMap">
6377
<span id="paddle::CostLayer::init__LayerMapCR.ParameterMapCR"></span><span class="target" id="paddleclasspaddle_1_1CostLayer_1a9e45d06813dfb5f8f12b52cb5cea916c"></span>bool <code class="descname">init</code><span class="sig-paren">(</span><em class="property">const</em> LayerMap &amp;<em>layerMap</em>, <em class="property">const</em> <a class="reference internal" href="../../parameter/parameter/parameter.html#_CPPv2N6paddle12ParameterMapE" title="paddle::ParameterMap">ParameterMap</a> &amp;<em>parameterMap</em><span class="sig-paren">)</span><a class="headerlink" href="#_CPPv2N6paddle9CostLayer4initERK8LayerMapRK12ParameterMap" title="Permalink to this definition">¶</a></dt>
Y
Yu Yang 已提交
6378 6379 6380 6381 6382 6383 6384 6385 6386 6387 6388 6389 6390 6391 6392
<dd><p>Intialization. For example, adding input layers from layerMap and parameterMap. </p>
</dd></dl>

<dl class="function">
<dt id="_CPPv2N6paddle9CostLayer14getOutputLayerEv">
<span id="paddle::CostLayer::getOutputLayer"></span><span class="target" id="paddleclasspaddle_1_1CostLayer_1ac8085623913acdd082c5e8bc66972184"></span>LayerPtr <code class="descname">getOutputLayer</code><span class="sig-paren">(</span><span class="sig-paren">)</span><a class="headerlink" href="#_CPPv2N6paddle9CostLayer14getOutputLayerEv" title="Permalink to this definition">¶</a></dt>
<dd></dd></dl>

<dl class="function">
<dt id="_CPPv2N6paddle9CostLayer13getLabelLayerEv">
<span id="paddle::CostLayer::getLabelLayer"></span><span class="target" id="paddleclasspaddle_1_1CostLayer_1a64a7499f9594553ac4e7ac93fea4801c"></span>LayerPtr <code class="descname">getLabelLayer</code><span class="sig-paren">(</span><span class="sig-paren">)</span><a class="headerlink" href="#_CPPv2N6paddle9CostLayer13getLabelLayerEv" title="Permalink to this definition">¶</a></dt>
<dd></dd></dl>

<dl class="function">
<dt id="_CPPv2N6paddle9CostLayer7forwardE8PassType">
6393
<span id="paddle::CostLayer::forward__PassType"></span><span class="target" id="paddleclasspaddle_1_1CostLayer_1aa78b8d0ef1984c3ae0e00592032be687"></span>void <code class="descname">forward</code><span class="sig-paren">(</span>PassType <em>passType</em><span class="sig-paren">)</span><a class="headerlink" href="#_CPPv2N6paddle9CostLayer7forwardE8PassType" title="Permalink to this definition">¶</a></dt>
Y
Yu Yang 已提交
6394 6395 6396 6397 6398
<dd><p>Forward propagation. All inherited implementation should call Layer::foward() function. </p>
</dd></dl>

<dl class="function">
<dt id="_CPPv2N6paddle9CostLayer8backwardERK14UpdateCallback">
6399
<span id="paddle::CostLayer::backward__UpdateCallbackCR"></span><span class="target" id="paddleclasspaddle_1_1CostLayer_1a075f1d0143e93363eb4c24859e7c48db"></span>void <code class="descname">backward</code><span class="sig-paren">(</span><em class="property">const</em> <a class="reference internal" href="../../parameter/parameter/parameter.html#_CPPv2N6paddle14UpdateCallbackE" title="paddle::UpdateCallback">UpdateCallback</a> &amp;<em>callback</em> = nullptr<span class="sig-paren">)</span><a class="headerlink" href="#_CPPv2N6paddle9CostLayer8backwardERK14UpdateCallback" title="Permalink to this definition">¶</a></dt>
6400
<dd><p>Backward propagation. Should only be called after <a class="reference internal" href="#paddleclasspaddle_1_1Layer_1a12386b3f20dd731e7ceaa2c61667cbe1"><span class="std std-ref">Layer::forward()</span></a> function. </p>
Y
Yu Yang 已提交
6401 6402 6403 6404
</dd></dl>

<dl class="function">
<dt id="_CPPv2N6paddle9CostLayer10forwardImpER6MatrixR8ArgumentR6Matrix">
6405
<span id="paddle::CostLayer::forwardImp__MatrixR.ArgumentR.MatrixR"></span><span class="target" id="paddleclasspaddle_1_1CostLayer_1a283f961db5a5e34eb988bff20fd1395a"></span><em class="property">virtual</em> void <code class="descname">forwardImp</code><span class="sig-paren">(</span><a class="reference internal" href="../../math/matrix/matrix.html#_CPPv2N6paddle6MatrixE" title="paddle::Matrix">Matrix</a> &amp;<em>outputValue</em>, <a class="reference internal" href="../../parameter/parameter/parameter.html#_CPPv2N6paddle8ArgumentE" title="paddle::Argument">Argument</a> &amp;<em>label</em>, <a class="reference internal" href="../../math/matrix/matrix.html#_CPPv2N6paddle6MatrixE" title="paddle::Matrix">Matrix</a> &amp;<em>cost</em><span class="sig-paren">)</span> = 0<a class="headerlink" href="#_CPPv2N6paddle9CostLayer10forwardImpER6MatrixR8ArgumentR6Matrix" title="Permalink to this definition">¶</a></dt>
Y
Yu Yang 已提交
6406 6407 6408 6409
<dd></dd></dl>

<dl class="function">
<dt id="_CPPv2N6paddle9CostLayer11backwardImpER6MatrixR8ArgumentR6Matrix">
6410
<span id="paddle::CostLayer::backwardImp__MatrixR.ArgumentR.MatrixR"></span><span class="target" id="paddleclasspaddle_1_1CostLayer_1a4f47d7e20b3eaddc4925f75d2e66146b"></span><em class="property">virtual</em> void <code class="descname">backwardImp</code><span class="sig-paren">(</span><a class="reference internal" href="../../math/matrix/matrix.html#_CPPv2N6paddle6MatrixE" title="paddle::Matrix">Matrix</a> &amp;<em>outputValue</em>, <a class="reference internal" href="../../parameter/parameter/parameter.html#_CPPv2N6paddle8ArgumentE" title="paddle::Argument">Argument</a> &amp;<em>label</em>, <a class="reference internal" href="../../math/matrix/matrix.html#_CPPv2N6paddle6MatrixE" title="paddle::Matrix">Matrix</a> &amp;<em>outputGrad</em><span class="sig-paren">)</span> = 0<a class="headerlink" href="#_CPPv2N6paddle9CostLayer11backwardImpER6MatrixR8ArgumentR6Matrix" title="Permalink to this definition">¶</a></dt>
Y
Yu Yang 已提交
6411 6412 6413
<dd></dd></dl>

</div>
6414
<div class="breathe-sectiondef docutils container">
Y
Yu Yang 已提交
6415 6416 6417 6418 6419 6420 6421 6422 6423 6424 6425 6426 6427 6428 6429 6430 6431 6432 6433
<p class="breathe-sectiondef-title rubric">Protected Attributes</p>
<dl class="member">
<dt id="_CPPv2N6paddle9CostLayer12weightLayer_E">
<span id="paddle::CostLayer::weightLayer___LayerPtr"></span><span class="target" id="paddleclasspaddle_1_1CostLayer_1aeacf427349162ea41ffc2151ced09ad9"></span>LayerPtr <code class="descname">weightLayer_</code><a class="headerlink" href="#_CPPv2N6paddle9CostLayer12weightLayer_E" title="Permalink to this definition">¶</a></dt>
<dd></dd></dl>

<dl class="member">
<dt id="_CPPv2N6paddle9CostLayer6coeff_E">
<span id="paddle::CostLayer::coeff___real"></span><span class="target" id="paddleclasspaddle_1_1CostLayer_1a5fc0ec2edf44217f2b942426556c36d3"></span>real <code class="descname">coeff_</code><a class="headerlink" href="#_CPPv2N6paddle9CostLayer6coeff_E" title="Permalink to this definition">¶</a></dt>
<dd></dd></dl>

</div>
</dd></dl>

<div class="section" id="hubertwoclass">
<h3>HuberTwoClass<a class="headerlink" href="#hubertwoclass" title="Permalink to this headline">¶</a></h3>
<dl class="class">
<dt id="_CPPv2N6paddle13HuberTwoClassE">
<span id="paddle::HuberTwoClass"></span><span class="target" id="paddleclasspaddle_1_1HuberTwoClass"></span><em class="property">class </em><code class="descclassname">paddle::</code><code class="descname">HuberTwoClass</code><a class="headerlink" href="#_CPPv2N6paddle13HuberTwoClassE" title="Permalink to this definition">¶</a></dt>
Y
Yu Yang 已提交
6434 6435 6436 6437
<dd><p>Huber loss for robust 2-classes classification.</p>
<p>For label={0, 1}, let y=2*label-1. Given output f, the loss is: <div class="math">
\[\begin{split} Loss = \left\{\begin{matrix} 4 * y * f &amp; \textit{if} \ \ y* f &lt; -1 \\ (1 - y * f)^2 &amp; \textit{if} \ \ -1 &lt; y * f &lt; 1 \\ 0 &amp; \textit{otherwise} \end{matrix}\right. \end{split}\]</div>
 </p>
6438
<p>Inherits from <a class="reference internal" href="#paddleclasspaddle_1_1CostLayer"><span class="std std-ref">paddle::CostLayer</span></a></p>
6439
<div class="breathe-sectiondef docutils container">
Y
Yu Yang 已提交
6440 6441 6442 6443 6444 6445 6446 6447
<p class="breathe-sectiondef-title rubric">Public Functions</p>
<dl class="function">
<dt id="_CPPv2N6paddle13HuberTwoClass13HuberTwoClassERK11LayerConfig">
<span id="paddle::HuberTwoClass::HuberTwoClass__LayerConfigCR"></span><span class="target" id="paddleclasspaddle_1_1HuberTwoClass_1a12f0f4467b7da6613ebfc363ff1aeb8b"></span><code class="descname">HuberTwoClass</code><span class="sig-paren">(</span><em class="property">const</em> LayerConfig &amp;<em>config</em><span class="sig-paren">)</span><a class="headerlink" href="#_CPPv2N6paddle13HuberTwoClass13HuberTwoClassERK11LayerConfig" title="Permalink to this definition">¶</a></dt>
<dd></dd></dl>

<dl class="function">
<dt id="_CPPv2N6paddle13HuberTwoClass4initERK8LayerMapRK12ParameterMap">
6448
<span id="paddle::HuberTwoClass::init__LayerMapCR.ParameterMapCR"></span><span class="target" id="paddleclasspaddle_1_1HuberTwoClass_1a1b12599abee6dda6b2fb2bff1675d93a"></span>bool <code class="descname">init</code><span class="sig-paren">(</span><em class="property">const</em> LayerMap &amp;<em>layerMap</em>, <em class="property">const</em> <a class="reference internal" href="../../parameter/parameter/parameter.html#_CPPv2N6paddle12ParameterMapE" title="paddle::ParameterMap">ParameterMap</a> &amp;<em>parameterMap</em><span class="sig-paren">)</span><a class="headerlink" href="#_CPPv2N6paddle13HuberTwoClass4initERK8LayerMapRK12ParameterMap" title="Permalink to this definition">¶</a></dt>
Y
Yu Yang 已提交
6449 6450 6451 6452 6453
<dd><p>Intialization. For example, adding input layers from layerMap and parameterMap. </p>
</dd></dl>

<dl class="function">
<dt id="_CPPv2N6paddle13HuberTwoClass10forwardImpER6MatrixR8ArgumentR6Matrix">
6454
<span id="paddle::HuberTwoClass::forwardImp__MatrixR.ArgumentR.MatrixR"></span><span class="target" id="paddleclasspaddle_1_1HuberTwoClass_1ab29f41a7f82870dd2b3ea00d0e797dd5"></span>void <code class="descname">forwardImp</code><span class="sig-paren">(</span><a class="reference internal" href="../../math/matrix/matrix.html#_CPPv2N6paddle6MatrixE" title="paddle::Matrix">Matrix</a> &amp;<em>output</em>, <a class="reference internal" href="../../parameter/parameter/parameter.html#_CPPv2N6paddle8ArgumentE" title="paddle::Argument">Argument</a> &amp;<em>label</em>, <a class="reference internal" href="../../math/matrix/matrix.html#_CPPv2N6paddle6MatrixE" title="paddle::Matrix">Matrix</a> &amp;<em>cost</em><span class="sig-paren">)</span><a class="headerlink" href="#_CPPv2N6paddle13HuberTwoClass10forwardImpER6MatrixR8ArgumentR6Matrix" title="Permalink to this definition">¶</a></dt>
Y
Yu Yang 已提交
6455 6456 6457 6458 6459 6460 6461 6462 6463
<dd></dd></dl>

<dl class="function">
<dt id="_CPPv2N6paddle13HuberTwoClass12forwardImpInER6MatrixR8ArgumentR6Matrix">
<span id="paddle::HuberTwoClass::forwardImpIn__MatrixR.ArgumentR.MatrixR"></span><span class="target" id="paddleclasspaddle_1_1HuberTwoClass_1aec7436147ec76f89c208bc44158a8bea"></span>void <code class="descname">forwardImpIn</code><span class="sig-paren">(</span><a class="reference internal" href="../../math/matrix/matrix.html#_CPPv2N6paddle6MatrixE" title="paddle::Matrix">Matrix</a> &amp;<em>output</em>, <a class="reference internal" href="../../parameter/parameter/parameter.html#_CPPv2N6paddle8ArgumentE" title="paddle::Argument">Argument</a> &amp;<em>label</em>, <a class="reference internal" href="../../math/matrix/matrix.html#_CPPv2N6paddle6MatrixE" title="paddle::Matrix">Matrix</a> &amp;<em>cost</em><span class="sig-paren">)</span><a class="headerlink" href="#_CPPv2N6paddle13HuberTwoClass12forwardImpInER6MatrixR8ArgumentR6Matrix" title="Permalink to this definition">¶</a></dt>
<dd></dd></dl>

<dl class="function">
<dt id="_CPPv2N6paddle13HuberTwoClass11backwardImpER6MatrixR8ArgumentR6Matrix">
6464
<span id="paddle::HuberTwoClass::backwardImp__MatrixR.ArgumentR.MatrixR"></span><span class="target" id="paddleclasspaddle_1_1HuberTwoClass_1a18abfe1ad0d2eec6018e8b98eb12909a"></span>void <code class="descname">backwardImp</code><span class="sig-paren">(</span><a class="reference internal" href="../../math/matrix/matrix.html#_CPPv2N6paddle6MatrixE" title="paddle::Matrix">Matrix</a> &amp;<em>outputValue</em>, <a class="reference internal" href="../../parameter/parameter/parameter.html#_CPPv2N6paddle8ArgumentE" title="paddle::Argument">Argument</a> &amp;<em>label</em>, <a class="reference internal" href="../../math/matrix/matrix.html#_CPPv2N6paddle6MatrixE" title="paddle::Matrix">Matrix</a> &amp;<em>outputGrad</em><span class="sig-paren">)</span><a class="headerlink" href="#_CPPv2N6paddle13HuberTwoClass11backwardImpER6MatrixR8ArgumentR6Matrix" title="Permalink to this definition">¶</a></dt>
Y
Yu Yang 已提交
6465 6466 6467 6468 6469 6470 6471 6472 6473 6474 6475 6476 6477 6478 6479 6480
<dd></dd></dl>

<dl class="function">
<dt id="_CPPv2N6paddle13HuberTwoClass13backwardImpInER6MatrixR8ArgumentR6Matrix">
<span id="paddle::HuberTwoClass::backwardImpIn__MatrixR.ArgumentR.MatrixR"></span><span class="target" id="paddleclasspaddle_1_1HuberTwoClass_1a7742e711ac1801de5af17535b52652ac"></span>void <code class="descname">backwardImpIn</code><span class="sig-paren">(</span><a class="reference internal" href="../../math/matrix/matrix.html#_CPPv2N6paddle6MatrixE" title="paddle::Matrix">Matrix</a> &amp;<em>outputValue</em>, <a class="reference internal" href="../../parameter/parameter/parameter.html#_CPPv2N6paddle8ArgumentE" title="paddle::Argument">Argument</a> &amp;<em>label</em>, <a class="reference internal" href="../../math/matrix/matrix.html#_CPPv2N6paddle6MatrixE" title="paddle::Matrix">Matrix</a> &amp;<em>outputGrad</em><span class="sig-paren">)</span><a class="headerlink" href="#_CPPv2N6paddle13HuberTwoClass13backwardImpInER6MatrixR8ArgumentR6Matrix" title="Permalink to this definition">¶</a></dt>
<dd></dd></dl>

</div>
</dd></dl>

</div>
<div class="section" id="lambdacost">
<h3>LambdaCost<a class="headerlink" href="#lambdacost" title="Permalink to this headline">¶</a></h3>
<dl class="class">
<dt id="_CPPv2N6paddle10LambdaCostE">
<span id="paddle::LambdaCost"></span><span class="target" id="paddleclasspaddle_1_1LambdaCost"></span><em class="property">class </em><code class="descclassname">paddle::</code><code class="descname">LambdaCost</code><a class="headerlink" href="#_CPPv2N6paddle10LambdaCostE" title="Permalink to this definition">¶</a></dt>
Y
Yu Yang 已提交
6481 6482 6483 6484 6485
<dd><p>LambdaRank os a method for learning arbitrary information retrieval measures. It can be applied to any algorithm that learns through gradient descent. LambdaRank is a listwise method, in that the cost depends on the sorted order of the documents. LambdaRank gives the gradient of cost function:</p>
<p><div class="math">
\[ \lambda_{ij} = \frac{1}{1 + e^{o_i - o_j}} \left| \Delta_{NDCG} \right| \]</div>
</p>
<p>[1] Christopher J.C. Burges, Robert Ragno, Quoc Viet Le. Learning to Rank with Nonsmooth Cost Functions. </p>
6486
<p>Inherits from <a class="reference internal" href="#paddleclasspaddle_1_1Layer"><span class="std std-ref">paddle::Layer</span></a></p>
6487
<div class="breathe-sectiondef docutils container">
Y
Yu Yang 已提交
6488 6489 6490 6491 6492 6493 6494 6495
<p class="breathe-sectiondef-title rubric">Public Functions</p>
<dl class="function">
<dt id="_CPPv2N6paddle10LambdaCost10LambdaCostERK11LayerConfig">
<span id="paddle::LambdaCost::LambdaCost__LayerConfigCR"></span><span class="target" id="paddleclasspaddle_1_1LambdaCost_1a632a61afa4d6fb85ffba100f79fee6d2"></span><code class="descname">LambdaCost</code><span class="sig-paren">(</span><em class="property">const</em> LayerConfig &amp;<em>config</em><span class="sig-paren">)</span><a class="headerlink" href="#_CPPv2N6paddle10LambdaCost10LambdaCostERK11LayerConfig" title="Permalink to this definition">¶</a></dt>
<dd></dd></dl>

<dl class="function">
<dt id="_CPPv2N6paddle10LambdaCost4initERK8LayerMapRK12ParameterMap">
6496
<span id="paddle::LambdaCost::init__LayerMapCR.ParameterMapCR"></span><span class="target" id="paddleclasspaddle_1_1LambdaCost_1a73d70f4561f57455366014cc0ce158e7"></span>bool <code class="descname">init</code><span class="sig-paren">(</span><em class="property">const</em> LayerMap &amp;<em>layerMap</em>, <em class="property">const</em> <a class="reference internal" href="../../parameter/parameter/parameter.html#_CPPv2N6paddle12ParameterMapE" title="paddle::ParameterMap">ParameterMap</a> &amp;<em>parameterMap</em><span class="sig-paren">)</span><a class="headerlink" href="#_CPPv2N6paddle10LambdaCost4initERK8LayerMapRK12ParameterMap" title="Permalink to this definition">¶</a></dt>
Y
Yu Yang 已提交
6497 6498 6499 6500 6501 6502 6503 6504 6505 6506 6507 6508 6509 6510 6511
<dd><p>Intialization. For example, adding input layers from layerMap and parameterMap. </p>
</dd></dl>

<dl class="function">
<dt id="_CPPv2N6paddle10LambdaCost14getOutputLayerEv">
<span id="paddle::LambdaCost::getOutputLayer"></span><span class="target" id="paddleclasspaddle_1_1LambdaCost_1af30ec11bbe3c5ca5cabfb952c131977a"></span>LayerPtr <code class="descname">getOutputLayer</code><span class="sig-paren">(</span><span class="sig-paren">)</span><a class="headerlink" href="#_CPPv2N6paddle10LambdaCost14getOutputLayerEv" title="Permalink to this definition">¶</a></dt>
<dd></dd></dl>

<dl class="function">
<dt id="_CPPv2N6paddle10LambdaCost13getScoreLayerEv">
<span id="paddle::LambdaCost::getScoreLayer"></span><span class="target" id="paddleclasspaddle_1_1LambdaCost_1a57cdd6eae62a256eb3f0beba08aed894"></span>LayerPtr <code class="descname">getScoreLayer</code><span class="sig-paren">(</span><span class="sig-paren">)</span><a class="headerlink" href="#_CPPv2N6paddle10LambdaCost13getScoreLayerEv" title="Permalink to this definition">¶</a></dt>
<dd></dd></dl>

<dl class="function">
<dt id="_CPPv2N6paddle10LambdaCost7forwardE8PassType">
6512
<span id="paddle::LambdaCost::forward__PassType"></span><span class="target" id="paddleclasspaddle_1_1LambdaCost_1a6ac3e4f3b546222abfa19fd69bf41b01"></span>void <code class="descname">forward</code><span class="sig-paren">(</span>PassType <em>passType</em><span class="sig-paren">)</span><a class="headerlink" href="#_CPPv2N6paddle10LambdaCost7forwardE8PassType" title="Permalink to this definition">¶</a></dt>
Y
Yu Yang 已提交
6513 6514 6515 6516 6517
<dd><p>Forward propagation. All inherited implementation should call Layer::foward() function. </p>
</dd></dl>

<dl class="function">
<dt id="_CPPv2N6paddle10LambdaCost8backwardERK14UpdateCallback">
6518
<span id="paddle::LambdaCost::backward__UpdateCallbackCR"></span><span class="target" id="paddleclasspaddle_1_1LambdaCost_1af7f79b600b793b60859a201aa66af3e4"></span>void <code class="descname">backward</code><span class="sig-paren">(</span><em class="property">const</em> <a class="reference internal" href="../../parameter/parameter/parameter.html#_CPPv2N6paddle14UpdateCallbackE" title="paddle::UpdateCallback">UpdateCallback</a> &amp;<em>callback</em> = nullptr<span class="sig-paren">)</span><a class="headerlink" href="#_CPPv2N6paddle10LambdaCost8backwardERK14UpdateCallback" title="Permalink to this definition">¶</a></dt>
6519
<dd><p>Backward propagation. Should only be called after <a class="reference internal" href="#paddleclasspaddle_1_1Layer_1a12386b3f20dd731e7ceaa2c61667cbe1"><span class="std std-ref">Layer::forward()</span></a> function. </p>
Y
Yu Yang 已提交
6520 6521 6522 6523
</dd></dl>

<dl class="function">
<dt id="_CPPv2N6paddle10LambdaCost9onPassEndEv">
6524
<span id="paddle::LambdaCost::onPassEnd"></span><span class="target" id="paddleclasspaddle_1_1LambdaCost_1ad3d5bbe1a620ade44b59623053da0d39"></span>void <code class="descname">onPassEnd</code><span class="sig-paren">(</span><span class="sig-paren">)</span><a class="headerlink" href="#_CPPv2N6paddle10LambdaCost9onPassEndEv" title="Permalink to this definition">¶</a></dt>
Y
Yu Yang 已提交
6525 6526 6527 6528 6529 6530 6531 6532 6533 6534 6535 6536 6537 6538 6539 6540 6541 6542 6543 6544 6545 6546
<dd><p>One pass is finished. </p>
</dd></dl>

<dl class="function">
<dt id="_CPPv2N6paddle10LambdaCost8calcNDCGEPK4realPK4reali">
<span id="paddle::LambdaCost::calcNDCG__realCP.realCP.i"></span><span class="target" id="paddleclasspaddle_1_1LambdaCost_1ab1aab43db90d239172660df773081f2f"></span>real <code class="descname">calcNDCG</code><span class="sig-paren">(</span><em class="property">const</em> real *<em>outputScore</em>, <em class="property">const</em> real *<em>score</em>, int <em>size</em><span class="sig-paren">)</span><a class="headerlink" href="#_CPPv2N6paddle10LambdaCost8calcNDCGEPK4realPK4reali" title="Permalink to this definition">¶</a></dt>
<dd></dd></dl>

<dl class="function">
<dt id="_CPPv2N6paddle10LambdaCost8calcGradEPK4realPK4realP4reali">
<span id="paddle::LambdaCost::calcGrad__realCP.realCP.realP.i"></span><span class="target" id="paddleclasspaddle_1_1LambdaCost_1a64be625219ae8008714fae7714ac1c2e"></span>void <code class="descname">calcGrad</code><span class="sig-paren">(</span><em class="property">const</em> real *<em>outputScore</em>, <em class="property">const</em> real *<em>score</em>, real *<em>gradData</em>, int <em>size</em><span class="sig-paren">)</span><a class="headerlink" href="#_CPPv2N6paddle10LambdaCost8calcGradEPK4realPK4realP4reali" title="Permalink to this definition">¶</a></dt>
<dd></dd></dl>

</div>
</dd></dl>

</div>
<div class="section" id="multibinarylabelcrossentropy">
<h3>MultiBinaryLabelCrossEntropy<a class="headerlink" href="#multibinarylabelcrossentropy" title="Permalink to this headline">¶</a></h3>
<dl class="class">
<dt id="_CPPv2N6paddle28MultiBinaryLabelCrossEntropyE">
<span id="paddle::MultiBinaryLabelCrossEntropy"></span><span class="target" id="paddleclasspaddle_1_1MultiBinaryLabelCrossEntropy"></span><em class="property">class </em><code class="descclassname">paddle::</code><code class="descname">MultiBinaryLabelCrossEntropy</code><a class="headerlink" href="#_CPPv2N6paddle28MultiBinaryLabelCrossEntropyE" title="Permalink to this definition">¶</a></dt>
Y
Yu Yang 已提交
6547 6548 6549
<dd><p>Cross entropy for multi binary labels. <div class="math">
\[ cost[i] = -sum(label[i][j]*log(output[i][j]) + (1-label[i][j])*log(1-output[i][j])) \]</div>
 </p>
6550
<p>Inherits from <a class="reference internal" href="#paddleclasspaddle_1_1CostLayer"><span class="std std-ref">paddle::CostLayer</span></a></p>
6551
<div class="breathe-sectiondef docutils container">
Y
Yu Yang 已提交
6552 6553 6554 6555 6556 6557 6558 6559
<p class="breathe-sectiondef-title rubric">Public Functions</p>
<dl class="function">
<dt id="_CPPv2N6paddle28MultiBinaryLabelCrossEntropy28MultiBinaryLabelCrossEntropyERK11LayerConfig">
<span id="paddle::MultiBinaryLabelCrossEntropy::MultiBinaryLabelCrossEntropy__LayerConfigCR"></span><span class="target" id="paddleclasspaddle_1_1MultiBinaryLabelCrossEntropy_1a74e83fd2cf372b582edfc120a7730ab2"></span><code class="descname">MultiBinaryLabelCrossEntropy</code><span class="sig-paren">(</span><em class="property">const</em> LayerConfig &amp;<em>config</em><span class="sig-paren">)</span><a class="headerlink" href="#_CPPv2N6paddle28MultiBinaryLabelCrossEntropy28MultiBinaryLabelCrossEntropyERK11LayerConfig" title="Permalink to this definition">¶</a></dt>
<dd></dd></dl>

<dl class="function">
<dt id="_CPPv2N6paddle28MultiBinaryLabelCrossEntropy4initERK8LayerMapRK12ParameterMap">
6560
<span id="paddle::MultiBinaryLabelCrossEntropy::init__LayerMapCR.ParameterMapCR"></span><span class="target" id="paddleclasspaddle_1_1MultiBinaryLabelCrossEntropy_1a6ee4833b0cade46c75647b273e2d7909"></span>bool <code class="descname">init</code><span class="sig-paren">(</span><em class="property">const</em> LayerMap &amp;<em>layerMap</em>, <em class="property">const</em> <a class="reference internal" href="../../parameter/parameter/parameter.html#_CPPv2N6paddle12ParameterMapE" title="paddle::ParameterMap">ParameterMap</a> &amp;<em>parameterMap</em><span class="sig-paren">)</span><a class="headerlink" href="#_CPPv2N6paddle28MultiBinaryLabelCrossEntropy4initERK8LayerMapRK12ParameterMap" title="Permalink to this definition">¶</a></dt>
Y
Yu Yang 已提交
6561 6562 6563 6564 6565
<dd><p>Intialization. For example, adding input layers from layerMap and parameterMap. </p>
</dd></dl>

<dl class="function">
<dt id="_CPPv2N6paddle28MultiBinaryLabelCrossEntropy10forwardImpER6MatrixR8ArgumentR6Matrix">
6566
<span id="paddle::MultiBinaryLabelCrossEntropy::forwardImp__MatrixR.ArgumentR.MatrixR"></span><span class="target" id="paddleclasspaddle_1_1MultiBinaryLabelCrossEntropy_1ad437bc05520ccda57287cc63a8cc4f35"></span>void <code class="descname">forwardImp</code><span class="sig-paren">(</span><a class="reference internal" href="../../math/matrix/matrix.html#_CPPv2N6paddle6MatrixE" title="paddle::Matrix">Matrix</a> &amp;<em>output</em>, <a class="reference internal" href="../../parameter/parameter/parameter.html#_CPPv2N6paddle8ArgumentE" title="paddle::Argument">Argument</a> &amp;<em>label</em>, <a class="reference internal" href="../../math/matrix/matrix.html#_CPPv2N6paddle6MatrixE" title="paddle::Matrix">Matrix</a> &amp;<em>cost</em><span class="sig-paren">)</span><a class="headerlink" href="#_CPPv2N6paddle28MultiBinaryLabelCrossEntropy10forwardImpER6MatrixR8ArgumentR6Matrix" title="Permalink to this definition">¶</a></dt>
Y
Yu Yang 已提交
6567 6568 6569 6570
<dd></dd></dl>

<dl class="function">
<dt id="_CPPv2N6paddle28MultiBinaryLabelCrossEntropy11backwardImpER6MatrixR8ArgumentR6Matrix">
6571
<span id="paddle::MultiBinaryLabelCrossEntropy::backwardImp__MatrixR.ArgumentR.MatrixR"></span><span class="target" id="paddleclasspaddle_1_1MultiBinaryLabelCrossEntropy_1adb7148edf59bd5e3c6376b087fd70630"></span>void <code class="descname">backwardImp</code><span class="sig-paren">(</span><a class="reference internal" href="../../math/matrix/matrix.html#_CPPv2N6paddle6MatrixE" title="paddle::Matrix">Matrix</a> &amp;<em>outputValue</em>, <a class="reference internal" href="../../parameter/parameter/parameter.html#_CPPv2N6paddle8ArgumentE" title="paddle::Argument">Argument</a> &amp;<em>label</em>, <a class="reference internal" href="../../math/matrix/matrix.html#_CPPv2N6paddle6MatrixE" title="paddle::Matrix">Matrix</a> &amp;<em>outputGrad</em><span class="sig-paren">)</span><a class="headerlink" href="#_CPPv2N6paddle28MultiBinaryLabelCrossEntropy11backwardImpER6MatrixR8ArgumentR6Matrix" title="Permalink to this definition">¶</a></dt>
Y
Yu Yang 已提交
6572 6573 6574
<dd></dd></dl>

</div>
6575
<div class="breathe-sectiondef docutils container">
Y
Yu Yang 已提交
6576 6577 6578 6579 6580 6581 6582 6583 6584 6585 6586 6587 6588 6589 6590
<p class="breathe-sectiondef-title rubric">Protected Attributes</p>
<dl class="member">
<dt id="_CPPv2N6paddle28MultiBinaryLabelCrossEntropy13targetPerDim_E">
<span id="paddle::MultiBinaryLabelCrossEntropy::targetPerDim___MatrixPtr"></span><span class="target" id="paddleclasspaddle_1_1MultiBinaryLabelCrossEntropy_1a453945bdd0e32f06bc231fe4ae274713"></span><a class="reference internal" href="../../math/matrix/matrix.html#_CPPv2N6paddle9MatrixPtrE" title="paddle::MatrixPtr">MatrixPtr</a> <code class="descname">targetPerDim_</code><a class="headerlink" href="#_CPPv2N6paddle28MultiBinaryLabelCrossEntropy13targetPerDim_E" title="Permalink to this definition">¶</a></dt>
<dd></dd></dl>

</div>
</dd></dl>

</div>
<div class="section" id="multiclasscrossentropy">
<h3>MultiClassCrossEntropy<a class="headerlink" href="#multiclasscrossentropy" title="Permalink to this headline">¶</a></h3>
<dl class="class">
<dt id="_CPPv2N6paddle22MultiClassCrossEntropyE">
<span id="paddle::MultiClassCrossEntropy"></span><span class="target" id="paddleclasspaddle_1_1MultiClassCrossEntropy"></span><em class="property">class </em><code class="descclassname">paddle::</code><code class="descname">MultiClassCrossEntropy</code><a class="headerlink" href="#_CPPv2N6paddle22MultiClassCrossEntropyE" title="Permalink to this definition">¶</a></dt>
Y
Yu Yang 已提交
6591 6592 6593 6594
<dd><p>The cross-entropy loss for multi-class classification task. The loss function is:</p>
<p><div class="math">
\[ L = - \sum_{i}{t_{k} * log(P(y=k))} \]</div>
 </p>
6595
<p>Inherits from <a class="reference internal" href="#paddleclasspaddle_1_1CostLayer"><span class="std std-ref">paddle::CostLayer</span></a></p>
6596
<div class="breathe-sectiondef docutils container">
Y
Yu Yang 已提交
6597 6598 6599 6600 6601 6602 6603 6604
<p class="breathe-sectiondef-title rubric">Public Functions</p>
<dl class="function">
<dt id="_CPPv2N6paddle22MultiClassCrossEntropy22MultiClassCrossEntropyERK11LayerConfig">
<span id="paddle::MultiClassCrossEntropy::MultiClassCrossEntropy__LayerConfigCR"></span><span class="target" id="paddleclasspaddle_1_1MultiClassCrossEntropy_1ab392d32c462695596af1441c04aa23ea"></span><code class="descname">MultiClassCrossEntropy</code><span class="sig-paren">(</span><em class="property">const</em> LayerConfig &amp;<em>config</em><span class="sig-paren">)</span><a class="headerlink" href="#_CPPv2N6paddle22MultiClassCrossEntropy22MultiClassCrossEntropyERK11LayerConfig" title="Permalink to this definition">¶</a></dt>
<dd></dd></dl>

<dl class="function">
<dt id="_CPPv2N6paddle22MultiClassCrossEntropy4initERK8LayerMapRK12ParameterMap">
6605
<span id="paddle::MultiClassCrossEntropy::init__LayerMapCR.ParameterMapCR"></span><span class="target" id="paddleclasspaddle_1_1MultiClassCrossEntropy_1a90f90a3f4274fb01415f25891419ca99"></span>bool <code class="descname">init</code><span class="sig-paren">(</span><em class="property">const</em> LayerMap &amp;<em>layerMap</em>, <em class="property">const</em> <a class="reference internal" href="../../parameter/parameter/parameter.html#_CPPv2N6paddle12ParameterMapE" title="paddle::ParameterMap">ParameterMap</a> &amp;<em>parameterMap</em><span class="sig-paren">)</span><a class="headerlink" href="#_CPPv2N6paddle22MultiClassCrossEntropy4initERK8LayerMapRK12ParameterMap" title="Permalink to this definition">¶</a></dt>
Y
Yu Yang 已提交
6606 6607 6608 6609 6610
<dd><p>Intialization. For example, adding input layers from layerMap and parameterMap. </p>
</dd></dl>

<dl class="function">
<dt id="_CPPv2N6paddle22MultiClassCrossEntropy10forwardImpER6MatrixR8ArgumentR6Matrix">
6611
<span id="paddle::MultiClassCrossEntropy::forwardImp__MatrixR.ArgumentR.MatrixR"></span><span class="target" id="paddleclasspaddle_1_1MultiClassCrossEntropy_1a4d5d5c3a49ac6a8fe11d4a63cb25e7b7"></span>void <code class="descname">forwardImp</code><span class="sig-paren">(</span><a class="reference internal" href="../../math/matrix/matrix.html#_CPPv2N6paddle6MatrixE" title="paddle::Matrix">Matrix</a> &amp;<em>output</em>, <a class="reference internal" href="../../parameter/parameter/parameter.html#_CPPv2N6paddle8ArgumentE" title="paddle::Argument">Argument</a> &amp;<em>label</em>, <a class="reference internal" href="../../math/matrix/matrix.html#_CPPv2N6paddle6MatrixE" title="paddle::Matrix">Matrix</a> &amp;<em>cost</em><span class="sig-paren">)</span><a class="headerlink" href="#_CPPv2N6paddle22MultiClassCrossEntropy10forwardImpER6MatrixR8ArgumentR6Matrix" title="Permalink to this definition">¶</a></dt>
Y
Yu Yang 已提交
6612 6613 6614 6615
<dd></dd></dl>

<dl class="function">
<dt id="_CPPv2N6paddle22MultiClassCrossEntropy11backwardImpER6MatrixR8ArgumentR6Matrix">
6616
<span id="paddle::MultiClassCrossEntropy::backwardImp__MatrixR.ArgumentR.MatrixR"></span><span class="target" id="paddleclasspaddle_1_1MultiClassCrossEntropy_1a8b14e2f67a2acf942da5518b73afd3cf"></span>void <code class="descname">backwardImp</code><span class="sig-paren">(</span><a class="reference internal" href="../../math/matrix/matrix.html#_CPPv2N6paddle6MatrixE" title="paddle::Matrix">Matrix</a> &amp;<em>outputValue</em>, <a class="reference internal" href="../../parameter/parameter/parameter.html#_CPPv2N6paddle8ArgumentE" title="paddle::Argument">Argument</a> &amp;<em>label</em>, <a class="reference internal" href="../../math/matrix/matrix.html#_CPPv2N6paddle6MatrixE" title="paddle::Matrix">Matrix</a> &amp;<em>outputGrad</em><span class="sig-paren">)</span><a class="headerlink" href="#_CPPv2N6paddle22MultiClassCrossEntropy11backwardImpER6MatrixR8ArgumentR6Matrix" title="Permalink to this definition">¶</a></dt>
Y
Yu Yang 已提交
6617 6618 6619 6620 6621 6622 6623 6624 6625 6626 6627
<dd></dd></dl>

</div>
</dd></dl>

</div>
<div class="section" id="multiclasscrossentropywithselfnorm">
<h3>MultiClassCrossEntropyWithSelfNorm<a class="headerlink" href="#multiclasscrossentropywithselfnorm" title="Permalink to this headline">¶</a></h3>
<dl class="class">
<dt id="_CPPv2N6paddle34MultiClassCrossEntropyWithSelfNormE">
<span id="paddle::MultiClassCrossEntropyWithSelfNorm"></span><span class="target" id="paddleclasspaddle_1_1MultiClassCrossEntropyWithSelfNorm"></span><em class="property">class </em><code class="descclassname">paddle::</code><code class="descname">MultiClassCrossEntropyWithSelfNorm</code><a class="headerlink" href="#_CPPv2N6paddle34MultiClassCrossEntropyWithSelfNormE" title="Permalink to this definition">¶</a></dt>
Y
Yu Yang 已提交
6628 6629 6630 6631 6632 6633
<dd><p>The cross-entropy with self-normalization for multi-class classification.</p>
<p>The loss function is: <div class="math">
\[ L = \sum_{i}[-log(P(x_{i})) + alpha * log(Z(x_{i})^2)] \]</div>
</p>
<p>The <span class="math">\(Z(x)\)</span> is the softmax normalizer.</p>
<p>[1] Jacob Devlin, Rabih Zbib, Zhongqiang Huang, Thomas Lamar, Richard Schwartz, and John Makhoul. Fast and robust neural network joint models for statistical machine translation. In Proceedings of the ACL 2014 Conference. </p>
6634
<p>Inherits from <a class="reference internal" href="#paddleclasspaddle_1_1CostLayer"><span class="std std-ref">paddle::CostLayer</span></a></p>
6635
<div class="breathe-sectiondef docutils container">
Y
Yu Yang 已提交
6636 6637 6638 6639 6640 6641 6642 6643
<p class="breathe-sectiondef-title rubric">Public Functions</p>
<dl class="function">
<dt id="_CPPv2N6paddle34MultiClassCrossEntropyWithSelfNorm34MultiClassCrossEntropyWithSelfNormERK11LayerConfig">
<span id="paddle::MultiClassCrossEntropyWithSelfNorm::MultiClassCrossEntropyWithSelfNorm__LayerConfigCR"></span><span class="target" id="paddleclasspaddle_1_1MultiClassCrossEntropyWithSelfNorm_1a9d7555de4693127ef28025160d9ff703"></span><code class="descname">MultiClassCrossEntropyWithSelfNorm</code><span class="sig-paren">(</span><em class="property">const</em> LayerConfig &amp;<em>config</em><span class="sig-paren">)</span><a class="headerlink" href="#_CPPv2N6paddle34MultiClassCrossEntropyWithSelfNorm34MultiClassCrossEntropyWithSelfNormERK11LayerConfig" title="Permalink to this definition">¶</a></dt>
<dd></dd></dl>

<dl class="function">
<dt id="_CPPv2N6paddle34MultiClassCrossEntropyWithSelfNorm4initERK8LayerMapRK12ParameterMap">
6644
<span id="paddle::MultiClassCrossEntropyWithSelfNorm::init__LayerMapCR.ParameterMapCR"></span><span class="target" id="paddleclasspaddle_1_1MultiClassCrossEntropyWithSelfNorm_1a7b92658ddd2a569145841baea6a1e998"></span>bool <code class="descname">init</code><span class="sig-paren">(</span><em class="property">const</em> LayerMap &amp;<em>layerMap</em>, <em class="property">const</em> <a class="reference internal" href="../../parameter/parameter/parameter.html#_CPPv2N6paddle12ParameterMapE" title="paddle::ParameterMap">ParameterMap</a> &amp;<em>parameterMap</em><span class="sig-paren">)</span><a class="headerlink" href="#_CPPv2N6paddle34MultiClassCrossEntropyWithSelfNorm4initERK8LayerMapRK12ParameterMap" title="Permalink to this definition">¶</a></dt>
Y
Yu Yang 已提交
6645 6646 6647 6648 6649
<dd><p>Intialization. For example, adding input layers from layerMap and parameterMap. </p>
</dd></dl>

<dl class="function">
<dt id="_CPPv2N6paddle34MultiClassCrossEntropyWithSelfNorm10forwardImpER6MatrixR8ArgumentR6Matrix">
6650
<span id="paddle::MultiClassCrossEntropyWithSelfNorm::forwardImp__MatrixR.ArgumentR.MatrixR"></span><span class="target" id="paddleclasspaddle_1_1MultiClassCrossEntropyWithSelfNorm_1a6f2ebdc46af5f52d916e2b10ff226338"></span>void <code class="descname">forwardImp</code><span class="sig-paren">(</span><a class="reference internal" href="../../math/matrix/matrix.html#_CPPv2N6paddle6MatrixE" title="paddle::Matrix">Matrix</a> &amp;<em>output</em>, <a class="reference internal" href="../../parameter/parameter/parameter.html#_CPPv2N6paddle8ArgumentE" title="paddle::Argument">Argument</a> &amp;<em>label</em>, <a class="reference internal" href="../../math/matrix/matrix.html#_CPPv2N6paddle6MatrixE" title="paddle::Matrix">Matrix</a> &amp;<em>cost</em><span class="sig-paren">)</span><a class="headerlink" href="#_CPPv2N6paddle34MultiClassCrossEntropyWithSelfNorm10forwardImpER6MatrixR8ArgumentR6Matrix" title="Permalink to this definition">¶</a></dt>
Y
Yu Yang 已提交
6651 6652 6653 6654
<dd></dd></dl>

<dl class="function">
<dt id="_CPPv2N6paddle34MultiClassCrossEntropyWithSelfNorm11backwardImpER6MatrixR8ArgumentR6Matrix">
6655
<span id="paddle::MultiClassCrossEntropyWithSelfNorm::backwardImp__MatrixR.ArgumentR.MatrixR"></span><span class="target" id="paddleclasspaddle_1_1MultiClassCrossEntropyWithSelfNorm_1afc51f25d98ad70d278398788690d75e2"></span>void <code class="descname">backwardImp</code><span class="sig-paren">(</span><a class="reference internal" href="../../math/matrix/matrix.html#_CPPv2N6paddle6MatrixE" title="paddle::Matrix">Matrix</a> &amp;<em>outputValue</em>, <a class="reference internal" href="../../parameter/parameter/parameter.html#_CPPv2N6paddle8ArgumentE" title="paddle::Argument">Argument</a> &amp;<em>label</em>, <a class="reference internal" href="../../math/matrix/matrix.html#_CPPv2N6paddle6MatrixE" title="paddle::Matrix">Matrix</a> &amp;<em>outputGrad</em><span class="sig-paren">)</span><a class="headerlink" href="#_CPPv2N6paddle34MultiClassCrossEntropyWithSelfNorm11backwardImpER6MatrixR8ArgumentR6Matrix" title="Permalink to this definition">¶</a></dt>
Y
Yu Yang 已提交
6656 6657 6658
<dd></dd></dl>

</div>
6659
<div class="breathe-sectiondef docutils container">
Y
Yu Yang 已提交
6660 6661 6662 6663 6664 6665 6666 6667 6668 6669 6670 6671 6672 6673 6674 6675 6676 6677 6678 6679
<p class="breathe-sectiondef-title rubric">Protected Attributes</p>
<dl class="member">
<dt id="_CPPv2N6paddle34MultiClassCrossEntropyWithSelfNorm10sftMaxSum_E">
<span id="paddle::MultiClassCrossEntropyWithSelfNorm::sftMaxSum___MatrixPtr"></span><span class="target" id="paddleclasspaddle_1_1MultiClassCrossEntropyWithSelfNorm_1ae63a61bc46c53a25dd06534e81111eec"></span><a class="reference internal" href="../../math/matrix/matrix.html#_CPPv2N6paddle9MatrixPtrE" title="paddle::MatrixPtr">MatrixPtr</a> <code class="descname">sftMaxSum_</code><a class="headerlink" href="#_CPPv2N6paddle34MultiClassCrossEntropyWithSelfNorm10sftMaxSum_E" title="Permalink to this definition">¶</a></dt>
<dd></dd></dl>

<dl class="member">
<dt id="_CPPv2N6paddle34MultiClassCrossEntropyWithSelfNorm7sumInv_E">
<span id="paddle::MultiClassCrossEntropyWithSelfNorm::sumInv___MatrixPtr"></span><span class="target" id="paddleclasspaddle_1_1MultiClassCrossEntropyWithSelfNorm_1a1dacb22d4ddbd8c9b12383da429f90e7"></span><a class="reference internal" href="../../math/matrix/matrix.html#_CPPv2N6paddle9MatrixPtrE" title="paddle::MatrixPtr">MatrixPtr</a> <code class="descname">sumInv_</code><a class="headerlink" href="#_CPPv2N6paddle34MultiClassCrossEntropyWithSelfNorm7sumInv_E" title="Permalink to this definition">¶</a></dt>
<dd></dd></dl>

</div>
</dd></dl>

</div>
<div class="section" id="rankingcost">
<h3>RankingCost<a class="headerlink" href="#rankingcost" title="Permalink to this headline">¶</a></h3>
<dl class="class">
<dt id="_CPPv2N6paddle11RankingCostE">
<span id="paddle::RankingCost"></span><span class="target" id="paddleclasspaddle_1_1RankingCost"></span><em class="property">class </em><code class="descclassname">paddle::</code><code class="descname">RankingCost</code><a class="headerlink" href="#_CPPv2N6paddle11RankingCostE" title="Permalink to this definition">¶</a></dt>
Y
Yu Yang 已提交
6680 6681 6682 6683
<dd><p>A cost layer for learning to rank (LTR) task. This layer contains at leat three inputs. <div class="math">
\[\begin{split} C_{i,j} = -\tilde{P_{ij}} * o_{i,j} + log(1 + e^{o_{i,j}}) \\ o_{i,j} = o_i - o_j \\ \tilde{P_{i,j}} = \left \{0, 0.5, 1 \right \} \ or \ \left \{0, 1 \right \} \end{split}\]</div>
</p>
<p>[1]. Chris Burges, Tal Shaked, Erin Renshaw, et al. Learning to Rank useing Gradient Descent. </p>
6684
<p>Inherits from <a class="reference internal" href="#paddleclasspaddle_1_1Layer"><span class="std std-ref">paddle::Layer</span></a></p>
6685
<div class="breathe-sectiondef docutils container">
Y
Yu Yang 已提交
6686 6687 6688 6689 6690 6691 6692 6693
<p class="breathe-sectiondef-title rubric">Public Functions</p>
<dl class="function">
<dt id="_CPPv2N6paddle11RankingCost11RankingCostERK11LayerConfig">
<span id="paddle::RankingCost::RankingCost__LayerConfigCR"></span><span class="target" id="paddleclasspaddle_1_1RankingCost_1a7b81fc5d99ae6284a66ac38df264058b"></span><code class="descname">RankingCost</code><span class="sig-paren">(</span><em class="property">const</em> LayerConfig &amp;<em>config</em><span class="sig-paren">)</span><a class="headerlink" href="#_CPPv2N6paddle11RankingCost11RankingCostERK11LayerConfig" title="Permalink to this definition">¶</a></dt>
<dd></dd></dl>

<dl class="function">
<dt id="_CPPv2N6paddle11RankingCost4initERK8LayerMapRK12ParameterMap">
6694
<span id="paddle::RankingCost::init__LayerMapCR.ParameterMapCR"></span><span class="target" id="paddleclasspaddle_1_1RankingCost_1a4e3a7f5d4c493e667bd11fa92ea213e3"></span>bool <code class="descname">init</code><span class="sig-paren">(</span><em class="property">const</em> LayerMap &amp;<em>layerMap</em>, <em class="property">const</em> <a class="reference internal" href="../../parameter/parameter/parameter.html#_CPPv2N6paddle12ParameterMapE" title="paddle::ParameterMap">ParameterMap</a> &amp;<em>parameterMap</em><span class="sig-paren">)</span><a class="headerlink" href="#_CPPv2N6paddle11RankingCost4initERK8LayerMapRK12ParameterMap" title="Permalink to this definition">¶</a></dt>
Y
Yu Yang 已提交
6695 6696 6697 6698 6699 6700 6701 6702 6703 6704 6705 6706 6707 6708 6709
<dd><p>Intialization. For example, adding input layers from layerMap and parameterMap. </p>
</dd></dl>

<dl class="function">
<dt id="_CPPv2N6paddle11RankingCost14getOutputLayerE6size_t">
<span id="paddle::RankingCost::getOutputLayer__s"></span><span class="target" id="paddleclasspaddle_1_1RankingCost_1a811295fc43bbaf7fdb7401eab371f542"></span>LayerPtr <code class="descname">getOutputLayer</code><span class="sig-paren">(</span>size_t <em>i</em><span class="sig-paren">)</span><a class="headerlink" href="#_CPPv2N6paddle11RankingCost14getOutputLayerE6size_t" title="Permalink to this definition">¶</a></dt>
<dd></dd></dl>

<dl class="function">
<dt id="_CPPv2N6paddle11RankingCost13getLabelLayerEv">
<span id="paddle::RankingCost::getLabelLayer"></span><span class="target" id="paddleclasspaddle_1_1RankingCost_1af0f0a5b17199ab4aa59402b3dd37a6e8"></span>LayerPtr <code class="descname">getLabelLayer</code><span class="sig-paren">(</span><span class="sig-paren">)</span><a class="headerlink" href="#_CPPv2N6paddle11RankingCost13getLabelLayerEv" title="Permalink to this definition">¶</a></dt>
<dd></dd></dl>

<dl class="function">
<dt id="_CPPv2N6paddle11RankingCost7forwardE8PassType">
6710
<span id="paddle::RankingCost::forward__PassType"></span><span class="target" id="paddleclasspaddle_1_1RankingCost_1a5f9f68064701815af6d093f3646d9623"></span>void <code class="descname">forward</code><span class="sig-paren">(</span>PassType <em>passType</em><span class="sig-paren">)</span><a class="headerlink" href="#_CPPv2N6paddle11RankingCost7forwardE8PassType" title="Permalink to this definition">¶</a></dt>
Y
Yu Yang 已提交
6711 6712 6713 6714 6715
<dd><p>Forward propagation. All inherited implementation should call Layer::foward() function. </p>
</dd></dl>

<dl class="function">
<dt id="_CPPv2N6paddle11RankingCost8backwardERK14UpdateCallback">
6716
<span id="paddle::RankingCost::backward__UpdateCallbackCR"></span><span class="target" id="paddleclasspaddle_1_1RankingCost_1a8d0ab1b2af639667a8921e5f9b5819fa"></span>void <code class="descname">backward</code><span class="sig-paren">(</span><em class="property">const</em> <a class="reference internal" href="../../parameter/parameter/parameter.html#_CPPv2N6paddle14UpdateCallbackE" title="paddle::UpdateCallback">UpdateCallback</a> &amp;<em>callback</em> = nullptr<span class="sig-paren">)</span><a class="headerlink" href="#_CPPv2N6paddle11RankingCost8backwardERK14UpdateCallback" title="Permalink to this definition">¶</a></dt>
6717
<dd><p>Backward propagation. Should only be called after <a class="reference internal" href="#paddleclasspaddle_1_1Layer_1a12386b3f20dd731e7ceaa2c61667cbe1"><span class="std std-ref">Layer::forward()</span></a> function. </p>
Y
Yu Yang 已提交
6718 6719 6720 6721
</dd></dl>

<dl class="function">
<dt id="_CPPv2N6paddle11RankingCost9onPassEndEv">
6722
<span id="paddle::RankingCost::onPassEnd"></span><span class="target" id="paddleclasspaddle_1_1RankingCost_1aea968b55f5b773a9fc7962ca9b505abe"></span>void <code class="descname">onPassEnd</code><span class="sig-paren">(</span><span class="sig-paren">)</span><a class="headerlink" href="#_CPPv2N6paddle11RankingCost9onPassEndEv" title="Permalink to this definition">¶</a></dt>
Y
Yu Yang 已提交
6723 6724 6725 6726 6727 6728 6729 6730 6731 6732 6733 6734 6735 6736 6737 6738 6739 6740 6741 6742 6743 6744
<dd><p>One pass is finished. </p>
</dd></dl>

<dl class="function">
<dt id="_CPPv2N6paddle11RankingCost10forwardImpER6MatrixR8ArgumentR6Matrix">
<span id="paddle::RankingCost::forwardImp__MatrixR.ArgumentR.MatrixR"></span><span class="target" id="paddleclasspaddle_1_1RankingCost_1a0cb10b1ca4c9c0c74a0a43c2267121a7"></span>void <code class="descname">forwardImp</code><span class="sig-paren">(</span><a class="reference internal" href="../../math/matrix/matrix.html#_CPPv2N6paddle6MatrixE" title="paddle::Matrix">Matrix</a> &amp;<em>output</em>, <a class="reference internal" href="../../parameter/parameter/parameter.html#_CPPv2N6paddle8ArgumentE" title="paddle::Argument">Argument</a> &amp;<em>label</em>, <a class="reference internal" href="../../math/matrix/matrix.html#_CPPv2N6paddle6MatrixE" title="paddle::Matrix">Matrix</a> &amp;<em>cost</em><span class="sig-paren">)</span><a class="headerlink" href="#_CPPv2N6paddle11RankingCost10forwardImpER6MatrixR8ArgumentR6Matrix" title="Permalink to this definition">¶</a></dt>
<dd></dd></dl>

<dl class="function">
<dt id="_CPPv2N6paddle11RankingCost11backwardImpER6MatrixR8ArgumentR6Matrix">
<span id="paddle::RankingCost::backwardImp__MatrixR.ArgumentR.MatrixR"></span><span class="target" id="paddleclasspaddle_1_1RankingCost_1a08c342ec0dbad143bb1d3c224489e0f4"></span>void <code class="descname">backwardImp</code><span class="sig-paren">(</span><a class="reference internal" href="../../math/matrix/matrix.html#_CPPv2N6paddle6MatrixE" title="paddle::Matrix">Matrix</a> &amp;<em>outputValue</em>, <a class="reference internal" href="../../parameter/parameter/parameter.html#_CPPv2N6paddle8ArgumentE" title="paddle::Argument">Argument</a> &amp;<em>label</em>, <a class="reference internal" href="../../math/matrix/matrix.html#_CPPv2N6paddle6MatrixE" title="paddle::Matrix">Matrix</a> &amp;<em>outputGrad</em><span class="sig-paren">)</span><a class="headerlink" href="#_CPPv2N6paddle11RankingCost11backwardImpER6MatrixR8ArgumentR6Matrix" title="Permalink to this definition">¶</a></dt>
<dd></dd></dl>

</div>
</dd></dl>

</div>
<div class="section" id="softbinaryclasscrossentropy">
<h3>SoftBinaryClassCrossEntropy<a class="headerlink" href="#softbinaryclasscrossentropy" title="Permalink to this headline">¶</a></h3>
<dl class="class">
<dt id="_CPPv2N6paddle27SoftBinaryClassCrossEntropyE">
<span id="paddle::SoftBinaryClassCrossEntropy"></span><span class="target" id="paddleclasspaddle_1_1SoftBinaryClassCrossEntropy"></span><em class="property">class </em><code class="descclassname">paddle::</code><code class="descname">SoftBinaryClassCrossEntropy</code><a class="headerlink" href="#_CPPv2N6paddle27SoftBinaryClassCrossEntropyE" title="Permalink to this definition">¶</a></dt>
Y
Yu Yang 已提交
6745 6746 6747
<dd><p>The cross-entropy for soft binary class. <div class="math">
\[ L = \sum_i (\sum_j -y_j(i)*log(x_j(i))-(1-y_j(i))*log(1-x_j(i))) \]</div>
 </p>
6748
<p>Inherits from <a class="reference internal" href="#paddleclasspaddle_1_1CostLayer"><span class="std std-ref">paddle::CostLayer</span></a></p>
6749
<div class="breathe-sectiondef docutils container">
Y
Yu Yang 已提交
6750 6751 6752 6753 6754 6755 6756 6757
<p class="breathe-sectiondef-title rubric">Public Functions</p>
<dl class="function">
<dt id="_CPPv2N6paddle27SoftBinaryClassCrossEntropy27SoftBinaryClassCrossEntropyERK11LayerConfig">
<span id="paddle::SoftBinaryClassCrossEntropy::SoftBinaryClassCrossEntropy__LayerConfigCR"></span><span class="target" id="paddleclasspaddle_1_1SoftBinaryClassCrossEntropy_1a72aced9c96b7291437e9dcfdb607f84a"></span><code class="descname">SoftBinaryClassCrossEntropy</code><span class="sig-paren">(</span><em class="property">const</em> LayerConfig &amp;<em>config</em><span class="sig-paren">)</span><a class="headerlink" href="#_CPPv2N6paddle27SoftBinaryClassCrossEntropy27SoftBinaryClassCrossEntropyERK11LayerConfig" title="Permalink to this definition">¶</a></dt>
<dd></dd></dl>

<dl class="function">
<dt id="_CPPv2N6paddle27SoftBinaryClassCrossEntropy4initERK8LayerMapRK12ParameterMap">
6758
<span id="paddle::SoftBinaryClassCrossEntropy::init__LayerMapCR.ParameterMapCR"></span><span class="target" id="paddleclasspaddle_1_1SoftBinaryClassCrossEntropy_1af01df3b068f24bce65d2177698b9d6a1"></span>bool <code class="descname">init</code><span class="sig-paren">(</span><em class="property">const</em> LayerMap &amp;<em>layerMap</em>, <em class="property">const</em> <a class="reference internal" href="../../parameter/parameter/parameter.html#_CPPv2N6paddle12ParameterMapE" title="paddle::ParameterMap">ParameterMap</a> &amp;<em>parameterMap</em><span class="sig-paren">)</span><a class="headerlink" href="#_CPPv2N6paddle27SoftBinaryClassCrossEntropy4initERK8LayerMapRK12ParameterMap" title="Permalink to this definition">¶</a></dt>
Y
Yu Yang 已提交
6759 6760 6761 6762 6763
<dd><p>Intialization. For example, adding input layers from layerMap and parameterMap. </p>
</dd></dl>

<dl class="function">
<dt id="_CPPv2N6paddle27SoftBinaryClassCrossEntropy10forwardImpER6MatrixR8ArgumentR6Matrix">
6764
<span id="paddle::SoftBinaryClassCrossEntropy::forwardImp__MatrixR.ArgumentR.MatrixR"></span><span class="target" id="paddleclasspaddle_1_1SoftBinaryClassCrossEntropy_1abf462dacf92a74a55f631d8b96f7d131"></span>void <code class="descname">forwardImp</code><span class="sig-paren">(</span><a class="reference internal" href="../../math/matrix/matrix.html#_CPPv2N6paddle6MatrixE" title="paddle::Matrix">Matrix</a> &amp;<em>output</em>, <a class="reference internal" href="../../parameter/parameter/parameter.html#_CPPv2N6paddle8ArgumentE" title="paddle::Argument">Argument</a> &amp;<em>label</em>, <a class="reference internal" href="../../math/matrix/matrix.html#_CPPv2N6paddle6MatrixE" title="paddle::Matrix">Matrix</a> &amp;<em>cost</em><span class="sig-paren">)</span><a class="headerlink" href="#_CPPv2N6paddle27SoftBinaryClassCrossEntropy10forwardImpER6MatrixR8ArgumentR6Matrix" title="Permalink to this definition">¶</a></dt>
Y
Yu Yang 已提交
6765 6766 6767 6768
<dd></dd></dl>

<dl class="function">
<dt id="_CPPv2N6paddle27SoftBinaryClassCrossEntropy11backwardImpER6MatrixR8ArgumentR6Matrix">
6769
<span id="paddle::SoftBinaryClassCrossEntropy::backwardImp__MatrixR.ArgumentR.MatrixR"></span><span class="target" id="paddleclasspaddle_1_1SoftBinaryClassCrossEntropy_1a961dd1d5268fdd58aa3747519a548160"></span>void <code class="descname">backwardImp</code><span class="sig-paren">(</span><a class="reference internal" href="../../math/matrix/matrix.html#_CPPv2N6paddle6MatrixE" title="paddle::Matrix">Matrix</a> &amp;<em>outputValue</em>, <a class="reference internal" href="../../parameter/parameter/parameter.html#_CPPv2N6paddle8ArgumentE" title="paddle::Argument">Argument</a> &amp;<em>label</em>, <a class="reference internal" href="../../math/matrix/matrix.html#_CPPv2N6paddle6MatrixE" title="paddle::Matrix">Matrix</a> &amp;<em>outputGrad</em><span class="sig-paren">)</span><a class="headerlink" href="#_CPPv2N6paddle27SoftBinaryClassCrossEntropy11backwardImpER6MatrixR8ArgumentR6Matrix" title="Permalink to this definition">¶</a></dt>
Y
Yu Yang 已提交
6770 6771 6772
<dd></dd></dl>

</div>
6773
<div class="breathe-sectiondef docutils container">
Y
Yu Yang 已提交
6774 6775 6776 6777 6778 6779 6780 6781 6782 6783 6784 6785 6786 6787 6788
<p class="breathe-sectiondef-title rubric">Protected Attributes</p>
<dl class="member">
<dt id="_CPPv2N6paddle27SoftBinaryClassCrossEntropy13targetPerDim_E">
<span id="paddle::SoftBinaryClassCrossEntropy::targetPerDim___MatrixPtr"></span><span class="target" id="paddleclasspaddle_1_1SoftBinaryClassCrossEntropy_1a05d14b088672538d2b3bc770a29ce247"></span><a class="reference internal" href="../../math/matrix/matrix.html#_CPPv2N6paddle9MatrixPtrE" title="paddle::MatrixPtr">MatrixPtr</a> <code class="descname">targetPerDim_</code><a class="headerlink" href="#_CPPv2N6paddle27SoftBinaryClassCrossEntropy13targetPerDim_E" title="Permalink to this definition">¶</a></dt>
<dd></dd></dl>

</div>
</dd></dl>

</div>
<div class="section" id="sumofsquarescostlayer">
<h3>SumOfSquaresCostLayer<a class="headerlink" href="#sumofsquarescostlayer" title="Permalink to this headline">¶</a></h3>
<dl class="class">
<dt id="_CPPv2N6paddle21SumOfSquaresCostLayerE">
<span id="paddle::SumOfSquaresCostLayer"></span><span class="target" id="paddleclasspaddle_1_1SumOfSquaresCostLayer"></span><em class="property">class </em><code class="descclassname">paddle::</code><code class="descname">SumOfSquaresCostLayer</code><a class="headerlink" href="#_CPPv2N6paddle21SumOfSquaresCostLayerE" title="Permalink to this definition">¶</a></dt>
Y
Yu Yang 已提交
6789
<dd><p>This cost layer compute Euclidean (L2) loss for real-valued regression tasks. <div class="math">
6790
\[ L = \sum_{i=1}^N {|| \hat{y}_i - y_i||_2^2} \]</div>
Y
Yu Yang 已提交
6791
 </p>
6792
<p>Inherits from <a class="reference internal" href="#paddleclasspaddle_1_1CostLayer"><span class="std std-ref">paddle::CostLayer</span></a></p>
6793
<div class="breathe-sectiondef docutils container">
Y
Yu Yang 已提交
6794 6795 6796 6797 6798 6799 6800 6801
<p class="breathe-sectiondef-title rubric">Public Functions</p>
<dl class="function">
<dt id="_CPPv2N6paddle21SumOfSquaresCostLayer21SumOfSquaresCostLayerERK11LayerConfig">
<span id="paddle::SumOfSquaresCostLayer::SumOfSquaresCostLayer__LayerConfigCR"></span><span class="target" id="paddleclasspaddle_1_1SumOfSquaresCostLayer_1a4974ce60286aae18b918eb7e8013c93d"></span><code class="descname">SumOfSquaresCostLayer</code><span class="sig-paren">(</span><em class="property">const</em> LayerConfig &amp;<em>config</em><span class="sig-paren">)</span><a class="headerlink" href="#_CPPv2N6paddle21SumOfSquaresCostLayer21SumOfSquaresCostLayerERK11LayerConfig" title="Permalink to this definition">¶</a></dt>
<dd></dd></dl>

<dl class="function">
<dt id="_CPPv2N6paddle21SumOfSquaresCostLayer4initERK8LayerMapRK12ParameterMap">
6802
<span id="paddle::SumOfSquaresCostLayer::init__LayerMapCR.ParameterMapCR"></span><span class="target" id="paddleclasspaddle_1_1SumOfSquaresCostLayer_1a01fd9051ac0797704e9c7f0ae12a229b"></span>bool <code class="descname">init</code><span class="sig-paren">(</span><em class="property">const</em> LayerMap &amp;<em>layerMap</em>, <em class="property">const</em> <a class="reference internal" href="../../parameter/parameter/parameter.html#_CPPv2N6paddle12ParameterMapE" title="paddle::ParameterMap">ParameterMap</a> &amp;<em>parameterMap</em><span class="sig-paren">)</span><a class="headerlink" href="#_CPPv2N6paddle21SumOfSquaresCostLayer4initERK8LayerMapRK12ParameterMap" title="Permalink to this definition">¶</a></dt>
Y
Yu Yang 已提交
6803 6804 6805 6806 6807
<dd><p>Intialization. For example, adding input layers from layerMap and parameterMap. </p>
</dd></dl>

<dl class="function">
<dt id="_CPPv2N6paddle21SumOfSquaresCostLayer10forwardImpER6MatrixR8ArgumentR6Matrix">
6808
<span id="paddle::SumOfSquaresCostLayer::forwardImp__MatrixR.ArgumentR.MatrixR"></span><span class="target" id="paddleclasspaddle_1_1SumOfSquaresCostLayer_1a7b1f0a2fe35b14de1f614a0346878724"></span>void <code class="descname">forwardImp</code><span class="sig-paren">(</span><a class="reference internal" href="../../math/matrix/matrix.html#_CPPv2N6paddle6MatrixE" title="paddle::Matrix">Matrix</a> &amp;<em>output</em>, <a class="reference internal" href="../../parameter/parameter/parameter.html#_CPPv2N6paddle8ArgumentE" title="paddle::Argument">Argument</a> &amp;<em>label</em>, <a class="reference internal" href="../../math/matrix/matrix.html#_CPPv2N6paddle6MatrixE" title="paddle::Matrix">Matrix</a> &amp;<em>cost</em><span class="sig-paren">)</span><a class="headerlink" href="#_CPPv2N6paddle21SumOfSquaresCostLayer10forwardImpER6MatrixR8ArgumentR6Matrix" title="Permalink to this definition">¶</a></dt>
Y
Yu Yang 已提交
6809 6810 6811 6812
<dd></dd></dl>

<dl class="function">
<dt id="_CPPv2N6paddle21SumOfSquaresCostLayer11backwardImpER6MatrixR8ArgumentR6Matrix">
6813
<span id="paddle::SumOfSquaresCostLayer::backwardImp__MatrixR.ArgumentR.MatrixR"></span><span class="target" id="paddleclasspaddle_1_1SumOfSquaresCostLayer_1a3b3febac979259d6229b3db1b890ff22"></span>void <code class="descname">backwardImp</code><span class="sig-paren">(</span><a class="reference internal" href="../../math/matrix/matrix.html#_CPPv2N6paddle6MatrixE" title="paddle::Matrix">Matrix</a> &amp;<em>outputValue</em>, <a class="reference internal" href="../../parameter/parameter/parameter.html#_CPPv2N6paddle8ArgumentE" title="paddle::Argument">Argument</a> &amp;<em>label</em>, <a class="reference internal" href="../../math/matrix/matrix.html#_CPPv2N6paddle6MatrixE" title="paddle::Matrix">Matrix</a> &amp;<em>outputGrad</em><span class="sig-paren">)</span><a class="headerlink" href="#_CPPv2N6paddle21SumOfSquaresCostLayer11backwardImpER6MatrixR8ArgumentR6Matrix" title="Permalink to this definition">¶</a></dt>
Y
Yu Yang 已提交
6814 6815 6816 6817 6818
<dd></dd></dl>

</div>
</dd></dl>

6819 6820 6821 6822 6823 6824 6825 6826 6827 6828
</div>
<div class="section" id="sumcostlayer">
<h3>SumCostLayer<a class="headerlink" href="#sumcostlayer" title="Permalink to this headline">¶</a></h3>
<dl class="class">
<dt id="_CPPv2N6paddle12SumCostLayerE">
<span id="paddle::SumCostLayer"></span><span class="target" id="paddleclasspaddle_1_1SumCostLayer"></span><em class="property">class </em><code class="descclassname">paddle::</code><code class="descname">SumCostLayer</code><a class="headerlink" href="#_CPPv2N6paddle12SumCostLayerE" title="Permalink to this definition">¶</a></dt>
<dd><p>This cost layer compute the sum of its input as loss. <div class="math">
\[ o(i) = \sum_{j=1}^D y_{ij} \]</div>
 </p>
<p>Inherits from <a class="reference internal" href="#paddleclasspaddle_1_1Layer"><span class="std std-ref">paddle::Layer</span></a></p>
6829
<div class="breathe-sectiondef docutils container">
6830 6831 6832 6833 6834 6835 6836 6837 6838 6839 6840 6841 6842 6843 6844 6845 6846 6847 6848 6849 6850 6851 6852 6853 6854 6855 6856
<p class="breathe-sectiondef-title rubric">Public Functions</p>
<dl class="function">
<dt id="_CPPv2N6paddle12SumCostLayer12SumCostLayerERK11LayerConfig">
<span id="paddle::SumCostLayer::SumCostLayer__LayerConfigCR"></span><span class="target" id="paddleclasspaddle_1_1SumCostLayer_1a2e8c01af3eb68218602d4c57e7f74ce8"></span><code class="descname">SumCostLayer</code><span class="sig-paren">(</span><em class="property">const</em> LayerConfig &amp;<em>config</em><span class="sig-paren">)</span><a class="headerlink" href="#_CPPv2N6paddle12SumCostLayer12SumCostLayerERK11LayerConfig" title="Permalink to this definition">¶</a></dt>
<dd></dd></dl>

<dl class="function">
<dt id="_CPPv2N6paddle12SumCostLayer4initERK8LayerMapRK12ParameterMap">
<span id="paddle::SumCostLayer::init__LayerMapCR.ParameterMapCR"></span><span class="target" id="paddleclasspaddle_1_1SumCostLayer_1af052722073c3a6c22b89f66ae9eb7a32"></span>bool <code class="descname">init</code><span class="sig-paren">(</span><em class="property">const</em> LayerMap &amp;<em>layerMap</em>, <em class="property">const</em> <a class="reference internal" href="../../parameter/parameter/parameter.html#_CPPv2N6paddle12ParameterMapE" title="paddle::ParameterMap">ParameterMap</a> &amp;<em>parameterMap</em><span class="sig-paren">)</span><a class="headerlink" href="#_CPPv2N6paddle12SumCostLayer4initERK8LayerMapRK12ParameterMap" title="Permalink to this definition">¶</a></dt>
<dd><p>Intialization. For example, adding input layers from layerMap and parameterMap. </p>
</dd></dl>

<dl class="function">
<dt id="_CPPv2N6paddle12SumCostLayer7forwardE8PassType">
<span id="paddle::SumCostLayer::forward__PassType"></span><span class="target" id="paddleclasspaddle_1_1SumCostLayer_1a4b03a061cf3ede0ace9a3d314717e006"></span><em class="property">virtual</em> void <code class="descname">forward</code><span class="sig-paren">(</span>PassType <em>passType</em><span class="sig-paren">)</span><a class="headerlink" href="#_CPPv2N6paddle12SumCostLayer7forwardE8PassType" title="Permalink to this definition">¶</a></dt>
<dd><p>Forward propagation. All inherited implementation should call Layer::foward() function. </p>
</dd></dl>

<dl class="function">
<dt id="_CPPv2N6paddle12SumCostLayer8backwardERK14UpdateCallback">
<span id="paddle::SumCostLayer::backward__UpdateCallbackCR"></span><span class="target" id="paddleclasspaddle_1_1SumCostLayer_1a80481d16acde623ba29afa74a8bdbc80"></span><em class="property">virtual</em> void <code class="descname">backward</code><span class="sig-paren">(</span><em class="property">const</em> <a class="reference internal" href="../../parameter/parameter/parameter.html#_CPPv2N6paddle14UpdateCallbackE" title="paddle::UpdateCallback">UpdateCallback</a> &amp;<em>callback</em> = nullptr<span class="sig-paren">)</span><a class="headerlink" href="#_CPPv2N6paddle12SumCostLayer8backwardERK14UpdateCallback" title="Permalink to this definition">¶</a></dt>
<dd><p>Backward propagation. Should only be called after <a class="reference internal" href="#paddleclasspaddle_1_1Layer_1a12386b3f20dd731e7ceaa2c61667cbe1"><span class="std std-ref">Layer::forward()</span></a> function. </p>
</dd></dl>

</div>
</dd></dl>

Y
Yu Yang 已提交
6857 6858 6859 6860 6861 6862 6863
</div>
</div>
<div class="section" id="cossimlayer">
<h2>CosSimLayer<a class="headerlink" href="#cossimlayer" title="Permalink to this headline">¶</a></h2>
<dl class="class">
<dt id="_CPPv2N6paddle11CosSimLayerE">
<span id="paddle::CosSimLayer"></span><span class="target" id="paddleclasspaddle_1_1CosSimLayer"></span><em class="property">class </em><code class="descclassname">paddle::</code><code class="descname">CosSimLayer</code><a class="headerlink" href="#_CPPv2N6paddle11CosSimLayerE" title="Permalink to this definition">¶</a></dt>
Y
Yu Yang 已提交
6864 6865 6866 6867 6868 6869 6870 6871 6872 6873
<dd><p>A layer for calculating cosine similarity between two vector <div class="math">
\[ f(x,y)=scale\frac{x_1y_1+x_2y_2+...+x_ny_n}{\sqrt{x_1^2+x_2^2+... +x_n^2}\sqrt{y_1^2+y_2^2+...+y_n^2}} \]</div>
. </p>
<p><ul class="simple">
<li>Input1: A vector (batchSize * dataDim) *</li>
<li>Input2: A vector (batchSize * dataDim) or (1 * dataDim) *</li>
<li>Output: A vector (dataDim * 1)</li>
</ul>
</p>
<p>The config file api is cos_sim. </p>
6874
<p>Inherits from <a class="reference internal" href="#paddleclasspaddle_1_1Layer"><span class="std std-ref">paddle::Layer</span></a></p>
6875
<div class="breathe-sectiondef docutils container">
Y
Yu Yang 已提交
6876 6877 6878 6879 6880 6881 6882 6883 6884 6885 6886 6887 6888
<p class="breathe-sectiondef-title rubric">Public Functions</p>
<dl class="function">
<dt id="_CPPv2N6paddle11CosSimLayer11CosSimLayerERK11LayerConfig">
<span id="paddle::CosSimLayer::CosSimLayer__LayerConfigCR"></span><span class="target" id="paddleclasspaddle_1_1CosSimLayer_1abe62ee36afe97c72dd48e144f9cfff30"></span><code class="descname">CosSimLayer</code><span class="sig-paren">(</span><em class="property">const</em> LayerConfig &amp;<em>config</em><span class="sig-paren">)</span><a class="headerlink" href="#_CPPv2N6paddle11CosSimLayer11CosSimLayerERK11LayerConfig" title="Permalink to this definition">¶</a></dt>
<dd></dd></dl>

<dl class="function">
<dt id="_CPPv2N6paddle11CosSimLayerD0Ev">
<span id="paddle::CosSimLayer::~CosSimLayer"></span><span class="target" id="paddleclasspaddle_1_1CosSimLayer_1a022c6cd5763eb91a3a2041cee66b977a"></span><code class="descname">~CosSimLayer</code><span class="sig-paren">(</span><span class="sig-paren">)</span><a class="headerlink" href="#_CPPv2N6paddle11CosSimLayerD0Ev" title="Permalink to this definition">¶</a></dt>
<dd></dd></dl>

<dl class="function">
<dt id="_CPPv2N6paddle11CosSimLayer4initERK8LayerMapRK12ParameterMap">
6889
<span id="paddle::CosSimLayer::init__LayerMapCR.ParameterMapCR"></span><span class="target" id="paddleclasspaddle_1_1CosSimLayer_1ab85e9e4671f62e3808a467b1f78323eb"></span>bool <code class="descname">init</code><span class="sig-paren">(</span><em class="property">const</em> LayerMap &amp;<em>layerMap</em>, <em class="property">const</em> <a class="reference internal" href="../../parameter/parameter/parameter.html#_CPPv2N6paddle12ParameterMapE" title="paddle::ParameterMap">ParameterMap</a> &amp;<em>parameterMap</em><span class="sig-paren">)</span><a class="headerlink" href="#_CPPv2N6paddle11CosSimLayer4initERK8LayerMapRK12ParameterMap" title="Permalink to this definition">¶</a></dt>
Y
Yu Yang 已提交
6890 6891 6892 6893 6894
<dd><p>Intialization. For example, adding input layers from layerMap and parameterMap. </p>
</dd></dl>

<dl class="function">
<dt id="_CPPv2N6paddle11CosSimLayer7forwardE8PassType">
6895
<span id="paddle::CosSimLayer::forward__PassType"></span><span class="target" id="paddleclasspaddle_1_1CosSimLayer_1ae95389edc5d51e9ff61976b42f86a1cb"></span>void <code class="descname">forward</code><span class="sig-paren">(</span>PassType <em>passType</em><span class="sig-paren">)</span><a class="headerlink" href="#_CPPv2N6paddle11CosSimLayer7forwardE8PassType" title="Permalink to this definition">¶</a></dt>
Y
Yu Yang 已提交
6896 6897 6898 6899 6900
<dd><p>Forward propagation. All inherited implementation should call Layer::foward() function. </p>
</dd></dl>

<dl class="function">
<dt id="_CPPv2N6paddle11CosSimLayer8backwardERK14UpdateCallback">
6901
<span id="paddle::CosSimLayer::backward__UpdateCallbackCR"></span><span class="target" id="paddleclasspaddle_1_1CosSimLayer_1a757cf8875e53fae7cb96b6b745038105"></span>void <code class="descname">backward</code><span class="sig-paren">(</span><em class="property">const</em> <a class="reference internal" href="../../parameter/parameter/parameter.html#_CPPv2N6paddle14UpdateCallbackE" title="paddle::UpdateCallback">UpdateCallback</a> &amp;<em>callback</em> = nullptr<span class="sig-paren">)</span><a class="headerlink" href="#_CPPv2N6paddle11CosSimLayer8backwardERK14UpdateCallback" title="Permalink to this definition">¶</a></dt>
6902
<dd><p>Backward propagation. Should only be called after <a class="reference internal" href="#paddleclasspaddle_1_1Layer_1a12386b3f20dd731e7ceaa2c61667cbe1"><span class="std std-ref">Layer::forward()</span></a> function. </p>
Y
Yu Yang 已提交
6903 6904 6905 6906 6907 6908 6909 6910 6911 6912 6913
</dd></dl>

</div>
</dd></dl>

</div>
<div class="section" id="cossimvecmatlayer">
<h2>CosSimVecMatLayer<a class="headerlink" href="#cossimvecmatlayer" title="Permalink to this headline">¶</a></h2>
<dl class="class">
<dt id="_CPPv2N6paddle17CosSimVecMatLayerE">
<span id="paddle::CosSimVecMatLayer"></span><span class="target" id="paddleclasspaddle_1_1CosSimVecMatLayer"></span><em class="property">class </em><code class="descclassname">paddle::</code><code class="descname">CosSimVecMatLayer</code><a class="headerlink" href="#_CPPv2N6paddle17CosSimVecMatLayerE" title="Permalink to this definition">¶</a></dt>
Y
Yu Yang 已提交
6914 6915 6916 6917 6918 6919 6920 6921 6922
<dd><p>A layer for computing cosine similarity between a vector and each row of a matrix out[i] = cos_scale * cos(in1, in2(i,:));. </p>
<p>
Input1: a vector (batchSize * dataDim)<dl class="docutils">
<dt><strong>Note</strong></dt>
<dd>used in NEURAL TURING MACHINE</dd>
</dl>
</p>
<p>Input2: a matrix in vector form (batchSize * (weightDim*dataDim))</p>
<p>Output: a vector (batchSize * weightDim) </p>
6923
<p>Inherits from <a class="reference internal" href="#paddleclasspaddle_1_1Layer"><span class="std std-ref">paddle::Layer</span></a></p>
6924
<div class="breathe-sectiondef docutils container">
Y
Yu Yang 已提交
6925 6926 6927 6928 6929 6930 6931 6932 6933 6934 6935 6936 6937
<p class="breathe-sectiondef-title rubric">Public Functions</p>
<dl class="function">
<dt id="_CPPv2N6paddle17CosSimVecMatLayer17CosSimVecMatLayerERK11LayerConfig">
<span id="paddle::CosSimVecMatLayer::CosSimVecMatLayer__LayerConfigCR"></span><span class="target" id="paddleclasspaddle_1_1CosSimVecMatLayer_1ae28ab037a907cbcc9a42412232595570"></span><code class="descname">CosSimVecMatLayer</code><span class="sig-paren">(</span><em class="property">const</em> LayerConfig &amp;<em>config</em><span class="sig-paren">)</span><a class="headerlink" href="#_CPPv2N6paddle17CosSimVecMatLayer17CosSimVecMatLayerERK11LayerConfig" title="Permalink to this definition">¶</a></dt>
<dd></dd></dl>

<dl class="function">
<dt id="_CPPv2N6paddle17CosSimVecMatLayerD0Ev">
<span id="paddle::CosSimVecMatLayer::~CosSimVecMatLayer"></span><span class="target" id="paddleclasspaddle_1_1CosSimVecMatLayer_1a6dad786eed95390963e77c4a90c70407"></span><code class="descname">~CosSimVecMatLayer</code><span class="sig-paren">(</span><span class="sig-paren">)</span><a class="headerlink" href="#_CPPv2N6paddle17CosSimVecMatLayerD0Ev" title="Permalink to this definition">¶</a></dt>
<dd></dd></dl>

<dl class="function">
<dt id="_CPPv2N6paddle17CosSimVecMatLayer4initERK8LayerMapRK12ParameterMap">
6938
<span id="paddle::CosSimVecMatLayer::init__LayerMapCR.ParameterMapCR"></span><span class="target" id="paddleclasspaddle_1_1CosSimVecMatLayer_1a1633ca5419e3cceefbe93b95075f00af"></span>bool <code class="descname">init</code><span class="sig-paren">(</span><em class="property">const</em> LayerMap &amp;<em>layerMap</em>, <em class="property">const</em> <a class="reference internal" href="../../parameter/parameter/parameter.html#_CPPv2N6paddle12ParameterMapE" title="paddle::ParameterMap">ParameterMap</a> &amp;<em>parameterMap</em><span class="sig-paren">)</span><a class="headerlink" href="#_CPPv2N6paddle17CosSimVecMatLayer4initERK8LayerMapRK12ParameterMap" title="Permalink to this definition">¶</a></dt>
Y
Yu Yang 已提交
6939 6940 6941 6942 6943
<dd><p>Intialization. For example, adding input layers from layerMap and parameterMap. </p>
</dd></dl>

<dl class="function">
<dt id="_CPPv2N6paddle17CosSimVecMatLayer7forwardE8PassType">
6944
<span id="paddle::CosSimVecMatLayer::forward__PassType"></span><span class="target" id="paddleclasspaddle_1_1CosSimVecMatLayer_1aacc834697a218f5e80646947063d1103"></span>void <code class="descname">forward</code><span class="sig-paren">(</span>PassType <em>passType</em><span class="sig-paren">)</span><a class="headerlink" href="#_CPPv2N6paddle17CosSimVecMatLayer7forwardE8PassType" title="Permalink to this definition">¶</a></dt>
Y
Yu Yang 已提交
6945 6946 6947 6948 6949
<dd><p>Forward propagation. All inherited implementation should call Layer::foward() function. </p>
</dd></dl>

<dl class="function">
<dt id="_CPPv2N6paddle17CosSimVecMatLayer8backwardERK14UpdateCallback">
6950
<span id="paddle::CosSimVecMatLayer::backward__UpdateCallbackCR"></span><span class="target" id="paddleclasspaddle_1_1CosSimVecMatLayer_1aa70b648bf7cf218e22b36b2bdbce4eba"></span>void <code class="descname">backward</code><span class="sig-paren">(</span><em class="property">const</em> <a class="reference internal" href="../../parameter/parameter/parameter.html#_CPPv2N6paddle14UpdateCallbackE" title="paddle::UpdateCallback">UpdateCallback</a> &amp;<em>callback</em> = nullptr<span class="sig-paren">)</span><a class="headerlink" href="#_CPPv2N6paddle17CosSimVecMatLayer8backwardERK14UpdateCallback" title="Permalink to this definition">¶</a></dt>
6951
<dd><p>Backward propagation. Should only be called after <a class="reference internal" href="#paddleclasspaddle_1_1Layer_1a12386b3f20dd731e7ceaa2c61667cbe1"><span class="std std-ref">Layer::forward()</span></a> function. </p>
Y
Yu Yang 已提交
6952 6953 6954
</dd></dl>

</div>
6955
<div class="breathe-sectiondef docutils container">
Y
Yu Yang 已提交
6956 6957 6958 6959 6960 6961 6962 6963 6964 6965 6966 6967 6968 6969 6970 6971 6972 6973 6974 6975 6976 6977 6978 6979 6980 6981 6982 6983 6984 6985 6986 6987 6988 6989 6990 6991 6992 6993 6994 6995 6996
<p class="breathe-sectiondef-title rubric">Protected Attributes</p>
<dl class="member">
<dt id="_CPPv2N6paddle17CosSimVecMatLayer7tmpMtx0E">
<span id="paddle::CosSimVecMatLayer::tmpMtx0__MatrixPtr"></span><span class="target" id="paddleclasspaddle_1_1CosSimVecMatLayer_1a445f167e50b67e1d63cda46bb827b0e9"></span><a class="reference internal" href="../../math/matrix/matrix.html#_CPPv2N6paddle9MatrixPtrE" title="paddle::MatrixPtr">MatrixPtr</a> <code class="descname">tmpMtx0</code><a class="headerlink" href="#_CPPv2N6paddle17CosSimVecMatLayer7tmpMtx0E" title="Permalink to this definition">¶</a></dt>
<dd></dd></dl>

<dl class="member">
<dt id="_CPPv2N6paddle17CosSimVecMatLayer7tmpMtx1E">
<span id="paddle::CosSimVecMatLayer::tmpMtx1__MatrixPtr"></span><span class="target" id="paddleclasspaddle_1_1CosSimVecMatLayer_1a6b769845247aa893ef2ded0e68bf1a4f"></span><a class="reference internal" href="../../math/matrix/matrix.html#_CPPv2N6paddle9MatrixPtrE" title="paddle::MatrixPtr">MatrixPtr</a> <code class="descname">tmpMtx1</code><a class="headerlink" href="#_CPPv2N6paddle17CosSimVecMatLayer7tmpMtx1E" title="Permalink to this definition">¶</a></dt>
<dd></dd></dl>

<dl class="member">
<dt id="_CPPv2N6paddle17CosSimVecMatLayer7tmpRow0E">
<span id="paddle::CosSimVecMatLayer::tmpRow0__MatrixPtr"></span><span class="target" id="paddleclasspaddle_1_1CosSimVecMatLayer_1abbe19bedb2695cfe96a391989248fcdb"></span><a class="reference internal" href="../../math/matrix/matrix.html#_CPPv2N6paddle9MatrixPtrE" title="paddle::MatrixPtr">MatrixPtr</a> <code class="descname">tmpRow0</code><a class="headerlink" href="#_CPPv2N6paddle17CosSimVecMatLayer7tmpRow0E" title="Permalink to this definition">¶</a></dt>
<dd></dd></dl>

<dl class="member">
<dt id="_CPPv2N6paddle17CosSimVecMatLayer7tmpRow1E">
<span id="paddle::CosSimVecMatLayer::tmpRow1__MatrixPtr"></span><span class="target" id="paddleclasspaddle_1_1CosSimVecMatLayer_1a7b72932cbe2f940299dac4dee25ba140"></span><a class="reference internal" href="../../math/matrix/matrix.html#_CPPv2N6paddle9MatrixPtrE" title="paddle::MatrixPtr">MatrixPtr</a> <code class="descname">tmpRow1</code><a class="headerlink" href="#_CPPv2N6paddle17CosSimVecMatLayer7tmpRow1E" title="Permalink to this definition">¶</a></dt>
<dd></dd></dl>

<dl class="member">
<dt id="_CPPv2N6paddle17CosSimVecMatLayer7tmpRow2E">
<span id="paddle::CosSimVecMatLayer::tmpRow2__MatrixPtr"></span><span class="target" id="paddleclasspaddle_1_1CosSimVecMatLayer_1a4698a61e9a7df1014ba0526e77bac407"></span><a class="reference internal" href="../../math/matrix/matrix.html#_CPPv2N6paddle9MatrixPtrE" title="paddle::MatrixPtr">MatrixPtr</a> <code class="descname">tmpRow2</code><a class="headerlink" href="#_CPPv2N6paddle17CosSimVecMatLayer7tmpRow2E" title="Permalink to this definition">¶</a></dt>
<dd></dd></dl>

<dl class="member">
<dt id="_CPPv2N6paddle17CosSimVecMatLayer7tmpRow3E">
<span id="paddle::CosSimVecMatLayer::tmpRow3__MatrixPtr"></span><span class="target" id="paddleclasspaddle_1_1CosSimVecMatLayer_1adb8edee2170affd0a49efc62bf0b7f23"></span><a class="reference internal" href="../../math/matrix/matrix.html#_CPPv2N6paddle9MatrixPtrE" title="paddle::MatrixPtr">MatrixPtr</a> <code class="descname">tmpRow3</code><a class="headerlink" href="#_CPPv2N6paddle17CosSimVecMatLayer7tmpRow3E" title="Permalink to this definition">¶</a></dt>
<dd></dd></dl>

</div>
</dd></dl>

</div>
<div class="section" id="crfdecodinglayer">
<h2>CRFDecodingLayer<a class="headerlink" href="#crfdecodinglayer" title="Permalink to this headline">¶</a></h2>
<dl class="class">
<dt id="_CPPv2N6paddle16CRFDecodingLayerE">
<span id="paddle::CRFDecodingLayer"></span><span class="target" id="paddleclasspaddle_1_1CRFDecodingLayer"></span><em class="property">class </em><code class="descclassname">paddle::</code><code class="descname">CRFDecodingLayer</code><a class="headerlink" href="#_CPPv2N6paddle16CRFDecodingLayerE" title="Permalink to this definition">¶</a></dt>
<dd><p>A layer for calculating the decoding sequence of sequential conditional random field model. The decoding sequence is stored in output_.ids It also calculate error, output_.value[i] is 1 for incorrect decoding or 0 for correct decoding) See LinearChainCRF.h for the detail of the CRF formulation. </p>
6997
<p>Inherits from <a class="reference internal" href="#paddleclasspaddle_1_1CRFLayer"><span class="std std-ref">paddle::CRFLayer</span></a></p>
6998
<div class="breathe-sectiondef docutils container">
Y
Yu Yang 已提交
6999 7000 7001 7002 7003 7004 7005 7006
<p class="breathe-sectiondef-title rubric">Public Functions</p>
<dl class="function">
<dt id="_CPPv2N6paddle16CRFDecodingLayer16CRFDecodingLayerERK11LayerConfig">
<span id="paddle::CRFDecodingLayer::CRFDecodingLayer__LayerConfigCR"></span><span class="target" id="paddleclasspaddle_1_1CRFDecodingLayer_1abc435bbaad94d6cdf2760dec35e46815"></span><code class="descname">CRFDecodingLayer</code><span class="sig-paren">(</span><em class="property">const</em> LayerConfig &amp;<em>config</em><span class="sig-paren">)</span><a class="headerlink" href="#_CPPv2N6paddle16CRFDecodingLayer16CRFDecodingLayerERK11LayerConfig" title="Permalink to this definition">¶</a></dt>
<dd></dd></dl>

<dl class="function">
<dt id="_CPPv2N6paddle16CRFDecodingLayer4initERK8LayerMapRK12ParameterMap">
7007
<span id="paddle::CRFDecodingLayer::init__LayerMapCR.ParameterMapCR"></span><span class="target" id="paddleclasspaddle_1_1CRFDecodingLayer_1a14dc22599fae5a3cbfe2400ef5f9ca16"></span>bool <code class="descname">init</code><span class="sig-paren">(</span><em class="property">const</em> LayerMap &amp;<em>layerMap</em>, <em class="property">const</em> <a class="reference internal" href="../../parameter/parameter/parameter.html#_CPPv2N6paddle12ParameterMapE" title="paddle::ParameterMap">ParameterMap</a> &amp;<em>parameterMap</em><span class="sig-paren">)</span><a class="headerlink" href="#_CPPv2N6paddle16CRFDecodingLayer4initERK8LayerMapRK12ParameterMap" title="Permalink to this definition">¶</a></dt>
Y
Yu Yang 已提交
7008 7009 7010 7011 7012
<dd><p>Intialization. For example, adding input layers from layerMap and parameterMap. </p>
</dd></dl>

<dl class="function">
<dt id="_CPPv2N6paddle16CRFDecodingLayer7forwardE8PassType">
7013
<span id="paddle::CRFDecodingLayer::forward__PassType"></span><span class="target" id="paddleclasspaddle_1_1CRFDecodingLayer_1a90e482e007423b002468a30d3c8694d3"></span>void <code class="descname">forward</code><span class="sig-paren">(</span>PassType <em>passType</em><span class="sig-paren">)</span><a class="headerlink" href="#_CPPv2N6paddle16CRFDecodingLayer7forwardE8PassType" title="Permalink to this definition">¶</a></dt>
Y
Yu Yang 已提交
7014 7015 7016 7017 7018
<dd><p>Forward propagation. All inherited implementation should call Layer::foward() function. </p>
</dd></dl>

<dl class="function">
<dt id="_CPPv2N6paddle16CRFDecodingLayer8backwardERK14UpdateCallback">
7019
<span id="paddle::CRFDecodingLayer::backward__UpdateCallbackCR"></span><span class="target" id="paddleclasspaddle_1_1CRFDecodingLayer_1a9d1a6137c887e4a002b421eb52fca9b6"></span>void <code class="descname">backward</code><span class="sig-paren">(</span><em class="property">const</em> <a class="reference internal" href="../../parameter/parameter/parameter.html#_CPPv2N6paddle14UpdateCallbackE" title="paddle::UpdateCallback">UpdateCallback</a> &amp;<em>callback</em><span class="sig-paren">)</span><a class="headerlink" href="#_CPPv2N6paddle16CRFDecodingLayer8backwardERK14UpdateCallback" title="Permalink to this definition">¶</a></dt>
7020
<dd><p>Backward propagation. Should only be called after <a class="reference internal" href="#paddleclasspaddle_1_1Layer_1a12386b3f20dd731e7ceaa2c61667cbe1"><span class="std std-ref">Layer::forward()</span></a> function. </p>
Y
Yu Yang 已提交
7021 7022 7023
</dd></dl>

</div>
7024
<div class="breathe-sectiondef docutils container">
Y
Yu Yang 已提交
7025 7026 7027 7028 7029 7030 7031 7032 7033 7034 7035 7036 7037 7038 7039
<p class="breathe-sectiondef-title rubric">Protected Attributes</p>
<dl class="member">
<dt id="_CPPv2N6paddle16CRFDecodingLayer4crf_E">
<span id="paddle::CRFDecodingLayer::crf___std::unique_ptr:LinearChainCRF:"></span><span class="target" id="paddleclasspaddle_1_1CRFDecodingLayer_1aabdfed7cc9ac1bfb7afcea72fc52d317"></span>std::unique_ptr&lt;<a class="reference internal" href="#_CPPv2N6paddle14LinearChainCRFE" title="paddle::LinearChainCRF">LinearChainCRF</a>&gt; <code class="descname">crf_</code><a class="headerlink" href="#_CPPv2N6paddle16CRFDecodingLayer4crf_E" title="Permalink to this definition">¶</a></dt>
<dd></dd></dl>

</div>
</dd></dl>

</div>
<div class="section" id="crflayer">
<h2>CRFLayer<a class="headerlink" href="#crflayer" title="Permalink to this headline">¶</a></h2>
<dl class="class">
<dt id="_CPPv2N6paddle8CRFLayerE">
<span id="paddle::CRFLayer"></span><span class="target" id="paddleclasspaddle_1_1CRFLayer"></span><em class="property">class </em><code class="descclassname">paddle::</code><code class="descname">CRFLayer</code><a class="headerlink" href="#_CPPv2N6paddle8CRFLayerE" title="Permalink to this definition">¶</a></dt>
7040
<dd><p>A layer for calculating the cost of sequential conditional random field model. See class <a class="reference internal" href="#paddleclasspaddle_1_1LinearChainCRF"><span class="std std-ref">LinearChainCRF</span></a> for the detail of the CRF formulation. </p>
7041 7042
<p>Inherits from <a class="reference internal" href="#paddleclasspaddle_1_1Layer"><span class="std std-ref">paddle::Layer</span></a></p>
<p>Subclassed by <a class="reference internal" href="#paddleclasspaddle_1_1CRFDecodingLayer"><span class="std std-ref">paddle::CRFDecodingLayer</span></a></p>
7043
<div class="breathe-sectiondef docutils container">
Y
Yu Yang 已提交
7044 7045 7046 7047 7048 7049 7050 7051
<p class="breathe-sectiondef-title rubric">Public Functions</p>
<dl class="function">
<dt id="_CPPv2N6paddle8CRFLayer8CRFLayerERK11LayerConfig">
<span id="paddle::CRFLayer::CRFLayer__LayerConfigCR"></span><span class="target" id="paddleclasspaddle_1_1CRFLayer_1a2ab2d3f595bda295c2bc27bc25cdffb0"></span><code class="descname">CRFLayer</code><span class="sig-paren">(</span><em class="property">const</em> LayerConfig &amp;<em>config</em><span class="sig-paren">)</span><a class="headerlink" href="#_CPPv2N6paddle8CRFLayer8CRFLayerERK11LayerConfig" title="Permalink to this definition">¶</a></dt>
<dd></dd></dl>

<dl class="function">
<dt id="_CPPv2N6paddle8CRFLayer4initERK8LayerMapRK12ParameterMap">
7052
<span id="paddle::CRFLayer::init__LayerMapCR.ParameterMapCR"></span><span class="target" id="paddleclasspaddle_1_1CRFLayer_1ac1bf8c82c334b0dfeb8c9c68e3119350"></span>bool <code class="descname">init</code><span class="sig-paren">(</span><em class="property">const</em> LayerMap &amp;<em>layerMap</em>, <em class="property">const</em> <a class="reference internal" href="../../parameter/parameter/parameter.html#_CPPv2N6paddle12ParameterMapE" title="paddle::ParameterMap">ParameterMap</a> &amp;<em>parameterMap</em><span class="sig-paren">)</span><a class="headerlink" href="#_CPPv2N6paddle8CRFLayer4initERK8LayerMapRK12ParameterMap" title="Permalink to this definition">¶</a></dt>
Y
Yu Yang 已提交
7053 7054 7055 7056 7057
<dd><p>Intialization. For example, adding input layers from layerMap and parameterMap. </p>
</dd></dl>

<dl class="function">
<dt id="_CPPv2N6paddle8CRFLayer7forwardE8PassType">
7058
<span id="paddle::CRFLayer::forward__PassType"></span><span class="target" id="paddleclasspaddle_1_1CRFLayer_1aaeb4fdf8b7fc85a2346a213ec8677d6f"></span>void <code class="descname">forward</code><span class="sig-paren">(</span>PassType <em>passType</em><span class="sig-paren">)</span><a class="headerlink" href="#_CPPv2N6paddle8CRFLayer7forwardE8PassType" title="Permalink to this definition">¶</a></dt>
Y
Yu Yang 已提交
7059 7060 7061 7062 7063
<dd><p>Forward propagation. All inherited implementation should call Layer::foward() function. </p>
</dd></dl>

<dl class="function">
<dt id="_CPPv2N6paddle8CRFLayer8backwardERK14UpdateCallback">
7064
<span id="paddle::CRFLayer::backward__UpdateCallbackCR"></span><span class="target" id="paddleclasspaddle_1_1CRFLayer_1aec04ca1c95e3f6a325c95d504dd188ec"></span>void <code class="descname">backward</code><span class="sig-paren">(</span><em class="property">const</em> <a class="reference internal" href="../../parameter/parameter/parameter.html#_CPPv2N6paddle14UpdateCallbackE" title="paddle::UpdateCallback">UpdateCallback</a> &amp;<em>callback</em><span class="sig-paren">)</span><a class="headerlink" href="#_CPPv2N6paddle8CRFLayer8backwardERK14UpdateCallback" title="Permalink to this definition">¶</a></dt>
7065
<dd><p>Backward propagation. Should only be called after <a class="reference internal" href="#paddleclasspaddle_1_1Layer_1a12386b3f20dd731e7ceaa2c61667cbe1"><span class="std std-ref">Layer::forward()</span></a> function. </p>
Y
Yu Yang 已提交
7066 7067 7068
</dd></dl>

</div>
7069
<div class="breathe-sectiondef docutils container">
Y
Yu Yang 已提交
7070 7071 7072 7073 7074 7075 7076 7077 7078 7079 7080 7081 7082 7083 7084 7085 7086 7087 7088 7089 7090 7091 7092 7093 7094 7095 7096 7097 7098 7099 7100 7101 7102 7103 7104
<p class="breathe-sectiondef-title rubric">Protected Attributes</p>
<dl class="member">
<dt id="_CPPv2N6paddle8CRFLayer11numClasses_E">
<span id="paddle::CRFLayer::numClasses___s"></span><span class="target" id="paddleclasspaddle_1_1CRFLayer_1a46948d5d0f45db7d3a104975e8bf1122"></span>size_t <code class="descname">numClasses_</code><a class="headerlink" href="#_CPPv2N6paddle8CRFLayer11numClasses_E" title="Permalink to this definition">¶</a></dt>
<dd></dd></dl>

<dl class="member">
<dt id="_CPPv2N6paddle8CRFLayer10parameter_E">
<span id="paddle::CRFLayer::parameter___ParameterPtr"></span><span class="target" id="paddleclasspaddle_1_1CRFLayer_1a36c98113996e55b87b0385c244a561ee"></span><a class="reference internal" href="../../parameter/parameter/parameter.html#_CPPv2N6paddle12ParameterPtrE" title="paddle::ParameterPtr">ParameterPtr</a> <code class="descname">parameter_</code><a class="headerlink" href="#_CPPv2N6paddle8CRFLayer10parameter_E" title="Permalink to this definition">¶</a></dt>
<dd></dd></dl>

<dl class="member">
<dt id="_CPPv2N6paddle8CRFLayer5crfs_E">
<span id="paddle::CRFLayer::crfs___std::vector:LinearChainCRF:"></span><span class="target" id="paddleclasspaddle_1_1CRFLayer_1a2b2397ee324a7ff6a6ed7338f6e8a3a6"></span>std::vector&lt;<a class="reference internal" href="#_CPPv2N6paddle14LinearChainCRFE" title="paddle::LinearChainCRF">LinearChainCRF</a>&gt; <code class="descname">crfs_</code><a class="headerlink" href="#_CPPv2N6paddle8CRFLayer5crfs_E" title="Permalink to this definition">¶</a></dt>
<dd></dd></dl>

<dl class="member">
<dt id="_CPPv2N6paddle8CRFLayer12weightLayer_E">
<span id="paddle::CRFLayer::weightLayer___LayerPtr"></span><span class="target" id="paddleclasspaddle_1_1CRFLayer_1aaeb038da54f58bbfcf2b84dd09c68ab9"></span>LayerPtr <code class="descname">weightLayer_</code><a class="headerlink" href="#_CPPv2N6paddle8CRFLayer12weightLayer_E" title="Permalink to this definition">¶</a></dt>
<dd></dd></dl>

<dl class="member">
<dt id="_CPPv2N6paddle8CRFLayer6coeff_E">
<span id="paddle::CRFLayer::coeff___real"></span><span class="target" id="paddleclasspaddle_1_1CRFLayer_1af27685671d4f8397d8d5d234912c3cda"></span>real <code class="descname">coeff_</code><a class="headerlink" href="#_CPPv2N6paddle8CRFLayer6coeff_E" title="Permalink to this definition">¶</a></dt>
<dd></dd></dl>

</div>
</dd></dl>

</div>
<div class="section" id="ctclayer">
<h2>CTCLayer<a class="headerlink" href="#ctclayer" title="Permalink to this headline">¶</a></h2>
<dl class="class">
<dt id="_CPPv2N6paddle8CTCLayerE">
<span id="paddle::CTCLayer"></span><span class="target" id="paddleclasspaddle_1_1CTCLayer"></span><em class="property">class </em><code class="descclassname">paddle::</code><code class="descname">CTCLayer</code><a class="headerlink" href="#_CPPv2N6paddle8CTCLayerE" title="Permalink to this definition">¶</a></dt>
7105
<dd><p>Inherits from <a class="reference internal" href="#paddleclasspaddle_1_1Layer"><span class="std std-ref">paddle::Layer</span></a></p>
7106
<div class="breathe-sectiondef docutils container">
Y
Yu Yang 已提交
7107 7108 7109 7110 7111 7112 7113 7114
<p class="breathe-sectiondef-title rubric">Public Functions</p>
<dl class="function">
<dt id="_CPPv2N6paddle8CTCLayer8CTCLayerERK11LayerConfig">
<span id="paddle::CTCLayer::CTCLayer__LayerConfigCR"></span><span class="target" id="paddleclasspaddle_1_1CTCLayer_1a74fefc409308a07af914048f15c82e2b"></span><code class="descname">CTCLayer</code><span class="sig-paren">(</span><em class="property">const</em> LayerConfig &amp;<em>config</em><span class="sig-paren">)</span><a class="headerlink" href="#_CPPv2N6paddle8CTCLayer8CTCLayerERK11LayerConfig" title="Permalink to this definition">¶</a></dt>
<dd></dd></dl>

<dl class="function">
<dt id="_CPPv2N6paddle8CTCLayer4initERK8LayerMapRK12ParameterMap">
7115
<span id="paddle::CTCLayer::init__LayerMapCR.ParameterMapCR"></span><span class="target" id="paddleclasspaddle_1_1CTCLayer_1aab66810edc8d379886ec070420c247ce"></span>bool <code class="descname">init</code><span class="sig-paren">(</span><em class="property">const</em> LayerMap &amp;<em>layerMap</em>, <em class="property">const</em> <a class="reference internal" href="../../parameter/parameter/parameter.html#_CPPv2N6paddle12ParameterMapE" title="paddle::ParameterMap">ParameterMap</a> &amp;<em>parameterMap</em><span class="sig-paren">)</span><a class="headerlink" href="#_CPPv2N6paddle8CTCLayer4initERK8LayerMapRK12ParameterMap" title="Permalink to this definition">¶</a></dt>
Y
Yu Yang 已提交
7116 7117 7118 7119 7120
<dd><p>Intialization. For example, adding input layers from layerMap and parameterMap. </p>
</dd></dl>

<dl class="function">
<dt id="_CPPv2N6paddle8CTCLayer7forwardE8PassType">
7121
<span id="paddle::CTCLayer::forward__PassType"></span><span class="target" id="paddleclasspaddle_1_1CTCLayer_1ad704585530fef3653ea213aa5343d671"></span>void <code class="descname">forward</code><span class="sig-paren">(</span>PassType <em>passType</em><span class="sig-paren">)</span><a class="headerlink" href="#_CPPv2N6paddle8CTCLayer7forwardE8PassType" title="Permalink to this definition">¶</a></dt>
Y
Yu Yang 已提交
7122 7123 7124 7125 7126 7127 7128 7129 7130 7131
<dd><p>Forward propagation. All inherited implementation should call Layer::foward() function. </p>
</dd></dl>

<dl class="function">
<dt id="_CPPv2N6paddle8CTCLayer10forwardImpERK8ArgumentRK8Argument">
<span id="paddle::CTCLayer::forwardImp__ArgumentCR.ArgumentCR"></span><span class="target" id="paddleclasspaddle_1_1CTCLayer_1aee67dc8ceb20bcf9fc899da49fdbbcb4"></span>void <code class="descname">forwardImp</code><span class="sig-paren">(</span><em class="property">const</em> <a class="reference internal" href="../../parameter/parameter/parameter.html#_CPPv2N6paddle8ArgumentE" title="paddle::Argument">Argument</a> &amp;<em>softmaxSeqs</em>, <em class="property">const</em> <a class="reference internal" href="../../parameter/parameter/parameter.html#_CPPv2N6paddle8ArgumentE" title="paddle::Argument">Argument</a> &amp;<em>labelSeqs</em><span class="sig-paren">)</span><a class="headerlink" href="#_CPPv2N6paddle8CTCLayer10forwardImpERK8ArgumentRK8Argument" title="Permalink to this definition">¶</a></dt>
<dd></dd></dl>

<dl class="function">
<dt id="_CPPv2N6paddle8CTCLayer8backwardERK14UpdateCallback">
7132
<span id="paddle::CTCLayer::backward__UpdateCallbackCR"></span><span class="target" id="paddleclasspaddle_1_1CTCLayer_1a49c97ac69fd26d5505560fcffed8a756"></span>void <code class="descname">backward</code><span class="sig-paren">(</span><em class="property">const</em> <a class="reference internal" href="../../parameter/parameter/parameter.html#_CPPv2N6paddle14UpdateCallbackE" title="paddle::UpdateCallback">UpdateCallback</a> &amp;<em>callback</em><span class="sig-paren">)</span><a class="headerlink" href="#_CPPv2N6paddle8CTCLayer8backwardERK14UpdateCallback" title="Permalink to this definition">¶</a></dt>
7133
<dd><p>Backward propagation. Should only be called after <a class="reference internal" href="#paddleclasspaddle_1_1Layer_1a12386b3f20dd731e7ceaa2c61667cbe1"><span class="std std-ref">Layer::forward()</span></a> function. </p>
Y
Yu Yang 已提交
7134 7135 7136 7137 7138 7139 7140 7141
</dd></dl>

<dl class="function">
<dt id="_CPPv2N6paddle8CTCLayer11backwardImpERK14UpdateCallbackRK8ArgumentRK8Argument">
<span id="paddle::CTCLayer::backwardImp__UpdateCallbackCR.ArgumentCR.ArgumentCR"></span><span class="target" id="paddleclasspaddle_1_1CTCLayer_1ae3e707b1a9aefeeda6d3a2502b8852b5"></span>void <code class="descname">backwardImp</code><span class="sig-paren">(</span><em class="property">const</em> <a class="reference internal" href="../../parameter/parameter/parameter.html#_CPPv2N6paddle14UpdateCallbackE" title="paddle::UpdateCallback">UpdateCallback</a> &amp;<em>callback</em>, <em class="property">const</em> <a class="reference internal" href="../../parameter/parameter/parameter.html#_CPPv2N6paddle8ArgumentE" title="paddle::Argument">Argument</a> &amp;<em>softmaxSeqs</em>, <em class="property">const</em> <a class="reference internal" href="../../parameter/parameter/parameter.html#_CPPv2N6paddle8ArgumentE" title="paddle::Argument">Argument</a> &amp;<em>labelSeqs</em><span class="sig-paren">)</span><a class="headerlink" href="#_CPPv2N6paddle8CTCLayer11backwardImpERK14UpdateCallbackRK8ArgumentRK8Argument" title="Permalink to this definition">¶</a></dt>
<dd></dd></dl>

</div>
7142
<div class="breathe-sectiondef docutils container">
Y
Yu Yang 已提交
7143 7144 7145 7146 7147 7148 7149 7150 7151 7152 7153 7154 7155 7156 7157 7158 7159 7160 7161 7162 7163 7164 7165 7166 7167 7168 7169 7170 7171 7172 7173 7174 7175
<p class="breathe-sectiondef-title rubric">Protected Attributes</p>
<dl class="member">
<dt id="_CPPv2N6paddle8CTCLayer11numClasses_E">
<span id="paddle::CTCLayer::numClasses___s"></span><span class="target" id="paddleclasspaddle_1_1CTCLayer_1a3835c28d5182da3cc2d81ffee8b23b36"></span>size_t <code class="descname">numClasses_</code><a class="headerlink" href="#_CPPv2N6paddle8CTCLayer11numClasses_E" title="Permalink to this definition">¶</a></dt>
<dd></dd></dl>

<dl class="member">
<dt id="_CPPv2N6paddle8CTCLayer12normByTimes_E">
<span id="paddle::CTCLayer::normByTimes___b"></span><span class="target" id="paddleclasspaddle_1_1CTCLayer_1ac2bae7786d8ee137e288d469b46c444c"></span>bool <code class="descname">normByTimes_</code><a class="headerlink" href="#_CPPv2N6paddle8CTCLayer12normByTimes_E" title="Permalink to this definition">¶</a></dt>
<dd></dd></dl>

<dl class="member">
<dt id="_CPPv2N6paddle8CTCLayer5ctcs_E">
<span id="paddle::CTCLayer::ctcs___std::vector:LinearChainCTC:"></span><span class="target" id="paddleclasspaddle_1_1CTCLayer_1a5411226335df1567f1e553b5d2420a2d"></span>std::vector&lt;<a class="reference internal" href="#_CPPv2N6paddle14LinearChainCTCE" title="paddle::LinearChainCTC">LinearChainCTC</a>&gt; <code class="descname">ctcs_</code><a class="headerlink" href="#_CPPv2N6paddle8CTCLayer5ctcs_E" title="Permalink to this definition">¶</a></dt>
<dd></dd></dl>

<dl class="member">
<dt id="_CPPv2N6paddle8CTCLayer12tmpCpuInput_E">
<span id="paddle::CTCLayer::tmpCpuInput___std::vector:Argument:"></span><span class="target" id="paddleclasspaddle_1_1CTCLayer_1a508f8b9e11e0b6d5158d7d80a42da2e1"></span>std::vector&lt;<a class="reference internal" href="../../parameter/parameter/parameter.html#_CPPv2N6paddle8ArgumentE" title="paddle::Argument">Argument</a>&gt; <code class="descname">tmpCpuInput_</code><a class="headerlink" href="#_CPPv2N6paddle8CTCLayer12tmpCpuInput_E" title="Permalink to this definition">¶</a></dt>
<dd></dd></dl>

</div>
</dd></dl>

</div>
<div class="section" id="hierarchicalsigmoidlayer">
<h2>HierarchicalSigmoidLayer<a class="headerlink" href="#hierarchicalsigmoidlayer" title="Permalink to this headline">¶</a></h2>
<dl class="class">
<dt id="_CPPv2N6paddle24HierarchicalSigmoidLayerE">
<span id="paddle::HierarchicalSigmoidLayer"></span><span class="target" id="paddleclasspaddle_1_1HierarchicalSigmoidLayer"></span><em class="property">class </em><code class="descclassname">paddle::</code><code class="descname">HierarchicalSigmoidLayer</code><a class="headerlink" href="#_CPPv2N6paddle24HierarchicalSigmoidLayerE" title="Permalink to this definition">¶</a></dt>
<dd><p>Organize the classes into a binary tree. At each node, a sigmoid function is used to calculate the probability of belonging to the right branch. This idea is from &#8220;F. Morin, Y. Bengio (AISTATS 05): 
Hierarchical Probabilistic Neural Network Language Model.&#8221;</p>
<p>Here we uses a simple way of making the binary tree. Assuming the number of classes C = 6, The classes are organized as a binary tree in the following way:</p>
7176 7177 7178 7179 7180 7181 7182 7183
<p><div class="highlight-default"><div class="highlight"><pre><span></span><span class="o">*-*-*-</span> <span class="mi">2</span>
<span class="o">|</span> <span class="o">|</span> <span class="o">|-</span> <span class="mi">3</span>
<span class="o">|</span> <span class="o">|</span>
<span class="o">|</span> <span class="o">|-*-</span> <span class="mi">4</span>
<span class="o">|</span>   <span class="o">|-</span> <span class="mi">5</span>
<span class="o">|</span>
<span class="o">|-*-</span> <span class="mi">0</span>
<span class="o">|-</span> <span class="mi">1</span>
Y
Yu Yang 已提交
7184 7185 7186 7187 7188 7189 7190 7191 7192 7193 7194 7195 7196 7197 7198 7199 7200 7201 7202 7203 7204 7205
</pre></div>
</div>
</p>
<p>where * indicates an internal node, and each leaf node represents a class.<ul class="simple">
<li>Node 0 ... C-2 are internal nodes.</li>
<li>Node C-1 ... 2C-2 are leaf nodes.</li>
<li>Class c is represented by leaf node <span class="math">\(c+C-1\)</span>.</li>
</ul>
</p>
<p>We assign an id for each node:<ul class="simple">
<li>the id of root be 0.</li>
<li>the left child of a node i is 2*i+1.</li>
<li>the right child of a node i is 2*i+2.</li>
</ul>
</p>
<p>It&#8217;s easy to see that:<ul class="simple">
<li>the parent of node i is <span class="math">\(\left\lfloor(i-1)/2\right\rfloor\)</span>.</li>
<li>the j-th level ancestor of node i is <span class="math">\(\left\lfloor(i+1)/2^{j+1}\right\rfloor - 1\)</span>.</li>
<li>A node i is a left child of its parent if <span class="math">\((i-1)\%2==0\)</span>.</li>
</ul>
</p>
<p>The config file api is hsigmod_layer. </p>
7206
<p>Inherits from <a class="reference internal" href="#paddleclasspaddle_1_1Layer"><span class="std std-ref">paddle::Layer</span></a></p>
7207
<div class="breathe-sectiondef docutils container">
Y
Yu Yang 已提交
7208 7209 7210 7211 7212 7213 7214 7215
<p class="breathe-sectiondef-title rubric">Public Functions</p>
<dl class="function">
<dt id="_CPPv2N6paddle24HierarchicalSigmoidLayer24HierarchicalSigmoidLayerERK11LayerConfig">
<span id="paddle::HierarchicalSigmoidLayer::HierarchicalSigmoidLayer__LayerConfigCR"></span><span class="target" id="paddleclasspaddle_1_1HierarchicalSigmoidLayer_1a6a5d9d65a98e3b0ebedba9754885b491"></span><code class="descname">HierarchicalSigmoidLayer</code><span class="sig-paren">(</span><em class="property">const</em> LayerConfig &amp;<em>config</em><span class="sig-paren">)</span><a class="headerlink" href="#_CPPv2N6paddle24HierarchicalSigmoidLayer24HierarchicalSigmoidLayerERK11LayerConfig" title="Permalink to this definition">¶</a></dt>
<dd></dd></dl>

<dl class="function">
<dt id="_CPPv2N6paddle24HierarchicalSigmoidLayer4initERK8LayerMapRK12ParameterMap">
7216
<span id="paddle::HierarchicalSigmoidLayer::init__LayerMapCR.ParameterMapCR"></span><span class="target" id="paddleclasspaddle_1_1HierarchicalSigmoidLayer_1a9130492516a3ad086fadd2a94dfbaa40"></span>bool <code class="descname">init</code><span class="sig-paren">(</span><em class="property">const</em> LayerMap &amp;<em>layerMap</em>, <em class="property">const</em> <a class="reference internal" href="../../parameter/parameter/parameter.html#_CPPv2N6paddle12ParameterMapE" title="paddle::ParameterMap">ParameterMap</a> &amp;<em>parameterMap</em><span class="sig-paren">)</span><a class="headerlink" href="#_CPPv2N6paddle24HierarchicalSigmoidLayer4initERK8LayerMapRK12ParameterMap" title="Permalink to this definition">¶</a></dt>
Y
Yu Yang 已提交
7217 7218 7219 7220 7221
<dd><p>Intialization. For example, adding input layers from layerMap and parameterMap. </p>
</dd></dl>

<dl class="function">
<dt id="_CPPv2N6paddle24HierarchicalSigmoidLayer7forwardE8PassType">
7222
<span id="paddle::HierarchicalSigmoidLayer::forward__PassType"></span><span class="target" id="paddleclasspaddle_1_1HierarchicalSigmoidLayer_1abda913a9bff557ab31f4fc00da44fac2"></span>void <code class="descname">forward</code><span class="sig-paren">(</span>PassType <em>passType</em><span class="sig-paren">)</span><a class="headerlink" href="#_CPPv2N6paddle24HierarchicalSigmoidLayer7forwardE8PassType" title="Permalink to this definition">¶</a></dt>
Y
Yu Yang 已提交
7223 7224 7225 7226 7227
<dd><p>Forward propagation. All inherited implementation should call Layer::foward() function. </p>
</dd></dl>

<dl class="function">
<dt id="_CPPv2N6paddle24HierarchicalSigmoidLayer8backwardERK14UpdateCallback">
7228
<span id="paddle::HierarchicalSigmoidLayer::backward__UpdateCallbackCR"></span><span class="target" id="paddleclasspaddle_1_1HierarchicalSigmoidLayer_1a5b3dfb0fc1b53b12abd43db2a4e0d4b4"></span>void <code class="descname">backward</code><span class="sig-paren">(</span><em class="property">const</em> <a class="reference internal" href="../../parameter/parameter/parameter.html#_CPPv2N6paddle14UpdateCallbackE" title="paddle::UpdateCallback">UpdateCallback</a> &amp;<em>callback</em><span class="sig-paren">)</span><a class="headerlink" href="#_CPPv2N6paddle24HierarchicalSigmoidLayer8backwardERK14UpdateCallback" title="Permalink to this definition">¶</a></dt>
7229
<dd><p>Backward propagation. Should only be called after <a class="reference internal" href="#paddleclasspaddle_1_1Layer_1a12386b3f20dd731e7ceaa2c61667cbe1"><span class="std std-ref">Layer::forward()</span></a> function. </p>
Y
Yu Yang 已提交
7230 7231 7232
</dd></dl>

</div>
7233
<div class="breathe-sectiondef docutils container">
Y
Yu Yang 已提交
7234 7235 7236 7237 7238 7239 7240 7241
<p class="breathe-sectiondef-title rubric">Protected Functions</p>
<dl class="function">
<dt id="_CPPv2N6paddle24HierarchicalSigmoidLayer13getLabelLayerEv">
<span id="paddle::HierarchicalSigmoidLayer::getLabelLayer"></span><span class="target" id="paddleclasspaddle_1_1HierarchicalSigmoidLayer_1a3d60d77d73ccfe5c19cd42aefc010eab"></span>LayerPtr <code class="descname">getLabelLayer</code><span class="sig-paren">(</span><span class="sig-paren">)</span><a class="headerlink" href="#_CPPv2N6paddle24HierarchicalSigmoidLayer13getLabelLayerEv" title="Permalink to this definition">¶</a></dt>
<dd><p>The last of inputs is label layer. </p>
</dd></dl>

</div>
7242
<div class="breathe-sectiondef docutils container">
Y
Yu Yang 已提交
7243 7244 7245 7246 7247 7248 7249 7250 7251 7252 7253 7254 7255 7256 7257 7258 7259 7260 7261 7262 7263 7264 7265 7266 7267 7268 7269 7270 7271 7272 7273 7274 7275 7276 7277 7278 7279 7280
<p class="breathe-sectiondef-title rubric">Protected Attributes</p>
<dl class="member">
<dt id="_CPPv2N6paddle24HierarchicalSigmoidLayer8weights_E">
<span id="paddle::HierarchicalSigmoidLayer::weights___WeightList"></span><span class="target" id="paddleclasspaddle_1_1HierarchicalSigmoidLayer_1a35b5158733eb16df5017aabc5f03932a"></span><a class="reference internal" href="../../parameter/parameter/parameter.html#_CPPv2N6paddle10WeightListE" title="paddle::WeightList">WeightList</a> <code class="descname">weights_</code><a class="headerlink" href="#_CPPv2N6paddle24HierarchicalSigmoidLayer8weights_E" title="Permalink to this definition">¶</a></dt>
<dd></dd></dl>

<dl class="member">
<dt id="_CPPv2N6paddle24HierarchicalSigmoidLayer7biases_E">
<span id="paddle::HierarchicalSigmoidLayer::biases___std::unique_ptr:Weight:"></span><span class="target" id="paddleclasspaddle_1_1HierarchicalSigmoidLayer_1a5cfb8239bf39a35de69ac0b8f2f4b0a1"></span>std::unique_ptr&lt;<a class="reference internal" href="../../parameter/parameter/parameter.html#_CPPv2N6paddle6WeightE" title="paddle::Weight">Weight</a>&gt; <code class="descname">biases_</code><a class="headerlink" href="#_CPPv2N6paddle24HierarchicalSigmoidLayer7biases_E" title="Permalink to this definition">¶</a></dt>
<dd></dd></dl>

<dl class="member">
<dt id="_CPPv2N6paddle24HierarchicalSigmoidLayer11numClasses_E">
<span id="paddle::HierarchicalSigmoidLayer::numClasses___s"></span><span class="target" id="paddleclasspaddle_1_1HierarchicalSigmoidLayer_1ac4c3a9c3ab6dbbf2bd33bcffab52559f"></span>size_t <code class="descname">numClasses_</code><a class="headerlink" href="#_CPPv2N6paddle24HierarchicalSigmoidLayer11numClasses_E" title="Permalink to this definition">¶</a></dt>
<dd><p>number of classes </p>
</dd></dl>

<dl class="member">
<dt id="_CPPv2N6paddle24HierarchicalSigmoidLayer11codeLength_E">
<span id="paddle::HierarchicalSigmoidLayer::codeLength___i"></span><span class="target" id="paddleclasspaddle_1_1HierarchicalSigmoidLayer_1adfb96e000ddf17b1f28a7710ee30d8ae"></span>int <code class="descname">codeLength_</code><a class="headerlink" href="#_CPPv2N6paddle24HierarchicalSigmoidLayer11codeLength_E" title="Permalink to this definition">¶</a></dt>
<dd><p>codeLength_ = <span class="math">\(1 + \left\lfloor log_{2}(numClasses-1)\right\rfloor\)</span> </p>
</dd></dl>

<dl class="member">
<dt id="_CPPv2N6paddle24HierarchicalSigmoidLayer10preOutput_E">
<span id="paddle::HierarchicalSigmoidLayer::preOutput___Argument"></span><span class="target" id="paddleclasspaddle_1_1HierarchicalSigmoidLayer_1a2e244c2c9b658eedfaae0bcc62f4f15c"></span><a class="reference internal" href="../../parameter/parameter/parameter.html#_CPPv2N6paddle8ArgumentE" title="paddle::Argument">Argument</a> <code class="descname">preOutput_</code><a class="headerlink" href="#_CPPv2N6paddle24HierarchicalSigmoidLayer10preOutput_E" title="Permalink to this definition">¶</a></dt>
<dd><p>temporary result of output_ </p>
</dd></dl>

</div>
</dd></dl>

</div>
<div class="section" id="linearchaincrf">
<h2>LinearChainCRF<a class="headerlink" href="#linearchaincrf" title="Permalink to this headline">¶</a></h2>
<dl class="class">
<dt id="_CPPv2N6paddle14LinearChainCRFE">
<span id="paddle::LinearChainCRF"></span><span class="target" id="paddleclasspaddle_1_1LinearChainCRF"></span><em class="property">class </em><code class="descclassname">paddle::</code><code class="descname">LinearChainCRF</code><a class="headerlink" href="#_CPPv2N6paddle14LinearChainCRFE" title="Permalink to this definition">¶</a></dt>
7281
<dd><div class="breathe-sectiondef docutils container">
Y
Yu Yang 已提交
7282 7283 7284 7285
<p class="breathe-sectiondef-title rubric">Public Functions</p>
<dl class="function">
<dt id="_CPPv2N6paddle14LinearChainCRF14LinearChainCRFEiP4realP4real">
<span id="paddle::LinearChainCRF::LinearChainCRF__i.realP.realP"></span><span class="target" id="paddleclasspaddle_1_1LinearChainCRF_1a091bf516302972b9259d77bcb3667783"></span><code class="descname">LinearChainCRF</code><span class="sig-paren">(</span>int <em>numClasses</em>, real *<em>para</em>, real *<em>grad</em><span class="sig-paren">)</span><a class="headerlink" href="#_CPPv2N6paddle14LinearChainCRF14LinearChainCRFEiP4realP4real" title="Permalink to this definition">¶</a></dt>
7286 7287 7288
<dd><p>The size of para and grad must be <span class="math">\((numClasses + 2) * numClasses\)</span>. The first numClasses values of para are for starting weights ( <span class="math">\(a\)</span>). The next numClasses values of para are for ending weights ( <span class="math">\(b\)</span>), The remaning values are for transition weights ( <span class="math">\(w\)</span>).</p>
<p>The probability of a state sequence s of length <span class="math">\(L\)</span> is defined as: <span class="math">\(P(s) = (1/Z) exp(a_{s_1} + b_{s_L} + \sum_{l=1}^L x_{s_l} + \sum_{l=2}^L w_{s_{l-1},s_l})\)</span> where <span class="math">\(Z\)</span> is a normalization value so that the sum of <span class="math">\(P(s)\)</span> over all possible sequences is <span class="math">\(1\)</span>, and <span class="math">\(x\)</span> is the input feature to the CRF. </p>
</dd></dl>
Y
Yu Yang 已提交
7289 7290 7291 7292

<dl class="function">
<dt id="_CPPv2N6paddle14LinearChainCRF7forwardEP4realPii">
<span id="paddle::LinearChainCRF::forward__realP.iP.i"></span><span class="target" id="paddleclasspaddle_1_1LinearChainCRF_1a1273df7f4b9bceb6eda9a5cf84825af3"></span>real <code class="descname">forward</code><span class="sig-paren">(</span>real *<em>x</em>, int *<em>s</em>, int <em>length</em><span class="sig-paren">)</span><a class="headerlink" href="#_CPPv2N6paddle14LinearChainCRF7forwardEP4realPii" title="Permalink to this definition">¶</a></dt>
7293 7294
<dd><p>Calculate the negative log likelihood of s given x. The size of x must be length * numClasses. Each consecutive numClasses values are the features for one time step. </p>
</dd></dl>
Y
Yu Yang 已提交
7295 7296 7297 7298

<dl class="function">
<dt id="_CPPv2N6paddle14LinearChainCRF8backwardEP4realP4realPii">
<span id="paddle::LinearChainCRF::backward__realP.realP.iP.i"></span><span class="target" id="paddleclasspaddle_1_1LinearChainCRF_1a64da4f29ca7f1bbc47e754ce76dd54db"></span>void <code class="descname">backward</code><span class="sig-paren">(</span>real *<em>x</em>, real *<em>dx</em>, int *<em>s</em>, int <em>length</em><span class="sig-paren">)</span><a class="headerlink" href="#_CPPv2N6paddle14LinearChainCRF8backwardEP4realP4realPii" title="Permalink to this definition">¶</a></dt>
7299 7300 7301 7302 7303 7304
<dd><p>Calculate the gradient with respect to x, a, b, and w. The gradient of x will be stored in dx. <a class="reference internal" href="#paddleclasspaddle_1_1LinearChainCRF_1a64da4f29ca7f1bbc47e754ce76dd54db"><span class="std std-ref">backward()</span></a> can only be called after a corresponding call to <a class="reference internal" href="#paddleclasspaddle_1_1LinearChainCRF_1a1273df7f4b9bceb6eda9a5cf84825af3"><span class="std std-ref">forward()</span></a> with the same x, s and length. <dl class="docutils">
<dt><strong>Note</strong></dt>
<dd>The gradient is added to dx and grad (provided at constructor). </dd>
</dl>
</p>
</dd></dl>
Y
Yu Yang 已提交
7305 7306 7307 7308

<dl class="function">
<dt id="_CPPv2N6paddle14LinearChainCRF6decodeEP4realPii">
<span id="paddle::LinearChainCRF::decode__realP.iP.i"></span><span class="target" id="paddleclasspaddle_1_1LinearChainCRF_1af1c5bb033d8709ae5e3e1ce36e367bd7"></span>void <code class="descname">decode</code><span class="sig-paren">(</span>real *<em>x</em>, int *<em>s</em>, int <em>length</em><span class="sig-paren">)</span><a class="headerlink" href="#_CPPv2N6paddle14LinearChainCRF6decodeEP4realPii" title="Permalink to this definition">¶</a></dt>
7309 7310
<dd><p>Find the most probable sequence given x. The result will be stored in s. </p>
</dd></dl>
Y
Yu Yang 已提交
7311 7312

</div>
7313
<div class="breathe-sectiondef docutils container">
Y
Yu Yang 已提交
7314 7315 7316 7317 7318 7319 7320 7321 7322 7323 7324 7325 7326 7327 7328 7329 7330 7331 7332 7333 7334 7335 7336 7337 7338 7339 7340 7341 7342 7343 7344 7345 7346 7347 7348 7349 7350 7351 7352 7353 7354 7355 7356 7357 7358 7359 7360 7361 7362 7363 7364 7365 7366 7367 7368 7369 7370 7371 7372 7373 7374 7375 7376 7377 7378 7379 7380 7381 7382 7383 7384 7385 7386 7387 7388 7389 7390 7391 7392 7393
<p class="breathe-sectiondef-title rubric">Protected Attributes</p>
<dl class="member">
<dt id="_CPPv2N6paddle14LinearChainCRF11numClasses_E">
<span id="paddle::LinearChainCRF::numClasses___i"></span><span class="target" id="paddleclasspaddle_1_1LinearChainCRF_1afffe7119475ca21c2cc299057540e876"></span>int <code class="descname">numClasses_</code><a class="headerlink" href="#_CPPv2N6paddle14LinearChainCRF11numClasses_E" title="Permalink to this definition">¶</a></dt>
<dd></dd></dl>

<dl class="member">
<dt id="_CPPv2N6paddle14LinearChainCRF2a_E">
<span id="paddle::LinearChainCRF::a___MatrixPtr"></span><span class="target" id="paddleclasspaddle_1_1LinearChainCRF_1a9a84c929c29ceb6015ca85e65fe05fd2"></span><a class="reference internal" href="../../math/matrix/matrix.html#_CPPv2N6paddle9MatrixPtrE" title="paddle::MatrixPtr">MatrixPtr</a> <code class="descname">a_</code><a class="headerlink" href="#_CPPv2N6paddle14LinearChainCRF2a_E" title="Permalink to this definition">¶</a></dt>
<dd></dd></dl>

<dl class="member">
<dt id="_CPPv2N6paddle14LinearChainCRF2b_E">
<span id="paddle::LinearChainCRF::b___MatrixPtr"></span><span class="target" id="paddleclasspaddle_1_1LinearChainCRF_1ae3b48bac20edba9a34415a67c56d2895"></span><a class="reference internal" href="../../math/matrix/matrix.html#_CPPv2N6paddle9MatrixPtrE" title="paddle::MatrixPtr">MatrixPtr</a> <code class="descname">b_</code><a class="headerlink" href="#_CPPv2N6paddle14LinearChainCRF2b_E" title="Permalink to this definition">¶</a></dt>
<dd></dd></dl>

<dl class="member">
<dt id="_CPPv2N6paddle14LinearChainCRF2w_E">
<span id="paddle::LinearChainCRF::w___MatrixPtr"></span><span class="target" id="paddleclasspaddle_1_1LinearChainCRF_1aa76c63f5c57200c8538f17a112e840f9"></span><a class="reference internal" href="../../math/matrix/matrix.html#_CPPv2N6paddle9MatrixPtrE" title="paddle::MatrixPtr">MatrixPtr</a> <code class="descname">w_</code><a class="headerlink" href="#_CPPv2N6paddle14LinearChainCRF2w_E" title="Permalink to this definition">¶</a></dt>
<dd></dd></dl>

<dl class="member">
<dt id="_CPPv2N6paddle14LinearChainCRF3da_E">
<span id="paddle::LinearChainCRF::da___MatrixPtr"></span><span class="target" id="paddleclasspaddle_1_1LinearChainCRF_1a8f98769ae060889c5ca9e51e22490904"></span><a class="reference internal" href="../../math/matrix/matrix.html#_CPPv2N6paddle9MatrixPtrE" title="paddle::MatrixPtr">MatrixPtr</a> <code class="descname">da_</code><a class="headerlink" href="#_CPPv2N6paddle14LinearChainCRF3da_E" title="Permalink to this definition">¶</a></dt>
<dd></dd></dl>

<dl class="member">
<dt id="_CPPv2N6paddle14LinearChainCRF3db_E">
<span id="paddle::LinearChainCRF::db___MatrixPtr"></span><span class="target" id="paddleclasspaddle_1_1LinearChainCRF_1a5adb0f77bb7b87fa38ac2c2d9749ff6a"></span><a class="reference internal" href="../../math/matrix/matrix.html#_CPPv2N6paddle9MatrixPtrE" title="paddle::MatrixPtr">MatrixPtr</a> <code class="descname">db_</code><a class="headerlink" href="#_CPPv2N6paddle14LinearChainCRF3db_E" title="Permalink to this definition">¶</a></dt>
<dd></dd></dl>

<dl class="member">
<dt id="_CPPv2N6paddle14LinearChainCRF3dw_E">
<span id="paddle::LinearChainCRF::dw___MatrixPtr"></span><span class="target" id="paddleclasspaddle_1_1LinearChainCRF_1a4bd62ca03fced933f9595a7fadcb0c17"></span><a class="reference internal" href="../../math/matrix/matrix.html#_CPPv2N6paddle9MatrixPtrE" title="paddle::MatrixPtr">MatrixPtr</a> <code class="descname">dw_</code><a class="headerlink" href="#_CPPv2N6paddle14LinearChainCRF3dw_E" title="Permalink to this definition">¶</a></dt>
<dd></dd></dl>

<dl class="member">
<dt id="_CPPv2N6paddle14LinearChainCRF5ones_E">
<span id="paddle::LinearChainCRF::ones___MatrixPtr"></span><span class="target" id="paddleclasspaddle_1_1LinearChainCRF_1adee6ca802e5a435d6bc33ca447a4fb0f"></span><a class="reference internal" href="../../math/matrix/matrix.html#_CPPv2N6paddle9MatrixPtrE" title="paddle::MatrixPtr">MatrixPtr</a> <code class="descname">ones_</code><a class="headerlink" href="#_CPPv2N6paddle14LinearChainCRF5ones_E" title="Permalink to this definition">¶</a></dt>
<dd></dd></dl>

<dl class="member">
<dt id="_CPPv2N6paddle14LinearChainCRF5expX_E">
<span id="paddle::LinearChainCRF::expX___MatrixPtr"></span><span class="target" id="paddleclasspaddle_1_1LinearChainCRF_1a46fa104de51dc40ca84def97fc4f8229"></span><a class="reference internal" href="../../math/matrix/matrix.html#_CPPv2N6paddle9MatrixPtrE" title="paddle::MatrixPtr">MatrixPtr</a> <code class="descname">expX_</code><a class="headerlink" href="#_CPPv2N6paddle14LinearChainCRF5expX_E" title="Permalink to this definition">¶</a></dt>
<dd></dd></dl>

<dl class="member">
<dt id="_CPPv2N6paddle14LinearChainCRF6alpha_E">
<span id="paddle::LinearChainCRF::alpha___MatrixPtr"></span><span class="target" id="paddleclasspaddle_1_1LinearChainCRF_1a4d09d9dcfcf9f104e1c91094f92508a8"></span><a class="reference internal" href="../../math/matrix/matrix.html#_CPPv2N6paddle9MatrixPtrE" title="paddle::MatrixPtr">MatrixPtr</a> <code class="descname">alpha_</code><a class="headerlink" href="#_CPPv2N6paddle14LinearChainCRF6alpha_E" title="Permalink to this definition">¶</a></dt>
<dd></dd></dl>

<dl class="member">
<dt id="_CPPv2N6paddle14LinearChainCRF5beta_E">
<span id="paddle::LinearChainCRF::beta___MatrixPtr"></span><span class="target" id="paddleclasspaddle_1_1LinearChainCRF_1a80d4b4cf1604eb5511cd7b39cc9fb2d2"></span><a class="reference internal" href="../../math/matrix/matrix.html#_CPPv2N6paddle9MatrixPtrE" title="paddle::MatrixPtr">MatrixPtr</a> <code class="descname">beta_</code><a class="headerlink" href="#_CPPv2N6paddle14LinearChainCRF5beta_E" title="Permalink to this definition">¶</a></dt>
<dd></dd></dl>

<dl class="member">
<dt id="_CPPv2N6paddle14LinearChainCRF5maxX_E">
<span id="paddle::LinearChainCRF::maxX___MatrixPtr"></span><span class="target" id="paddleclasspaddle_1_1LinearChainCRF_1a34d2ad8e8abe522b64b414621027267c"></span><a class="reference internal" href="../../math/matrix/matrix.html#_CPPv2N6paddle9MatrixPtrE" title="paddle::MatrixPtr">MatrixPtr</a> <code class="descname">maxX_</code><a class="headerlink" href="#_CPPv2N6paddle14LinearChainCRF5maxX_E" title="Permalink to this definition">¶</a></dt>
<dd></dd></dl>

<dl class="member">
<dt id="_CPPv2N6paddle14LinearChainCRF5expW_E">
<span id="paddle::LinearChainCRF::expW___MatrixPtr"></span><span class="target" id="paddleclasspaddle_1_1LinearChainCRF_1a81f000163a043a61e661fbb5a44c12c6"></span><a class="reference internal" href="../../math/matrix/matrix.html#_CPPv2N6paddle9MatrixPtrE" title="paddle::MatrixPtr">MatrixPtr</a> <code class="descname">expW_</code><a class="headerlink" href="#_CPPv2N6paddle14LinearChainCRF5expW_E" title="Permalink to this definition">¶</a></dt>
<dd></dd></dl>

<dl class="member">
<dt id="_CPPv2N6paddle14LinearChainCRF6track_E">
<span id="paddle::LinearChainCRF::track___IVectorPtr"></span><span class="target" id="paddleclasspaddle_1_1LinearChainCRF_1aadab94e0a9fcf5e10fe5f030cacb1874"></span><a class="reference internal" href="../../math/matrix/matrix.html#_CPPv2N6paddle10IVectorPtrE" title="paddle::IVectorPtr">IVectorPtr</a> <code class="descname">track_</code><a class="headerlink" href="#_CPPv2N6paddle14LinearChainCRF6track_E" title="Permalink to this definition">¶</a></dt>
<dd></dd></dl>

</div>
</dd></dl>

</div>
<div class="section" id="linearchainctc">
<h2>LinearChainCTC<a class="headerlink" href="#linearchainctc" title="Permalink to this headline">¶</a></h2>
<dl class="class">
<dt id="_CPPv2N6paddle14LinearChainCTCE">
<span id="paddle::LinearChainCTC"></span><span class="target" id="paddleclasspaddle_1_1LinearChainCTC"></span><em class="property">class </em><code class="descclassname">paddle::</code><code class="descname">LinearChainCTC</code><a class="headerlink" href="#_CPPv2N6paddle14LinearChainCTCE" title="Permalink to this definition">¶</a></dt>
7394
<dd><div class="breathe-sectiondef docutils container">
Y
Yu Yang 已提交
7395 7396 7397 7398 7399 7400 7401 7402 7403 7404 7405 7406 7407 7408 7409 7410 7411
<p class="breathe-sectiondef-title rubric">Public Functions</p>
<dl class="function">
<dt id="_CPPv2N6paddle14LinearChainCTC14LinearChainCTCEib">
<span id="paddle::LinearChainCTC::LinearChainCTC__i.b"></span><span class="target" id="paddleclasspaddle_1_1LinearChainCTC_1a01ccd793a4467382c2e63972749a0fec"></span><code class="descname">LinearChainCTC</code><span class="sig-paren">(</span>int <em>numClasses</em>, bool <em>normByTimes</em><span class="sig-paren">)</span><a class="headerlink" href="#_CPPv2N6paddle14LinearChainCTC14LinearChainCTCEib" title="Permalink to this definition">¶</a></dt>
<dd></dd></dl>

<dl class="function">
<dt id="_CPPv2N6paddle14LinearChainCTC7forwardEP4realiPii">
<span id="paddle::LinearChainCTC::forward__realP.i.iP.i"></span><span class="target" id="paddleclasspaddle_1_1LinearChainCTC_1a57d436a5b882b52094713be4050eaf5d"></span>real <code class="descname">forward</code><span class="sig-paren">(</span>real *<em>softmaxSeq</em>, int <em>softmaxSeqLen</em>, int *<em>labelSeq</em>, int <em>labelSeqLen</em><span class="sig-paren">)</span><a class="headerlink" href="#_CPPv2N6paddle14LinearChainCTC7forwardEP4realiPii" title="Permalink to this definition">¶</a></dt>
<dd></dd></dl>

<dl class="function">
<dt id="_CPPv2N6paddle14LinearChainCTC8backwardEP4realP4realPii">
<span id="paddle::LinearChainCTC::backward__realP.realP.iP.i"></span><span class="target" id="paddleclasspaddle_1_1LinearChainCTC_1a24a6a95176a7965814a8db3adafb128d"></span>void <code class="descname">backward</code><span class="sig-paren">(</span>real *<em>softmaxSeq</em>, real *<em>softmaxSeqGrad</em>, int *<em>labelSeq</em>, int <em>labelSeqLen</em><span class="sig-paren">)</span><a class="headerlink" href="#_CPPv2N6paddle14LinearChainCTC8backwardEP4realP4realPii" title="Permalink to this definition">¶</a></dt>
<dd></dd></dl>

</div>
7412
<div class="breathe-sectiondef docutils container">
Y
Yu Yang 已提交
7413 7414 7415 7416 7417 7418 7419
<p class="breathe-sectiondef-title rubric">Protected Functions</p>
<dl class="function">
<dt id="_CPPv2N6paddle14LinearChainCTC12segmentRangeERiRii">
<span id="paddle::LinearChainCTC::segmentRange__iR.iR.i"></span><span class="target" id="paddleclasspaddle_1_1LinearChainCTC_1a346328d7ce9057f8cf20e92ee4013f57"></span>void <code class="descname">segmentRange</code><span class="sig-paren">(</span>int &amp;<em>start</em>, int &amp;<em>end</em>, int <em>time</em><span class="sig-paren">)</span><a class="headerlink" href="#_CPPv2N6paddle14LinearChainCTC12segmentRangeERiRii" title="Permalink to this definition">¶</a></dt>
<dd></dd></dl>

</div>
7420
<div class="breathe-sectiondef docutils container">
Y
Yu Yang 已提交
7421 7422 7423 7424 7425 7426 7427 7428 7429 7430 7431 7432 7433 7434 7435 7436 7437 7438 7439 7440 7441 7442 7443 7444 7445 7446 7447 7448 7449 7450 7451 7452 7453 7454 7455 7456 7457 7458 7459 7460 7461 7462 7463 7464 7465 7466 7467 7468 7469 7470 7471 7472 7473 7474 7475 7476 7477 7478 7479 7480 7481 7482 7483 7484 7485
<p class="breathe-sectiondef-title rubric">Protected Attributes</p>
<dl class="member">
<dt id="_CPPv2N6paddle14LinearChainCTC11numClasses_E">
<span id="paddle::LinearChainCTC::numClasses___i"></span><span class="target" id="paddleclasspaddle_1_1LinearChainCTC_1a12a1b6733e10445ee7d498fe2ac7391b"></span>int <code class="descname">numClasses_</code><a class="headerlink" href="#_CPPv2N6paddle14LinearChainCTC11numClasses_E" title="Permalink to this definition">¶</a></dt>
<dd></dd></dl>

<dl class="member">
<dt id="_CPPv2N6paddle14LinearChainCTC6blank_E">
<span id="paddle::LinearChainCTC::blank___i"></span><span class="target" id="paddleclasspaddle_1_1LinearChainCTC_1a188b44c342c6bdb989cfed4a906859b7"></span>int <code class="descname">blank_</code><a class="headerlink" href="#_CPPv2N6paddle14LinearChainCTC6blank_E" title="Permalink to this definition">¶</a></dt>
<dd></dd></dl>

<dl class="member">
<dt id="_CPPv2N6paddle14LinearChainCTC14totalSegments_E">
<span id="paddle::LinearChainCTC::totalSegments___i"></span><span class="target" id="paddleclasspaddle_1_1LinearChainCTC_1ae24df8a89d2e1529d3eb025bd92ffeb4"></span>int <code class="descname">totalSegments_</code><a class="headerlink" href="#_CPPv2N6paddle14LinearChainCTC14totalSegments_E" title="Permalink to this definition">¶</a></dt>
<dd></dd></dl>

<dl class="member">
<dt id="_CPPv2N6paddle14LinearChainCTC10totalTime_E">
<span id="paddle::LinearChainCTC::totalTime___i"></span><span class="target" id="paddleclasspaddle_1_1LinearChainCTC_1a27b32818456d4fa8d9474027179c7fdb"></span>int <code class="descname">totalTime_</code><a class="headerlink" href="#_CPPv2N6paddle14LinearChainCTC10totalTime_E" title="Permalink to this definition">¶</a></dt>
<dd></dd></dl>

<dl class="member">
<dt id="_CPPv2N6paddle14LinearChainCTC12normByTimes_E">
<span id="paddle::LinearChainCTC::normByTimes___b"></span><span class="target" id="paddleclasspaddle_1_1LinearChainCTC_1afcb88de7fa4c3e68396807ddc81aa917"></span>bool <code class="descname">normByTimes_</code><a class="headerlink" href="#_CPPv2N6paddle14LinearChainCTC12normByTimes_E" title="Permalink to this definition">¶</a></dt>
<dd></dd></dl>

<dl class="member">
<dt id="_CPPv2N6paddle14LinearChainCTC10isInvalid_E">
<span id="paddle::LinearChainCTC::isInvalid___b"></span><span class="target" id="paddleclasspaddle_1_1LinearChainCTC_1ad83b9b1fb7e080a90aebef01fbc14b46"></span>bool <code class="descname">isInvalid_</code><a class="headerlink" href="#_CPPv2N6paddle14LinearChainCTC10isInvalid_E" title="Permalink to this definition">¶</a></dt>
<dd></dd></dl>

<dl class="member">
<dt id="_CPPv2N6paddle14LinearChainCTC8logActs_E">
<span id="paddle::LinearChainCTC::logActs___MatrixPtr"></span><span class="target" id="paddleclasspaddle_1_1LinearChainCTC_1acf9fbd1dbb1798d0830a90d2e9ff9474"></span><a class="reference internal" href="../../math/matrix/matrix.html#_CPPv2N6paddle9MatrixPtrE" title="paddle::MatrixPtr">MatrixPtr</a> <code class="descname">logActs_</code><a class="headerlink" href="#_CPPv2N6paddle14LinearChainCTC8logActs_E" title="Permalink to this definition">¶</a></dt>
<dd></dd></dl>

<dl class="member">
<dt id="_CPPv2N6paddle14LinearChainCTC12forwardVars_E">
<span id="paddle::LinearChainCTC::forwardVars___MatrixPtr"></span><span class="target" id="paddleclasspaddle_1_1LinearChainCTC_1aa1102cfd482f4247d44b42f510786e24"></span><a class="reference internal" href="../../math/matrix/matrix.html#_CPPv2N6paddle9MatrixPtrE" title="paddle::MatrixPtr">MatrixPtr</a> <code class="descname">forwardVars_</code><a class="headerlink" href="#_CPPv2N6paddle14LinearChainCTC12forwardVars_E" title="Permalink to this definition">¶</a></dt>
<dd></dd></dl>

<dl class="member">
<dt id="_CPPv2N6paddle14LinearChainCTC13backwardVars_E">
<span id="paddle::LinearChainCTC::backwardVars___MatrixPtr"></span><span class="target" id="paddleclasspaddle_1_1LinearChainCTC_1a27b0181553e6519ae37be57b85201b3d"></span><a class="reference internal" href="../../math/matrix/matrix.html#_CPPv2N6paddle9MatrixPtrE" title="paddle::MatrixPtr">MatrixPtr</a> <code class="descname">backwardVars_</code><a class="headerlink" href="#_CPPv2N6paddle14LinearChainCTC13backwardVars_E" title="Permalink to this definition">¶</a></dt>
<dd></dd></dl>

<dl class="member">
<dt id="_CPPv2N6paddle14LinearChainCTC10gradTerms_E">
<span id="paddle::LinearChainCTC::gradTerms___MatrixPtr"></span><span class="target" id="paddleclasspaddle_1_1LinearChainCTC_1a5c8a58279f2a7b51f9c411c9927e467c"></span><a class="reference internal" href="../../math/matrix/matrix.html#_CPPv2N6paddle9MatrixPtrE" title="paddle::MatrixPtr">MatrixPtr</a> <code class="descname">gradTerms_</code><a class="headerlink" href="#_CPPv2N6paddle14LinearChainCTC10gradTerms_E" title="Permalink to this definition">¶</a></dt>
<dd></dd></dl>

<dl class="member">
<dt id="_CPPv2N6paddle14LinearChainCTC8logProb_E">
<span id="paddle::LinearChainCTC::logProb___real"></span><span class="target" id="paddleclasspaddle_1_1LinearChainCTC_1af46ca83de49e79ce5921a39b02be5b28"></span>real <code class="descname">logProb_</code><a class="headerlink" href="#_CPPv2N6paddle14LinearChainCTC8logProb_E" title="Permalink to this definition">¶</a></dt>
<dd></dd></dl>

</div>
</dd></dl>

</div>
<div class="section" id="ncelayer">
<h2>NCELayer<a class="headerlink" href="#ncelayer" title="Permalink to this headline">¶</a></h2>
<dl class="class">
<dt id="_CPPv2N6paddle8NCELayerE">
<span id="paddle::NCELayer"></span><span class="target" id="paddleclasspaddle_1_1NCELayer"></span><em class="property">class </em><code class="descclassname">paddle::</code><code class="descname">NCELayer</code><a class="headerlink" href="#_CPPv2N6paddle8NCELayerE" title="Permalink to this definition">¶</a></dt>
7486 7487
<dd><p>Noise-contrastive estimation. Implements the method in the following paper: A fast and simple algorithm for training neural probabilistic language models.</p>
<p>The config file api is nce_layer. </p>
7488
<p>Inherits from <a class="reference internal" href="#paddleclasspaddle_1_1Layer"><span class="std std-ref">paddle::Layer</span></a></p>
7489
<div class="breathe-sectiondef docutils container">
Y
Yu Yang 已提交
7490 7491 7492 7493 7494 7495 7496 7497
<p class="breathe-sectiondef-title rubric">Public Functions</p>
<dl class="function">
<dt id="_CPPv2N6paddle8NCELayer8NCELayerERK11LayerConfig">
<span id="paddle::NCELayer::NCELayer__LayerConfigCR"></span><span class="target" id="paddleclasspaddle_1_1NCELayer_1a55781bc0b031b513c332af6fe020f598"></span><code class="descname">NCELayer</code><span class="sig-paren">(</span><em class="property">const</em> LayerConfig &amp;<em>config</em><span class="sig-paren">)</span><a class="headerlink" href="#_CPPv2N6paddle8NCELayer8NCELayerERK11LayerConfig" title="Permalink to this definition">¶</a></dt>
<dd></dd></dl>

<dl class="function">
<dt id="_CPPv2N6paddle8NCELayer4initERK8LayerMapRK12ParameterMap">
7498
<span id="paddle::NCELayer::init__LayerMapCR.ParameterMapCR"></span><span class="target" id="paddleclasspaddle_1_1NCELayer_1a6e6e482124dfe1c3a1cbf7e990d50981"></span>bool <code class="descname">init</code><span class="sig-paren">(</span><em class="property">const</em> LayerMap &amp;<em>layerMap</em>, <em class="property">const</em> <a class="reference internal" href="../../parameter/parameter/parameter.html#_CPPv2N6paddle12ParameterMapE" title="paddle::ParameterMap">ParameterMap</a> &amp;<em>parameterMap</em><span class="sig-paren">)</span><a class="headerlink" href="#_CPPv2N6paddle8NCELayer4initERK8LayerMapRK12ParameterMap" title="Permalink to this definition">¶</a></dt>
Y
Yu Yang 已提交
7499 7500 7501 7502 7503 7504 7505 7506 7507 7508
<dd><p>Intialization. For example, adding input layers from layerMap and parameterMap. </p>
</dd></dl>

<dl class="function">
<dt id="_CPPv2N6paddle8NCELayer14prepareSamplesEv">
<span id="paddle::NCELayer::prepareSamples"></span><span class="target" id="paddleclasspaddle_1_1NCELayer_1af65dda7e3f3b3e1786859072b057daf9"></span>void <code class="descname">prepareSamples</code><span class="sig-paren">(</span><span class="sig-paren">)</span><a class="headerlink" href="#_CPPv2N6paddle8NCELayer14prepareSamplesEv" title="Permalink to this definition">¶</a></dt>
<dd></dd></dl>

<dl class="function">
<dt id="_CPPv2N6paddle8NCELayer8prefetchEv">
7509
<span id="paddle::NCELayer::prefetch"></span><span class="target" id="paddleclasspaddle_1_1NCELayer_1ad6e9275101e24a20431f480cd7066b1f"></span>void <code class="descname">prefetch</code><span class="sig-paren">(</span><span class="sig-paren">)</span><a class="headerlink" href="#_CPPv2N6paddle8NCELayer8prefetchEv" title="Permalink to this definition">¶</a></dt>
Y
Yu Yang 已提交
7510 7511 7512 7513 7514
<dd><p>If use sparse row matrix as parameter, prefetch feature ids in input label. </p>
</dd></dl>

<dl class="function">
<dt id="_CPPv2N6paddle8NCELayer7forwardE8PassType">
7515
<span id="paddle::NCELayer::forward__PassType"></span><span class="target" id="paddleclasspaddle_1_1NCELayer_1ad45bff983d4515def5fd1d4cbdc76a3f"></span>void <code class="descname">forward</code><span class="sig-paren">(</span>PassType <em>passType</em><span class="sig-paren">)</span><a class="headerlink" href="#_CPPv2N6paddle8NCELayer7forwardE8PassType" title="Permalink to this definition">¶</a></dt>
Y
Yu Yang 已提交
7516 7517 7518 7519 7520
<dd><p>Forward propagation. All inherited implementation should call Layer::foward() function. </p>
</dd></dl>

<dl class="function">
<dt id="_CPPv2N6paddle8NCELayer8backwardERK14UpdateCallback">
7521
<span id="paddle::NCELayer::backward__UpdateCallbackCR"></span><span class="target" id="paddleclasspaddle_1_1NCELayer_1a0299a616dc5366e9f617cabe5185c0c0"></span>void <code class="descname">backward</code><span class="sig-paren">(</span><em class="property">const</em> <a class="reference internal" href="../../parameter/parameter/parameter.html#_CPPv2N6paddle14UpdateCallbackE" title="paddle::UpdateCallback">UpdateCallback</a> &amp;<em>callback</em><span class="sig-paren">)</span><a class="headerlink" href="#_CPPv2N6paddle8NCELayer8backwardERK14UpdateCallback" title="Permalink to this definition">¶</a></dt>
7522
<dd><p>Backward propagation. Should only be called after <a class="reference internal" href="#paddleclasspaddle_1_1Layer_1a12386b3f20dd731e7ceaa2c61667cbe1"><span class="std std-ref">Layer::forward()</span></a> function. </p>
Y
Yu Yang 已提交
7523 7524 7525 7526 7527 7528 7529 7530 7531 7532 7533 7534 7535 7536 7537 7538 7539 7540 7541 7542 7543 7544 7545 7546 7547 7548 7549 7550 7551 7552 7553 7554 7555 7556 7557 7558
</dd></dl>

<dl class="function">
<dt id="_CPPv2N6paddle8NCELayer11forwardBiasEv">
<span id="paddle::NCELayer::forwardBias"></span><span class="target" id="paddleclasspaddle_1_1NCELayer_1a6965cbf8726f9b2ec3d6e6d7d3170276"></span>void <code class="descname">forwardBias</code><span class="sig-paren">(</span><span class="sig-paren">)</span><a class="headerlink" href="#_CPPv2N6paddle8NCELayer11forwardBiasEv" title="Permalink to this definition">¶</a></dt>
<dd></dd></dl>

<dl class="function">
<dt id="_CPPv2N6paddle8NCELayer12backwardBiasERK14UpdateCallback">
<span id="paddle::NCELayer::backwardBias__UpdateCallbackCR"></span><span class="target" id="paddleclasspaddle_1_1NCELayer_1afbb2cb42e4fa019ce72c6651f33ddc3e"></span>void <code class="descname">backwardBias</code><span class="sig-paren">(</span><em class="property">const</em> <a class="reference internal" href="../../parameter/parameter/parameter.html#_CPPv2N6paddle14UpdateCallbackE" title="paddle::UpdateCallback">UpdateCallback</a> &amp;<em>callback</em><span class="sig-paren">)</span><a class="headerlink" href="#_CPPv2N6paddle8NCELayer12backwardBiasERK14UpdateCallback" title="Permalink to this definition">¶</a></dt>
<dd></dd></dl>

<dl class="function">
<dt id="_CPPv2N6paddle8NCELayer15forwardOneInputEi">
<span id="paddle::NCELayer::forwardOneInput__i"></span><span class="target" id="paddleclasspaddle_1_1NCELayer_1ae234dd861b3b13e2b1582a8389121c8d"></span>void <code class="descname">forwardOneInput</code><span class="sig-paren">(</span>int <em>layerId</em><span class="sig-paren">)</span><a class="headerlink" href="#_CPPv2N6paddle8NCELayer15forwardOneInputEi" title="Permalink to this definition">¶</a></dt>
<dd></dd></dl>

<dl class="function">
<dt id="_CPPv2N6paddle8NCELayer16backwardOneInputEiRK14UpdateCallback">
<span id="paddle::NCELayer::backwardOneInput__i.UpdateCallbackCR"></span><span class="target" id="paddleclasspaddle_1_1NCELayer_1a15923606caf578ded45cd0d02f4c8a63"></span>void <code class="descname">backwardOneInput</code><span class="sig-paren">(</span>int <em>layerId</em>, <em class="property">const</em> <a class="reference internal" href="../../parameter/parameter/parameter.html#_CPPv2N6paddle14UpdateCallbackE" title="paddle::UpdateCallback">UpdateCallback</a> &amp;<em>callback</em><span class="sig-paren">)</span><a class="headerlink" href="#_CPPv2N6paddle8NCELayer16backwardOneInputEiRK14UpdateCallback" title="Permalink to this definition">¶</a></dt>
<dd></dd></dl>

<dl class="function">
<dt id="_CPPv2N6paddle8NCELayer11forwardCostEv">
<span id="paddle::NCELayer::forwardCost"></span><span class="target" id="paddleclasspaddle_1_1NCELayer_1a9b8b913621ec2eeade0b247fc557de19"></span>void <code class="descname">forwardCost</code><span class="sig-paren">(</span><span class="sig-paren">)</span><a class="headerlink" href="#_CPPv2N6paddle8NCELayer11forwardCostEv" title="Permalink to this definition">¶</a></dt>
<dd></dd></dl>

<dl class="function">
<dt id="_CPPv2N6paddle8NCELayer12backwardCostEv">
<span id="paddle::NCELayer::backwardCost"></span><span class="target" id="paddleclasspaddle_1_1NCELayer_1ac7f9bcd00dea1ce01e984281aae0a4d3"></span>void <code class="descname">backwardCost</code><span class="sig-paren">(</span><span class="sig-paren">)</span><a class="headerlink" href="#_CPPv2N6paddle8NCELayer12backwardCostEv" title="Permalink to this definition">¶</a></dt>
<dd></dd></dl>

</div>
</dd></dl>

</div>
Y
Yu Yang 已提交
7559 7560
<div class="section" id="validation-layers">
<h2>Validation Layers<a class="headerlink" href="#validation-layers" title="Permalink to this headline">¶</a></h2>
Y
Yu Yang 已提交
7561
<div class="section" id="validationlayer">
Y
Yu Yang 已提交
7562
<h3>ValidationLayer<a class="headerlink" href="#validationlayer" title="Permalink to this headline">¶</a></h3>
Y
Yu Yang 已提交
7563 7564 7565
<dl class="class">
<dt id="_CPPv2N6paddle15ValidationLayerE">
<span id="paddle::ValidationLayer"></span><span class="target" id="paddleclasspaddle_1_1ValidationLayer"></span><em class="property">class </em><code class="descclassname">paddle::</code><code class="descname">ValidationLayer</code><a class="headerlink" href="#_CPPv2N6paddle15ValidationLayerE" title="Permalink to this definition">¶</a></dt>
7566 7567
<dd><p>Inherits from <a class="reference internal" href="#paddleclasspaddle_1_1Layer"><span class="std std-ref">paddle::Layer</span></a></p>
<p>Subclassed by <a class="reference internal" href="#paddleclasspaddle_1_1AucValidation"><span class="std std-ref">paddle::AucValidation</span></a>, <a class="reference internal" href="#paddleclasspaddle_1_1PnpairValidation"><span class="std std-ref">paddle::PnpairValidation</span></a></p>
7568
<div class="breathe-sectiondef docutils container">
Y
Yu Yang 已提交
7569 7570 7571 7572 7573 7574 7575 7576
<p class="breathe-sectiondef-title rubric">Public Functions</p>
<dl class="function">
<dt id="_CPPv2N6paddle15ValidationLayer15ValidationLayerERK11LayerConfig">
<span id="paddle::ValidationLayer::ValidationLayer__LayerConfigCR"></span><span class="target" id="paddleclasspaddle_1_1ValidationLayer_1aedf307c0556e4afd0a28a43111fe3c9e"></span><code class="descname">ValidationLayer</code><span class="sig-paren">(</span><em class="property">const</em> LayerConfig &amp;<em>config</em><span class="sig-paren">)</span><a class="headerlink" href="#_CPPv2N6paddle15ValidationLayer15ValidationLayerERK11LayerConfig" title="Permalink to this definition">¶</a></dt>
<dd></dd></dl>

<dl class="function">
<dt id="_CPPv2N6paddle15ValidationLayer4initERK8LayerMapRK12ParameterMap">
7577
<span id="paddle::ValidationLayer::init__LayerMapCR.ParameterMapCR"></span><span class="target" id="paddleclasspaddle_1_1ValidationLayer_1aa4c11d986c693c51c4d830795688de6c"></span>bool <code class="descname">init</code><span class="sig-paren">(</span><em class="property">const</em> LayerMap &amp;<em>layerMap</em>, <em class="property">const</em> <a class="reference internal" href="../../parameter/parameter/parameter.html#_CPPv2N6paddle12ParameterMapE" title="paddle::ParameterMap">ParameterMap</a> &amp;<em>parameterMap</em><span class="sig-paren">)</span><a class="headerlink" href="#_CPPv2N6paddle15ValidationLayer4initERK8LayerMapRK12ParameterMap" title="Permalink to this definition">¶</a></dt>
Y
Yu Yang 已提交
7578 7579 7580 7581 7582 7583 7584 7585 7586 7587 7588 7589 7590 7591 7592 7593 7594 7595 7596 7597
<dd><p>Intialization. For example, adding input layers from layerMap and parameterMap. </p>
</dd></dl>

<dl class="function">
<dt id="_CPPv2N6paddle15ValidationLayer14getOutputLayerEv">
<span id="paddle::ValidationLayer::getOutputLayer"></span><span class="target" id="paddleclasspaddle_1_1ValidationLayer_1ae78adbac2f398ee80073e7af4ad7d867"></span>LayerPtr <code class="descname">getOutputLayer</code><span class="sig-paren">(</span><span class="sig-paren">)</span><a class="headerlink" href="#_CPPv2N6paddle15ValidationLayer14getOutputLayerEv" title="Permalink to this definition">¶</a></dt>
<dd></dd></dl>

<dl class="function">
<dt id="_CPPv2N6paddle15ValidationLayer13getLabelLayerEv">
<span id="paddle::ValidationLayer::getLabelLayer"></span><span class="target" id="paddleclasspaddle_1_1ValidationLayer_1a7fdd92735bba6cf128dd79dd9b93717e"></span>LayerPtr <code class="descname">getLabelLayer</code><span class="sig-paren">(</span><span class="sig-paren">)</span><a class="headerlink" href="#_CPPv2N6paddle15ValidationLayer13getLabelLayerEv" title="Permalink to this definition">¶</a></dt>
<dd></dd></dl>

<dl class="function">
<dt id="_CPPv2N6paddle15ValidationLayer12getInfoLayerEv">
<span id="paddle::ValidationLayer::getInfoLayer"></span><span class="target" id="paddleclasspaddle_1_1ValidationLayer_1a019ed57b04d3672ea5a66e07158f7be4"></span>LayerPtr <code class="descname">getInfoLayer</code><span class="sig-paren">(</span><span class="sig-paren">)</span><a class="headerlink" href="#_CPPv2N6paddle15ValidationLayer12getInfoLayerEv" title="Permalink to this definition">¶</a></dt>
<dd></dd></dl>

<dl class="function">
<dt id="_CPPv2N6paddle15ValidationLayer7forwardE8PassType">
7598
<span id="paddle::ValidationLayer::forward__PassType"></span><span class="target" id="paddleclasspaddle_1_1ValidationLayer_1a525cd5c93fc409afa6ffc1790cf1ce02"></span>void <code class="descname">forward</code><span class="sig-paren">(</span>PassType <em>passType</em><span class="sig-paren">)</span><a class="headerlink" href="#_CPPv2N6paddle15ValidationLayer7forwardE8PassType" title="Permalink to this definition">¶</a></dt>
Y
Yu Yang 已提交
7599 7600 7601 7602 7603
<dd><p>Forward propagation. All inherited implementation should call Layer::foward() function. </p>
</dd></dl>

<dl class="function">
<dt id="_CPPv2N6paddle15ValidationLayer8backwardERK14UpdateCallback">
7604
<span id="paddle::ValidationLayer::backward__UpdateCallbackCR"></span><span class="target" id="paddleclasspaddle_1_1ValidationLayer_1a69cbbf4de1075cdcf0a25276c2cc2a76"></span>void <code class="descname">backward</code><span class="sig-paren">(</span><em class="property">const</em> <a class="reference internal" href="../../parameter/parameter/parameter.html#_CPPv2N6paddle14UpdateCallbackE" title="paddle::UpdateCallback">UpdateCallback</a> &amp;<em>callback</em> = nullptr<span class="sig-paren">)</span><a class="headerlink" href="#_CPPv2N6paddle15ValidationLayer8backwardERK14UpdateCallback" title="Permalink to this definition">¶</a></dt>
7605
<dd><p>Backward propagation. Should only be called after <a class="reference internal" href="#paddleclasspaddle_1_1Layer_1a12386b3f20dd731e7ceaa2c61667cbe1"><span class="std std-ref">Layer::forward()</span></a> function. </p>
Y
Yu Yang 已提交
7606 7607 7608 7609
</dd></dl>

<dl class="function">
<dt id="_CPPv2N6paddle15ValidationLayer13validationImpE9MatrixPtr10IVectorPtr">
7610
<span id="paddle::ValidationLayer::validationImp__MatrixPtr.IVectorPtr"></span><span class="target" id="paddleclasspaddle_1_1ValidationLayer_1adbb575f2ac7969ee0b5a1eb06a2a85fb"></span><em class="property">virtual</em> void <code class="descname">validationImp</code><span class="sig-paren">(</span><a class="reference internal" href="../../math/matrix/matrix.html#_CPPv2N6paddle9MatrixPtrE" title="paddle::MatrixPtr">MatrixPtr</a> <em>outputValue</em>, <a class="reference internal" href="../../math/matrix/matrix.html#_CPPv2N6paddle10IVectorPtrE" title="paddle::IVectorPtr">IVectorPtr</a> <em>label</em><span class="sig-paren">)</span> = 0<a class="headerlink" href="#_CPPv2N6paddle15ValidationLayer13validationImpE9MatrixPtr10IVectorPtr" title="Permalink to this definition">¶</a></dt>
Y
Yu Yang 已提交
7611 7612 7613 7614
<dd></dd></dl>

<dl class="function">
<dt id="_CPPv2N6paddle15ValidationLayer9onPassEndEv">
7615
<span id="paddle::ValidationLayer::onPassEnd"></span><span class="target" id="paddleclasspaddle_1_1ValidationLayer_1a2ebcb9d6396c441ce5f38b09ad169812"></span><em class="property">virtual</em> void <code class="descname">onPassEnd</code><span class="sig-paren">(</span><span class="sig-paren">)</span> = 0<a class="headerlink" href="#_CPPv2N6paddle15ValidationLayer9onPassEndEv" title="Permalink to this definition">¶</a></dt>
Y
Yu Yang 已提交
7616 7617 7618 7619 7620 7621
<dd><p>One pass is finished. </p>
</dd></dl>

</div>
</dd></dl>

Y
Yu Yang 已提交
7622 7623 7624 7625 7626 7627
</div>
<div class="section" id="aucvalidation">
<h3>AucValidation<a class="headerlink" href="#aucvalidation" title="Permalink to this headline">¶</a></h3>
<dl class="class">
<dt id="_CPPv2N6paddle13AucValidationE">
<span id="paddle::AucValidation"></span><span class="target" id="paddleclasspaddle_1_1AucValidation"></span><em class="property">class </em><code class="descclassname">paddle::</code><code class="descname">AucValidation</code><a class="headerlink" href="#_CPPv2N6paddle13AucValidationE" title="Permalink to this definition">¶</a></dt>
7628
<dd><p>Inherits from <a class="reference internal" href="#paddleclasspaddle_1_1ValidationLayer"><span class="std std-ref">paddle::ValidationLayer</span></a></p>
7629
<div class="breathe-sectiondef docutils container">
Y
Yu Yang 已提交
7630 7631 7632 7633 7634 7635 7636 7637
<p class="breathe-sectiondef-title rubric">Public Functions</p>
<dl class="function">
<dt id="_CPPv2N6paddle13AucValidation13AucValidationERK11LayerConfig">
<span id="paddle::AucValidation::AucValidation__LayerConfigCR"></span><span class="target" id="paddleclasspaddle_1_1AucValidation_1afc8ee436b2906dc3bec4950197a40e79"></span><code class="descname">AucValidation</code><span class="sig-paren">(</span><em class="property">const</em> LayerConfig &amp;<em>config</em><span class="sig-paren">)</span><a class="headerlink" href="#_CPPv2N6paddle13AucValidation13AucValidationERK11LayerConfig" title="Permalink to this definition">¶</a></dt>
<dd></dd></dl>

<dl class="function">
<dt id="_CPPv2N6paddle13AucValidation4initERK8LayerMapRK12ParameterMap">
7638
<span id="paddle::AucValidation::init__LayerMapCR.ParameterMapCR"></span><span class="target" id="paddleclasspaddle_1_1AucValidation_1a8d1985b739e28ee3b4e3a905243fcf61"></span>bool <code class="descname">init</code><span class="sig-paren">(</span><em class="property">const</em> LayerMap &amp;<em>layerMap</em>, <em class="property">const</em> <a class="reference internal" href="../../parameter/parameter/parameter.html#_CPPv2N6paddle12ParameterMapE" title="paddle::ParameterMap">ParameterMap</a> &amp;<em>parameterMap</em><span class="sig-paren">)</span><a class="headerlink" href="#_CPPv2N6paddle13AucValidation4initERK8LayerMapRK12ParameterMap" title="Permalink to this definition">¶</a></dt>
Y
Yu Yang 已提交
7639 7640 7641 7642 7643
<dd><p>Intialization. For example, adding input layers from layerMap and parameterMap. </p>
</dd></dl>

<dl class="function">
<dt id="_CPPv2N6paddle13AucValidation13validationImpE9MatrixPtr10IVectorPtr">
7644
<span id="paddle::AucValidation::validationImp__MatrixPtr.IVectorPtr"></span><span class="target" id="paddleclasspaddle_1_1AucValidation_1a3b7ed03093fd82f7418fb36175709a56"></span>void <code class="descname">validationImp</code><span class="sig-paren">(</span><a class="reference internal" href="../../math/matrix/matrix.html#_CPPv2N6paddle9MatrixPtrE" title="paddle::MatrixPtr">MatrixPtr</a> <em>outputValue</em>, <a class="reference internal" href="../../math/matrix/matrix.html#_CPPv2N6paddle10IVectorPtrE" title="paddle::IVectorPtr">IVectorPtr</a> <em>label</em><span class="sig-paren">)</span><a class="headerlink" href="#_CPPv2N6paddle13AucValidation13validationImpE9MatrixPtr10IVectorPtr" title="Permalink to this definition">¶</a></dt>
Y
Yu Yang 已提交
7645 7646 7647 7648
<dd></dd></dl>

<dl class="function">
<dt id="_CPPv2N6paddle13AucValidation9onPassEndEv">
7649
<span id="paddle::AucValidation::onPassEnd"></span><span class="target" id="paddleclasspaddle_1_1AucValidation_1ab5c33c98be49d4593618c7876d51fe97"></span>void <code class="descname">onPassEnd</code><span class="sig-paren">(</span><span class="sig-paren">)</span><a class="headerlink" href="#_CPPv2N6paddle13AucValidation9onPassEndEv" title="Permalink to this definition">¶</a></dt>
Y
Yu Yang 已提交
7650 7651 7652 7653
<dd><p>One pass is finished. </p>
</dd></dl>

</div>
7654
<div class="breathe-sectiondef docutils container">
Y
Yu Yang 已提交
7655 7656 7657 7658 7659 7660 7661 7662 7663 7664
<p class="breathe-sectiondef-title rubric">Public Members</p>
<dl class="member">
<dt id="_CPPv2N6paddle13AucValidation13predictArray_E">
<span id="paddle::AucValidation::predictArray___std::vector:PredictionResult:"></span><span class="target" id="paddleclasspaddle_1_1AucValidation_1a34c92bca07cb73f2691b79bd7c938004"></span>std::vector&lt;<a class="reference internal" href="#_CPPv2N6paddle13AucValidation16PredictionResultE" title="paddle::AucValidation::PredictionResult">PredictionResult</a>&gt; <code class="descname">predictArray_</code><a class="headerlink" href="#_CPPv2N6paddle13AucValidation13predictArray_E" title="Permalink to this definition">¶</a></dt>
<dd></dd></dl>

</div>
<dl class="class">
<dt id="_CPPv2N6paddle13AucValidation16PredictionResultE">
<span id="paddle::AucValidation::PredictionResult"></span><span class="target" id="paddlestructpaddle_1_1AucValidation_1_1PredictionResult"></span><em class="property">struct </em><code class="descname">PredictionResult</code><a class="headerlink" href="#_CPPv2N6paddle13AucValidation16PredictionResultE" title="Permalink to this definition">¶</a></dt>
7665
<dd><div class="breathe-sectiondef docutils container">
Y
Yu Yang 已提交
7666 7667 7668 7669 7670 7671 7672
<p class="breathe-sectiondef-title rubric">Public Functions</p>
<dl class="function">
<dt id="_CPPv2N6paddle13AucValidation16PredictionResult16PredictionResultE4reali">
<span id="paddle::AucValidation::PredictionResult::PredictionResult__real.i"></span><span class="target" id="paddlestructpaddle_1_1AucValidation_1_1PredictionResult_1ae27289cfc875cf96c89ae25823281942"></span><code class="descname">PredictionResult</code><span class="sig-paren">(</span>real <em>__out</em>, int <em>__label</em><span class="sig-paren">)</span><a class="headerlink" href="#_CPPv2N6paddle13AucValidation16PredictionResult16PredictionResultE4reali" title="Permalink to this definition">¶</a></dt>
<dd></dd></dl>

</div>
7673
<div class="breathe-sectiondef docutils container">
Y
Yu Yang 已提交
7674 7675 7676 7677 7678 7679 7680 7681 7682 7683 7684 7685 7686 7687 7688 7689 7690 7691 7692 7693 7694 7695
<p class="breathe-sectiondef-title rubric">Public Members</p>
<dl class="member">
<dt id="_CPPv2N6paddle13AucValidation16PredictionResult3outE">
<span id="paddle::AucValidation::PredictionResult::out__real"></span><span class="target" id="paddlestructpaddle_1_1AucValidation_1_1PredictionResult_1a2f138da3c004dd5d647ec5efc2b913a4"></span>real <code class="descname">out</code><a class="headerlink" href="#_CPPv2N6paddle13AucValidation16PredictionResult3outE" title="Permalink to this definition">¶</a></dt>
<dd></dd></dl>

<dl class="member">
<dt id="_CPPv2N6paddle13AucValidation16PredictionResult5labelE">
<span id="paddle::AucValidation::PredictionResult::label__i"></span><span class="target" id="paddlestructpaddle_1_1AucValidation_1_1PredictionResult_1af72ed4c24e02153e632fc20aca97c0e7"></span>int <code class="descname">label</code><a class="headerlink" href="#_CPPv2N6paddle13AucValidation16PredictionResult5labelE" title="Permalink to this definition">¶</a></dt>
<dd></dd></dl>

</div>
</dd></dl>

</dd></dl>

</div>
<div class="section" id="pnpairvalidation">
<h3>PnpairValidation<a class="headerlink" href="#pnpairvalidation" title="Permalink to this headline">¶</a></h3>
<dl class="class">
<dt id="_CPPv2N6paddle16PnpairValidationE">
<span id="paddle::PnpairValidation"></span><span class="target" id="paddleclasspaddle_1_1PnpairValidation"></span><em class="property">class </em><code class="descclassname">paddle::</code><code class="descname">PnpairValidation</code><a class="headerlink" href="#_CPPv2N6paddle16PnpairValidationE" title="Permalink to this definition">¶</a></dt>
7696
<dd><p>Inherits from <a class="reference internal" href="#paddleclasspaddle_1_1ValidationLayer"><span class="std std-ref">paddle::ValidationLayer</span></a></p>
7697
<div class="breathe-sectiondef docutils container">
Y
Yu Yang 已提交
7698 7699 7700 7701 7702 7703 7704 7705
<p class="breathe-sectiondef-title rubric">Public Functions</p>
<dl class="function">
<dt id="_CPPv2N6paddle16PnpairValidation16PnpairValidationERK11LayerConfig">
<span id="paddle::PnpairValidation::PnpairValidation__LayerConfigCR"></span><span class="target" id="paddleclasspaddle_1_1PnpairValidation_1a59e70ed9fcf8576cabf3c9567ed3ec4b"></span><code class="descname">PnpairValidation</code><span class="sig-paren">(</span><em class="property">const</em> LayerConfig &amp;<em>config</em><span class="sig-paren">)</span><a class="headerlink" href="#_CPPv2N6paddle16PnpairValidation16PnpairValidationERK11LayerConfig" title="Permalink to this definition">¶</a></dt>
<dd></dd></dl>

<dl class="function">
<dt id="_CPPv2N6paddle16PnpairValidation4initERK8LayerMapRK12ParameterMap">
7706
<span id="paddle::PnpairValidation::init__LayerMapCR.ParameterMapCR"></span><span class="target" id="paddleclasspaddle_1_1PnpairValidation_1a22a5060a3195cab77d10935bb947c23c"></span>bool <code class="descname">init</code><span class="sig-paren">(</span><em class="property">const</em> LayerMap &amp;<em>layerMap</em>, <em class="property">const</em> <a class="reference internal" href="../../parameter/parameter/parameter.html#_CPPv2N6paddle12ParameterMapE" title="paddle::ParameterMap">ParameterMap</a> &amp;<em>parameterMap</em><span class="sig-paren">)</span><a class="headerlink" href="#_CPPv2N6paddle16PnpairValidation4initERK8LayerMapRK12ParameterMap" title="Permalink to this definition">¶</a></dt>
Y
Yu Yang 已提交
7707 7708 7709 7710 7711
<dd><p>Intialization. For example, adding input layers from layerMap and parameterMap. </p>
</dd></dl>

<dl class="function">
<dt id="_CPPv2N6paddle16PnpairValidation13validationImpE9MatrixPtr10IVectorPtr">
7712
<span id="paddle::PnpairValidation::validationImp__MatrixPtr.IVectorPtr"></span><span class="target" id="paddleclasspaddle_1_1PnpairValidation_1a5188effac9380869ce4fa4255201f2e0"></span>void <code class="descname">validationImp</code><span class="sig-paren">(</span><a class="reference internal" href="../../math/matrix/matrix.html#_CPPv2N6paddle9MatrixPtrE" title="paddle::MatrixPtr">MatrixPtr</a> <em>outputValue</em>, <a class="reference internal" href="../../math/matrix/matrix.html#_CPPv2N6paddle10IVectorPtrE" title="paddle::IVectorPtr">IVectorPtr</a> <em>label</em><span class="sig-paren">)</span><a class="headerlink" href="#_CPPv2N6paddle16PnpairValidation13validationImpE9MatrixPtr10IVectorPtr" title="Permalink to this definition">¶</a></dt>
Y
Yu Yang 已提交
7713 7714 7715 7716
<dd></dd></dl>

<dl class="function">
<dt id="_CPPv2N6paddle16PnpairValidation9onPassEndEv">
7717
<span id="paddle::PnpairValidation::onPassEnd"></span><span class="target" id="paddleclasspaddle_1_1PnpairValidation_1ab31aac8c054509be90377232ffe1321e"></span>void <code class="descname">onPassEnd</code><span class="sig-paren">(</span><span class="sig-paren">)</span><a class="headerlink" href="#_CPPv2N6paddle16PnpairValidation9onPassEndEv" title="Permalink to this definition">¶</a></dt>
Y
Yu Yang 已提交
7718 7719 7720 7721 7722 7723 7724
<dd><p>One pass is finished. </p>
</dd></dl>

</div>
</dd></dl>

</div>
Y
Yu Yang 已提交
7725 7726 7727 7728 7729 7730 7731 7732 7733 7734 7735 7736 7737 7738
</div>
</div>
<div class="section" id="check-layers">
<h1>Check Layers<a class="headerlink" href="#check-layers" title="Permalink to this headline">¶</a></h1>
<div class="section" id="eosidchecklayer">
<h2>EosIdCheckLayer<a class="headerlink" href="#eosidchecklayer" title="Permalink to this headline">¶</a></h2>
<dl class="class">
<dt id="_CPPv2N6paddle15EosIdCheckLayerE">
<span id="paddle::EosIdCheckLayer"></span><span class="target" id="paddleclasspaddle_1_1EosIdCheckLayer"></span><em class="property">class </em><code class="descclassname">paddle::</code><code class="descname">EosIdCheckLayer</code><a class="headerlink" href="#_CPPv2N6paddle15EosIdCheckLayerE" title="Permalink to this definition">¶</a></dt>
<dd><p>A layer for checking EOS for each sample:<ul class="simple">
<li>output_id = (input_id == conf.eos_id)</li>
</ul>
</p>
<p>The result is stored in output_.ids. It is used by recurrent layer group. </p>
7739
<p>Inherits from <a class="reference internal" href="#paddleclasspaddle_1_1Layer"><span class="std std-ref">paddle::Layer</span></a></p>
7740
<div class="breathe-sectiondef docutils container">
Y
Yu Yang 已提交
7741 7742 7743 7744 7745 7746 7747 7748
<p class="breathe-sectiondef-title rubric">Public Functions</p>
<dl class="function">
<dt id="_CPPv2N6paddle15EosIdCheckLayer15EosIdCheckLayerERK11LayerConfig">
<span id="paddle::EosIdCheckLayer::EosIdCheckLayer__LayerConfigCR"></span><span class="target" id="paddleclasspaddle_1_1EosIdCheckLayer_1ac90fa6d4d6cc152ac76109f6d5c9f84f"></span><code class="descname">EosIdCheckLayer</code><span class="sig-paren">(</span><em class="property">const</em> LayerConfig &amp;<em>config</em><span class="sig-paren">)</span><a class="headerlink" href="#_CPPv2N6paddle15EosIdCheckLayer15EosIdCheckLayerERK11LayerConfig" title="Permalink to this definition">¶</a></dt>
<dd></dd></dl>

<dl class="function">
<dt id="_CPPv2N6paddle15EosIdCheckLayer4initERK8LayerMapRK12ParameterMap">
7749
<span id="paddle::EosIdCheckLayer::init__LayerMapCR.ParameterMapCR"></span><span class="target" id="paddleclasspaddle_1_1EosIdCheckLayer_1a1a402b9dedcffaf22252d741190271fa"></span><em class="property">virtual</em> bool <code class="descname">init</code><span class="sig-paren">(</span><em class="property">const</em> LayerMap &amp;<em>layerMap</em>, <em class="property">const</em> <a class="reference internal" href="../../parameter/parameter/parameter.html#_CPPv2N6paddle12ParameterMapE" title="paddle::ParameterMap">ParameterMap</a> &amp;<em>parameterMap</em><span class="sig-paren">)</span><a class="headerlink" href="#_CPPv2N6paddle15EosIdCheckLayer4initERK8LayerMapRK12ParameterMap" title="Permalink to this definition">¶</a></dt>
Y
Yu Yang 已提交
7750 7751 7752 7753 7754
<dd><p>Intialization. For example, adding input layers from layerMap and parameterMap. </p>
</dd></dl>

<dl class="function">
<dt id="_CPPv2N6paddle15EosIdCheckLayer7forwardE8PassType">
7755
<span id="paddle::EosIdCheckLayer::forward__PassType"></span><span class="target" id="paddleclasspaddle_1_1EosIdCheckLayer_1a72fdacc24a2061fcdb79a252a2498841"></span><em class="property">virtual</em> void <code class="descname">forward</code><span class="sig-paren">(</span>PassType <em>passType</em><span class="sig-paren">)</span><a class="headerlink" href="#_CPPv2N6paddle15EosIdCheckLayer7forwardE8PassType" title="Permalink to this definition">¶</a></dt>
Y
Yu Yang 已提交
7756 7757 7758 7759 7760
<dd><p>Forward propagation. All inherited implementation should call Layer::foward() function. </p>
</dd></dl>

<dl class="function">
<dt id="_CPPv2N6paddle15EosIdCheckLayer8backwardERK14UpdateCallback">
7761
<span id="paddle::EosIdCheckLayer::backward__UpdateCallbackCR"></span><span class="target" id="paddleclasspaddle_1_1EosIdCheckLayer_1ae642cedbb53784916e0242ef0db8e1a7"></span><em class="property">virtual</em> void <code class="descname">backward</code><span class="sig-paren">(</span><em class="property">const</em> <a class="reference internal" href="../../parameter/parameter/parameter.html#_CPPv2N6paddle14UpdateCallbackE" title="paddle::UpdateCallback">UpdateCallback</a> &amp;<em>callback</em><span class="sig-paren">)</span><a class="headerlink" href="#_CPPv2N6paddle15EosIdCheckLayer8backwardERK14UpdateCallback" title="Permalink to this definition">¶</a></dt>
7762
<dd><p>Backward propagation. Should only be called after <a class="reference internal" href="#paddleclasspaddle_1_1Layer_1a12386b3f20dd731e7ceaa2c61667cbe1"><span class="std std-ref">Layer::forward()</span></a> function. </p>
Y
Yu Yang 已提交
7763 7764 7765 7766 7767 7768 7769 7770 7771 7772 7773 7774 7775 7776 7777 7778 7779 7780 7781 7782 7783 7784 7785 7786 7787 7788 7789 7790 7791 7792 7793 7794 7795 7796 7797 7798 7799 7800 7801 7802 7803 7804 7805 7806 7807 7808 7809 7810 7811 7812 7813 7814 7815 7816 7817 7818 7819 7820 7821 7822 7823 7824 7825 7826 7827 7828 7829 7830 7831 7832 7833 7834 7835 7836 7837 7838 7839 7840 7841 7842 7843 7844 7845 7846 7847 7848 7849 7850 7851 7852 7853 7854 7855 7856 7857 7858 7859 7860 7861 7862 7863 7864 7865 7866 7867 7868 7869 7870 7871 7872 7873 7874 7875 7876 7877 7878 7879 7880 7881 7882 7883 7884 7885 7886 7887 7888 7889 7890 7891 7892 7893 7894 7895 7896 7897 7898 7899 7900 7901 7902 7903 7904 7905 7906 7907 7908 7909 7910 7911 7912 7913 7914 7915 7916 7917 7918
</dd></dl>

</div>
</dd></dl>

</div>
</div>


          </div>
        </div>
      </div>
      <div class="sphinxsidebar" role="navigation" aria-label="main navigation">
        <div class="sphinxsidebarwrapper">
  <h3><a href="../../../index.html">Table Of Contents</a></h3>
  <ul>
<li><a class="reference internal" href="#">Base</a><ul>
<li><a class="reference internal" href="#layer">Layer</a></li>
<li><a class="reference internal" href="#projection">Projection</a></li>
<li><a class="reference internal" href="#operator">Operator</a></li>
</ul>
</li>
<li><a class="reference internal" href="#data-layer">Data Layer</a></li>
<li><a class="reference internal" href="#fully-connected-layers">Fully Connected Layers</a><ul>
<li><a class="reference internal" href="#fullyconnectedlayer">FullyConnectedLayer</a></li>
<li><a class="reference internal" href="#selectivefullyconnectedlayer">SelectiveFullyConnectedLayer</a></li>
</ul>
</li>
<li><a class="reference internal" href="#conv-layers">Conv Layers</a><ul>
<li><a class="reference internal" href="#convbaselayer">ConvBaseLayer</a></li>
<li><a class="reference internal" href="#convoperator">ConvOperator</a></li>
<li><a class="reference internal" href="#convshiftlayer">ConvShiftLayer</a></li>
<li><a class="reference internal" href="#cudnnconvlayer">CudnnConvLayer</a></li>
<li><a class="reference internal" href="#expandconvlayer">ExpandConvLayer</a></li>
<li><a class="reference internal" href="#contextprojection">ContextProjection</a></li>
</ul>
</li>
<li><a class="reference internal" href="#pooling-layers">Pooling Layers</a><ul>
<li><a class="reference internal" href="#poollayer">PoolLayer</a></li>
<li><a class="reference internal" href="#poolprojectionlayer">PoolProjectionLayer</a></li>
<li><a class="reference internal" href="#cudnnpoollayer">CudnnPoolLayer</a></li>
</ul>
</li>
<li><a class="reference internal" href="#norm-layers">Norm Layers</a><ul>
<li><a class="reference internal" href="#normlayer">NormLayer</a></li>
<li><a class="reference internal" href="#cmrprojectionnormlayer">CMRProjectionNormLayer</a></li>
<li><a class="reference internal" href="#datanormlayer">DataNormLayer</a></li>
<li><a class="reference internal" href="#responsenormlayer">ResponseNormLayer</a></li>
<li><a class="reference internal" href="#batchnormbaselayer">BatchNormBaseLayer</a></li>
<li><a class="reference internal" href="#batchnormalizationlayer">BatchNormalizationLayer</a></li>
<li><a class="reference internal" href="#cudnnbatchnormlayer">CudnnBatchNormLayer</a></li>
<li><a class="reference internal" href="#sumtoonenormlayer">SumToOneNormLayer</a></li>
</ul>
</li>
<li><a class="reference internal" href="#activation-layer">Activation Layer</a><ul>
<li><a class="reference internal" href="#parameterrelulayer">ParameterReluLayer</a></li>
</ul>
</li>
<li><a class="reference internal" href="#recurrent-layers">Recurrent Layers</a><ul>
<li><a class="reference internal" href="#recurrentlayer">RecurrentLayer</a></li>
<li><a class="reference internal" href="#sequencetobatch">SequenceToBatch</a></li>
<li><a class="reference internal" href="#lstm">LSTM</a><ul>
<li><a class="reference internal" href="#lstmlayer">LstmLayer</a></li>
<li><a class="reference internal" href="#lstmsteplayer">LstmStepLayer</a></li>
<li><a class="reference internal" href="#lstmcompute">LstmCompute</a></li>
</ul>
</li>
<li><a class="reference internal" href="#mdlstm">MDLSTM</a><ul>
<li><a class="reference internal" href="#mdlstmlayer">MDLstmLayer</a></li>
<li><a class="reference internal" href="#coorditerator">CoordIterator</a></li>
</ul>
</li>
<li><a class="reference internal" href="#gru">GRU</a><ul>
<li><a class="reference internal" href="#gatedrecurrentlayer">GatedRecurrentLayer</a></li>
<li><a class="reference internal" href="#grusteplayer">GruStepLayer</a></li>
<li><a class="reference internal" href="#grucompute">GruCompute</a></li>
</ul>
</li>
</ul>
</li>
<li><a class="reference internal" href="#recurrent-layer-group">Recurrent Layer Group</a><ul>
<li><a class="reference internal" href="#agentlayer">AgentLayer</a></li>
<li><a class="reference internal" href="#sequenceagentlayer">SequenceAgentLayer</a></li>
<li><a class="reference internal" href="#gatheragentlayer">GatherAgentLayer</a></li>
<li><a class="reference internal" href="#sequencegatheragentlayer">SequenceGatherAgentLayer</a></li>
<li><a class="reference internal" href="#scatteragentlayer">ScatterAgentLayer</a></li>
<li><a class="reference internal" href="#sequencescatteragentlayer">SequenceScatterAgentLayer</a></li>
<li><a class="reference internal" href="#getoutputlayer">GetOutputLayer</a></li>
</ul>
</li>
<li><a class="reference internal" href="#mixed-layer">Mixed Layer</a><ul>
<li><a class="reference internal" href="#dotmulprojection">DotMulProjection</a></li>
<li><a class="reference internal" href="#dotmuloperator">DotMulOperator</a></li>
<li><a class="reference internal" href="#fullmatrixprojection">FullMatrixProjection</a></li>
<li><a class="reference internal" href="#identityprojection">IdentityProjection</a></li>
<li><a class="reference internal" href="#identityoffsetprojection">IdentityOffsetProjection</a></li>
<li><a class="reference internal" href="#tableprojection">TableProjection</a></li>
<li><a class="reference internal" href="#transposedfullmatrixprojection">TransposedFullMatrixProjection</a></li>
</ul>
</li>
<li><a class="reference internal" href="#aggregate-layers">Aggregate Layers</a><ul>
<li><a class="reference internal" href="#aggregate">Aggregate</a><ul>
<li><a class="reference internal" href="#averagelayer">AverageLayer</a></li>
<li><a class="reference internal" href="#maxlayer">MaxLayer</a></li>
<li><a class="reference internal" href="#sequencelastinstancelayer">SequenceLastInstanceLayer</a></li>
</ul>
</li>
<li><a class="reference internal" href="#concat">Concat</a><ul>
<li><a class="reference internal" href="#concatenatelayer">ConcatenateLayer</a></li>
<li><a class="reference internal" href="#concatenatelayer2">ConcatenateLayer2</a></li>
<li><a class="reference internal" href="#sequenceconcatlayer">SequenceConcatLayer</a></li>
</ul>
</li>
<li><a class="reference internal" href="#subset">Subset</a><ul>
<li><a class="reference internal" href="#subsequencelayer">SubSequenceLayer</a></li>
</ul>
</li>
</ul>
</li>
<li><a class="reference internal" href="#reshaping-layers">Reshaping Layers</a><ul>
<li><a class="reference internal" href="#blockexpandlayer">BlockExpandLayer</a></li>
<li><a class="reference internal" href="#expandlayer">ExpandLayer</a></li>
<li><a class="reference internal" href="#featuremapexpandlayer">FeatureMapExpandLayer</a></li>
<li><a class="reference internal" href="#resizelayer">ResizeLayer</a></li>
<li><a class="reference internal" href="#sequencereshapelayer">SequenceReshapeLayer</a></li>
</ul>
</li>
<li><a class="reference internal" href="#math-layers">Math Layers</a><ul>
<li><a class="reference internal" href="#addtolayer">AddtoLayer</a></li>
<li><a class="reference internal" href="#convexcombinationlayer">ConvexCombinationLayer</a></li>
<li><a class="reference internal" href="#interpolationlayer">InterpolationLayer</a></li>
<li><a class="reference internal" href="#multiplexlayer">MultiplexLayer</a></li>
<li><a class="reference internal" href="#outerprodlayer">OuterProdLayer</a></li>
<li><a class="reference internal" href="#powerlayer">PowerLayer</a></li>
<li><a class="reference internal" href="#scalinglayer">ScalingLayer</a></li>
<li><a class="reference internal" href="#slopeinterceptlayer">SlopeInterceptLayer</a></li>
<li><a class="reference internal" href="#tensorlayer">TensorLayer</a></li>
<li><a class="reference internal" href="#translayer">TransLayer</a></li>
</ul>
</li>
<li><a class="reference internal" href="#sampling-layers">Sampling Layers</a><ul>
<li><a class="reference internal" href="#multinomialsampler">MultinomialSampler</a></li>
<li><a class="reference internal" href="#maxidlayer">MaxIdLayer</a></li>
<li><a class="reference internal" href="#samplingidlayer">SamplingIdLayer</a></li>
</ul>
</li>
<li><a class="reference internal" href="#cost-layers">Cost Layers</a><ul>
<li><a class="reference internal" href="#costlayer">CostLayer</a><ul>
<li><a class="reference internal" href="#hubertwoclass">HuberTwoClass</a></li>
<li><a class="reference internal" href="#lambdacost">LambdaCost</a></li>
<li><a class="reference internal" href="#multibinarylabelcrossentropy">MultiBinaryLabelCrossEntropy</a></li>
<li><a class="reference internal" href="#multiclasscrossentropy">MultiClassCrossEntropy</a></li>
<li><a class="reference internal" href="#multiclasscrossentropywithselfnorm">MultiClassCrossEntropyWithSelfNorm</a></li>
<li><a class="reference internal" href="#rankingcost">RankingCost</a></li>
<li><a class="reference internal" href="#softbinaryclasscrossentropy">SoftBinaryClassCrossEntropy</a></li>
<li><a class="reference internal" href="#sumofsquarescostlayer">SumOfSquaresCostLayer</a></li>
7919
<li><a class="reference internal" href="#sumcostlayer">SumCostLayer</a></li>
Y
Yu Yang 已提交
7920 7921 7922 7923 7924 7925 7926 7927 7928 7929 7930
</ul>
</li>
<li><a class="reference internal" href="#cossimlayer">CosSimLayer</a></li>
<li><a class="reference internal" href="#cossimvecmatlayer">CosSimVecMatLayer</a></li>
<li><a class="reference internal" href="#crfdecodinglayer">CRFDecodingLayer</a></li>
<li><a class="reference internal" href="#crflayer">CRFLayer</a></li>
<li><a class="reference internal" href="#ctclayer">CTCLayer</a></li>
<li><a class="reference internal" href="#hierarchicalsigmoidlayer">HierarchicalSigmoidLayer</a></li>
<li><a class="reference internal" href="#linearchaincrf">LinearChainCRF</a></li>
<li><a class="reference internal" href="#linearchainctc">LinearChainCTC</a></li>
<li><a class="reference internal" href="#ncelayer">NCELayer</a></li>
Y
Yu Yang 已提交
7931
<li><a class="reference internal" href="#validation-layers">Validation Layers</a><ul>
Y
Yu Yang 已提交
7932
<li><a class="reference internal" href="#validationlayer">ValidationLayer</a></li>
Y
Yu Yang 已提交
7933 7934 7935 7936
<li><a class="reference internal" href="#aucvalidation">AucValidation</a></li>
<li><a class="reference internal" href="#pnpairvalidation">PnpairValidation</a></li>
</ul>
</li>
Y
Yu Yang 已提交
7937 7938 7939 7940 7941 7942 7943 7944 7945 7946 7947 7948
</ul>
</li>
<li><a class="reference internal" href="#check-layers">Check Layers</a><ul>
<li><a class="reference internal" href="#eosidchecklayer">EosIdCheckLayer</a></li>
</ul>
</li>
</ul>

  <h4>Previous topic</h4>
  <p class="topless"><a href="index.html"
                        title="previous chapter">Layers Documents</a></p>
  <h4>Next topic</h4>
Y
Yu Yang 已提交
7949 7950
  <p class="topless"><a href="../../../dev/new_layer/index.html"
                        title="next chapter">Writing New Layers</a></p>
Y
Yu Yang 已提交
7951 7952 7953 7954 7955 7956 7957 7958 7959 7960
  <div role="note" aria-label="source link">
    <h3>This Page</h3>
    <ul class="this-page-menu">
      <li><a href="../../../_sources/source/gserver/layers/layer.txt"
            rel="nofollow">Show Source</a></li>
    </ul>
   </div>
<div id="searchbox" style="display: none" role="search">
  <h3>Quick search</h3>
    <form class="search" action="../../../search.html" method="get">
7961 7962
      <div><input type="text" name="q" /></div>
      <div><input type="submit" value="Go" /></div>
Y
Yu Yang 已提交
7963 7964 7965 7966 7967 7968 7969 7970 7971 7972 7973 7974 7975 7976 7977 7978 7979 7980 7981
      <input type="hidden" name="check_keywords" value="yes" />
      <input type="hidden" name="area" value="default" />
    </form>
</div>
<script type="text/javascript">$('#searchbox').show(0);</script>
        </div>
      </div>
      <div class="clearer"></div>
    </div>
    <div class="related" role="navigation" aria-label="related navigation">
      <h3>Navigation</h3>
      <ul>
        <li class="right" style="margin-right: 10px">
          <a href="../../../genindex.html" title="General Index"
             >index</a></li>
        <li class="right" >
          <a href="../../../py-modindex.html" title="Python Module Index"
             >modules</a> |</li>
        <li class="right" >
Y
Yu Yang 已提交
7982
          <a href="../../../dev/new_layer/index.html" title="Writing New Layers"
Y
Yu Yang 已提交
7983 7984 7985 7986
             >next</a> |</li>
        <li class="right" >
          <a href="index.html" title="Layers Documents"
             >previous</a> |</li>
7987 7988 7989
        <li class="nav-item nav-item-0"><a href="../../../index.html">PaddlePaddle  documentation</a> &#187;</li>
          <li class="nav-item nav-item-1"><a href="../../../layer.html" >Layer Documents</a> &#187;</li>
          <li class="nav-item nav-item-2"><a href="index.html" >Layers Documents</a> &#187;</li> 
Y
Yu Yang 已提交
7990 7991 7992
      </ul>
    </div>
    <div class="footer" role="contentinfo">
7993
        &#169; Copyright 2016, PaddlePaddle developers.
7994
      Created using <a href="http://sphinx-doc.org/">Sphinx</a> 1.4.9.
Y
Yu Yang 已提交
7995 7996 7997
    </div>
  </body>
</html>